Get Differences between two databases
Hello there,
I need to check if there are differences between 2 databases, both on 10g. As I do not want to check all tables, triggers, procedures and so on manually I wonder whether there is a script where I just need to give the db_names for checking both databases?
best regards,
Jörn
Hi there,
first, I need to know structural differences like row datatypes, indexes or triggers. I don't need to know what exactly is different just which objects.
Second, I would also like content - differences between two tables, so the exact table data compared to each other. But this is not as important as the first one.
best regards
Jörn
Similar Messages
-
How to Calculate AGE by getting difference between two Date Fields
HI Gems
I need to calculate AGE from getting difference from two date fields. But when i am trying to wrte fromula as Current date - date1(some date field) then it is showing error.
How can i get values.
Thanks
ManuYou already asked this question:
How to calculate AGE from two different date fields -
Detecting differences between two databases
We've two big databases (20 Gb) on essbase 6.5 and System 9. We need to know if there are any differences between them. Is there a way to do that different from querying both databases with a lot of reports and comparing them?
Any suggestion will be helpful.
Thanks and regards,
Joaquin CastellanoYou can compare two dbs with something I call a difference cube. For example, lets say you have two 5 dimensional databases that are very similar. Perhaps you made some changes in calcs and want to see the impact. Call the cubes Before and After . You could make a third copy and add a dimension. The members of the 6th dimension would be Before, After and Difference. Put a calc on Difference = After-Before. You can load the 5 dims worth of data from before to the before member and the same thing with after. You need to either use a rule with a header or you can use @XREF or partitioning. You can actually zoom and pivot through the resulting cube to identify differences.
There are some tricks to getting it right.
The first is to load the 5D data to the 6D cube. That's really not hard if you know how to use @XREF or parititioning or headers in a rule. I can explain this in detail or if you like I'll show you via a webex support session.
The second issue is size. If the first cube is 10gb then you will end up with 30gb for three versions. But you can moderate that by adding the 6th dimension to the Test cube and using dynamic XREFs.
Here is a link to a pdf that helps explain the process.
http://www.mtgny.com/Difference%20Cubes.pdf
If you send me your email address I'll send you some Maxl that will do the whole job for you with just a little tweaking for for your cube names etc.
Other things to look at include the outline chnage log file and the OLAP underground outline extractor to compare outlines.
Hope this helps. Please contact me if you need more info.
Ron
[email protected] -
Most elegant way to get difference between two tables - not minus!!!
Hi,
Simplified example of what I am trying to achieve - I have two tables ORIGINAL and REVISED.
My desired result is to compare the two, such that; -
Where data exists in both tables I get the difference between the Budget column, and if there is no difference then I want no rows.
Where data exists in ORIGINAL but not in revised I want the inverse of the current value of the Budget column.
Where data exists in REVISED I want the value from REVISED.
I can see how I can do this, cf below, but is there a more elegant solution??
Data for table ORIGINAL
select '801040' entity, '2186' expense_type, 234000 budget
from dual
union all
select '801040' entity, '3001' expense_type, 1000 budget
from dual
union all
select '801040' entity, 'P132' expense_type, 34000 budget
from dual
union all
select '801040' entity, 'P135' expense_type, 43000 budget
from dualData for table REVISED
select '801040' entity, '2186' expense_type, 235000 budget
from dual
union all
select '801040' entity, 'P132' expense_type, 34000 budget
from dual
union all
select '801040' entity, 'P139' expense_type, 56000 budget
from dualDesired output
ENTITY EXPENSE_TYPE DIFFERENCE
801040 2186 1000
801040 3001 -1000
801040 P135 -43000
801040 P139 56000
5 rows selected.
Current code to achieve this, is there a better way??
select original.entity
, original.expense_type
, (nvl(revised.budget,0) - original.budget) as difference
from original
, revised
where original.entity = revised.entity(+)
and original.expense_type = revised.expense_type(+)
and (nvl(revised.budget,0) - original.budget) != 0
union all
select revised.entity
, revised.expense_type
, revised.budget as difference
from revised
where not exists
(select 'x'
from original
where original.entity = revised.entity
and original.expense_type = revised.expense_type)
and revised.budget != 0Many thanks for your input,
Robert.
Edited by: Robert Angel on 17-Jan-2012 03:31 to change not equals to != - thanks for heads upUse full outer join:
with original as (
select '801040' entity, '2186' expense_type, 234000 budget from dual union all
select '801040' entity, '3001' expense_type, 1000 budget from dual union all
select '801040' entity, 'P132' expense_type, 34000 budget from dual union all
select '801040' entity, 'P135' expense_type, 43000 budget from dual
revised as (
select '801040' entity, '2186' expense_type, 235000 budget from dual union all
select '801040' entity, 'P132' expense_type, 34000 budget from dual union all
select '801040' entity, 'P139' expense_type, 56000 budget from dual
select nvl(o.entity,r.entity) entity,
nvl(o.expense_type,r.expense_type) expense_type,
nvl(r.budget,0) - nvl(o.budget,0) budget
from original o
full join
revised r
on (
r.entity = o.entity
and
r.expense_type = o.expense_type
where nvl(r.budget,0) - nvl(o.budget,0) != 0
ENTITY EXPE BUDGET
801040 2186 1000
801040 3001 -1000
801040 P135 -43000
801040 P139 56000
SQL> SY. -
How to get difference between two rows for a column field?
hi, all,
Could anyone show me what query statement is to get the difference betweem two rows for two column fields?
The tables and its records are like this:
id, begin, end
p1 21 30
p2 45 60
p3 120 150
I would like to have the query result like this
id, diff
p1 15 --- which is 45 minus 30
p2 60 --- which is 120 minus 60
and so on...
thank you in advance.
RaffyYou can use the LAG function to access values from previous rows:
with q as (select 'p1' id, 21 v_start, 30 v_end from dual
union all
select 'p2', 45, 60 from dual
union all
select 'p3', 120, 150 from dual)
select id, v_start, v_end, v_start - lag (v_end, 1, 0)
over (order by id) v_diff from q
ID,V_START,V_END,V_DIFF
p1,21,30,21
p2,45,60,15
p3,120,150,60
See the SQL Language doc
http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions075.htm -
Difference between two Database s in CRM
Hi All,
Can anyone explain in details to me the functionality of CDB (Consolidated Database) and CRM Online Database?
Regards
Siddhartha SenguptaHi Siddhartha,
CRM database is an operational database for all crm operations
CDB database is a copy of CRM database, it is maily use for Offline usage.
It can be said that what ever content you require for offline useage you replicate in CDB from CRM. CRM and CDB are always in sync with each other.
help.sap.com/saphelp_crm50/helpdata/en/cc/7c4a5b4632d411ab370060b03c3b0b/content.htm
Best Regards,
Pratik Patel
<b>Reward with Points!</b> -
Calculated columns to get difference between two dates with half day
Hi,
So there is the problem I'm using a calculated column to track the number of day when an employee make a vacation request. I'm already taking weekends of the case but now I would need to be able to ask for only a half day off.
How could I perform that without taking out my first requirement?
Just in case there is my current formula:
=IF(AND((WEEKDAY([EndDate],2))<(WEEKDAY([StartDate],2)),((WEEKDAY([StartDate],2))-(WEEKDAY([EndDate],2)))>1),(((DATEDIF([StartDate],[EndDate],"D")+1))-(FLOOR((DATEDIF([StartDate],[EndDate],"D")+1)/7,1)*2)-2),
Thanks for your answers :)Hi amber,
you can simple calculate.
try this:
DATA: date1 like sy-datum,
date2 like sy-datum.
data I type i.
date1 = '20070301'.
date2 = '20070228'.
i = date1 - date2.
write: / date1, date2, i.
date1 = sy-datum.
date2 = sy-datum - 30.
i = date1 - date2.
write: / date1, date2, i.
Regards, Dieter -
Difference between Two Date Should come into Text Item
Dear All,
i want to get difference between two date into text Item :P36_C in On Change java script.
i have two Date Item :P36_A and :P36_B .i have extract these date value from table then difference comes into Text Field :P36_C.
Now i want if i change Date into Item :P36_A or Item :P36_B then Defference between two date Should Come into Item :P36_C .
So i have use Java Script Code to do this
<script>
function diffdat(){
function getVal(item){
if($x(item).value != "")
return parseFloat($x(item).value);
else
return 0;
$x('P36_C').value =
getval((TO_DATE('P36_B', 'DD-MON-YYYY'))-
getval(TO_DATE('P36_A', 'DD-MON-YYYY')))+1;
</script>
i have put this into Item HTML Form Element Attributes
onChange="javascript:diffdat();"it's not woring .
How to work that Code with dates.
ThanksYou can always create your own difference function based on your own criteria. You can modify this to suit your needs.
CREATE OR REPLACE FUNCTION CALC_OFFICE_DAYS(date1 DATE, date2 DATE)
RETURN NUMBER
IS
v_begin_date DATE := date1;
v_end_date DATE := date2;
v_office_start_time VARCHAR2(10) := '09:30 AM';
v_office_end_time VARCHAR2(10) := '06:30 PM';
v_comp_begin_time DATE;
v_comp_end_time DATE;
v_days PLS_INTEGER := 0;
v_hrs NUMBER := 0;
v_ttltm NUMBER;
BEGIN
select trunc(v_end_date) - trunc(v_begin_date)
into v_days
from dual;
select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_begin_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
into v_comp_begin_time
from dual;
select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_end_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
into v_comp_end_time
from dual;
select (v_comp_end_time - v_comp_begin_time)/24 into v_hrs from dual;
IF v_hrs > 4 then
v_ttltm := v_days + .5;
ELSE
v_ttltm := v_days;
END IF;
return v_ttltm;
END;
As has been noted, this question is best posted on the PL/SQL forum. -
How to get the difference between two columns in a column group
Hi All,
My first time here and really new to programming. I would like to get the difference between 2 columns that are inside
a column group.
Here is my sample table below: The Column Group is PeriodNumber and can only choose 2. like 1 and 2.. I would like to have a third row which will simply calculate the difference between the amounts in PeriodNumber 1 and 2.
PeriodNumber
Account 1 2
1) Cash 10,000 15,000
2) Receivables 12,000 11,500
3) Equipment 5,000 5,500
Total Assets 27,000 32,000Hi yabgestopa,
From your description, you want to get the difference between two columns in a column group. After testing it in my environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
Dim Shared Num1 As Integer
Dim shared Num2 As Integer
Public Function GetAmount(Amount as Integer, Type as String)
If Type = "1" Then
Num1=Amount
Else
Num2=Amount
End If
Return Amount
End Function
Public Function GetDif()
Return Num1-Num2
End function
Right-click the second column to insert a third column with Outside Group-Right.
Then use the expressions below in the matrix.
=Code.GetAmount(Fields!Amount.Value,Fields!PeriodNumber.Value)
=code.GetAmount(Sum(Fields!Amount.Value),Fields!PeriodNumber.Value)
=Code.GetDif()
The report looks like below.
If you have any questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
How to get the difference between two date
Hello,
I want to know how to write a code the tell me the difference between two date, I am using
oracle.jbo.domain.Date
i have a rent date and return date so my code is
Date rent=(Date)nr.getAttrbute("RentDate"),ret=(Date)nr.getAttrbute("ReturnDate");
is there a way to know the difference in days between those two dates ?
Thankshi,
try this.....
DateFormat formatter = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy");
Date date = (Date)formatter.parse(dateStr); //// dateStr <- from date value (that is string value)
Date dateto = (Date)formatter.parse(datetostr); //// datetostr <- to date value (to date getting from as a string)
Calendar cal = Calendar.getInstance();
cal.setTime(date);
Calendar calto = Calendar.getInstance();
calto.setTime(dateto);
fromDate = cal.get(Calendar.DATE) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.YEAR);
toDate = calto.get(Calendar.DATE) + "/" + (calto.get(Calendar.MONTH) + 1) + "/" + calto.get(Calendar.YEAR);
// System.out.println("from Date : " + fromDate);
if ((fromDate != null && toDate != null) && (date.compareTo(dateto) > -1) ) {
fc.addMessage("VacationQueryComponent", new FacesMessage(FacesMessage.SEVERITY_ERROR, "From Date cannot be lower than To Date", "From Date cannot be lower than To Date"));
fc.renderResponse();
thks. -
How to get percentage difference between two matrices?
Good day everyone, I just want to ask how to get the percentage difference between two binary matrices. This is for comparing two images converted to matrices in LabView. Thank you.
Solved!
Go to Solution.pinkman wrote:
Good day everyone, I just want to ask how to get the percentage difference between two binary matrices. This is for comparing two images converted to matrices in LabView. Thank you.
You probably converted it to a 2D array (A matrix in LabVIEW has a special meaning).
"Binary" is not very well defined (unless you are looking for the number of bits that are different). What is the datatype? Was it a color image or a greyscale image? Are both arrays the same size?
How do you define "percentage difference"? Which one of the two is the 100% reference?
Do you want a new 2D array where each element is the difference of the second array compared to the first (or vice versa), expressed in percentages?
Do you want to know what percentage of array elements are different between the two arrays?
Do you want to know the average difference between all array elements?
All possible interpretations can be easily solved with very little code, but you need to explain in more detail what you actually want?
Here is a simple solution for case #2, for example (assuming the array have the same size, and we only want a rought estimate, rounded down to the nearest integer percent):
LabVIEW Champion . Do more with less code and in less time .
Attachments:
PCT-Difference.png 16 KB -
Java code to get the difference between two dates in days
Hi ppl,
I need to write a user defined function to get the difference between two date nodes, in days.Please help me out
regards,
PrashanthHi,
have a look at those two:
(How do I calculate the difference between two dates?)
http://joda-time.sourceforge.net/faq.html
Calculating the Difference Between Two Datetime Stamps
http://www.xmission.com/~goodhill/dates/deltaDates.html
Get difference in days
http://javaalmanac.com/egs/java.util/CompDates.html
Regards,
michal -
How to get the difference between two BufferedImages?
All the BufferedImage which is grabbed from AWT may be same each other,
i only want to get the different part of two continuous BufferedImages and send ti over internet.
I have compared two BufferedImages by RGB (int[]), but this process wastes 400~500ms,it's terrible,:)
who has any good idea about this?
thanks
Best Wishes
mauvespanthanks ! cary ,
I have a list contained some BufferedImages gotten from AWT component,and then these images
will be transfered to client and displayed in Internet explore ,actually there are only some difference
between two continuous BufferedImages,i don't want to transfer the WHOLE image to client,SO i
want to handler every image before sending to client , at last, the different part will only be sent to client.
All these ideas will be contained this method:
* Compare the specified two BufferedImages and return the different part between them.
* @param ref the specified first image
* @param gen the specified sencond image
* @return the different part between the specified two images.
public static void BufferedImage compareBufferedImage(BufferedImage ref,BufferedImage gen){
to finish this method ,do you have any good ideas?or sample code?
thanks
Best wishes
mauvespan -
Function Module to get the difference between two times.
Hi All,
I want to know if there is any function module that gives me the difference between two specified times.
For Ex: Time 1: 12/01/2007 00:01 A.M
Time 2: Time 1 - 180 Seconds. This changes the time, also may even change the Date. (As in above situation, the Time 2 will be 11/30/2007 11:58 P.M)
Could some one please suggest if there is any function module for this case.
Thanks in Advance.Hi, You can use the following function module to calculate the diffrence between to dates in the unit that you want.
COPF_DETERMINE_DURATION calculates the difference between two dates and time in minutes and hours.
Parameters:
EXPORTING
I_START_DATE "The start date of the time interval
I_START_TIME "The start time of the time interval
I_END_DATE "The end date of the time interval
I_END_TIME "The end time of the time interval
I_UNIT_OF_DURATION "Time unit of the duration if not to be calculated in days.
Value ===== Meaning
' ' ===== Day (default)
D ===== Days
H ===== Hours
MIN ===== Minutes
MON ===== Months
S ===== Seconds
WK ===== Weeks
YR ===== Years
I_FACTORY_CALENDER "A factory calender if not using the Gregorian calender
IMPORTING
E_DURATION "Time difference in unit specified.
Message was edited by:
Rajesh Soman -
Date difference between two dates
hi All,
i have to right a stored proc to find the difference between two dates.
for example of i give
startdate as 4/1/2015 and enddate 14/1/2015
i should get 1 year , 10 days and 0 months .
i have tried the DateDiff function but it does not calculate the leap year.
please help.DECLARE @from datetime
DECLARE @to datetime
SET @from = '20150104 8:00'
SET @to = '20150114 10:30'
SELECT DATEDIFF(minute,@from, @to) % 60 as Minutes
SELECT (DATEDIFF(minute,@from, @to) / 60) % 24 as Hours
SELECT DATEDIFF(minute,@from, @to) / (60 * 24) as Days
SELECT DATEDIFF(month,@from, @to) as Months
SELECT DATEDIFF(year,@from, @to) as Year
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence
Maybe you are looking for
-
E72 Option to add in more tones voices
The E72 phone function of "Say Caller's name" is quite useful as it voice out the caller's name & even read out the e-mail text msg that we received when we opened up to view them. However, there's only two options so far as in only got 2 different t
-
Used iWeb 09 to build a web page with a template: Now the left column is unavailable for edit or selection as a text box. If I "select all", it is selected with all other elements on the page--and I can move the box--but still can't edit the text in
-
Hi guys, I am doing a bdc recording for transaction co02. when i got to CO02 transaction and give the order no and press enter.Then in the next screen if u go to menu Function-->Read pp master data, then a small pop-up screen will come.In that screen
-
Oracle's Support to reduce Negotiation lead time
Hi Everybody, How we can use oracle apps to reduce lead time during bid to PO cycle. Are there any oracle apps features/best practises which can help reducing lead time.
-
ITunes doesn't adds all files from folder?
Dear Apple, I'm having *itunes 8.1.1*,and i do like this; file -> add folder to library (or something, it's in dutch). And he only adds 397 files of 1030 in that folder. How come? *Please help me!* Tom. Message was edited by: faceplant!