SQL & PL/SQL :: Find Difference In Two Schemas?
Feb 25, 2013
I want to find difference between the objects(tables(columns,constraints), views, sequences) in two schemas. One schema is staging and one is development . In development lot of changes are made , Is there a script or a opensource tool which will bring out the difference in columns, constraints in each table and sequences , views etc.
View 2 Replies
ADVERTISEMENT
Dec 9, 2010
findout and to fill up the excel which lists down the Database schemas and states whether they have in active / or not.
Active state may be determined whether it has been used for the last 3 months or so. The last updated time may be a good indicator of the same.
View 2 Replies
View Related
Aug 21, 2010
I need to query a table to get the time difference based on different dates.
SAMPLE DATA:
JOB ID start_time end_time
1 201008190056 19/08/2010 01:23:12
2 201008190123 19/08/2010 01:50:12
2 201008200045 19/08/2010 01:50:12
3 201008070345 7/08/2010 04:50:12
3 201008070345 7/08/2010 04:50:12
1 201008070003 7/08/2010 00:30:12
in the above, for job 1 ,on 19/08/2010 the time difference should be calculated as
01:23:12-00:56:00 and the difference should be in minutes.
for end_time. i can't take the substring as the length of the date varies for 19 and 7. In case of start date, the time has to be in format, hh:mm:ss, to calculate the difference.
View 2 Replies
View Related
Aug 1, 2012
how to find the difference between time stamp in two variables.
Say in a java file i am getting start time and end time i am storing it in a string variables now i need to know what is the time difference of them in millisecond
Srting1 of java will give me some thing like
StartTime =2012-08-01 15:14:20.36 +5:30
Srting2 of java will give me some thing like
EndTime =2012-08-01 15:14:21.254 +5:30
I need to take the millisecond difference between them the code i have written in java and connecting oracle database and doing some logic's in java so i need to capture start time and end time of code.!
View 22 Replies
View Related
Jul 20, 2013
I have two tables tab1 and tab2 with below data Now requirement is to find difference between two table with respect to column "serial_no" which exist only in table tab1 so as per below at serial_no 2 CC4 in tab1 but CC2 in tab2 so this is different how to dump out this data
TAB1
SQL> select * from tab1;
PARENT CHILD ROW_ID SERIAL_NO
-------------------- -------------------- ---------- ----------
P1 CC1 101 1
P1 CC4 104 2
P1 CC5 105 3
P1 CC2 102 4
P1 CC3 103 5
TAB2
SQL> select * from tab2;
PARENT CHILD PREVIOUS_ROWID ROW_ID NEXT_ROWID
-------------------- -------------------- -------------- ---------- ----------
P1 CC1 0 101 102
P1 CC2 101 102 103
P1 CC3 102 103 104
P1 CC4 103 104 105
P1 CC5 104 105 0
create table tab1(parent varchar2(20), child varchar2(20),row_id integer,serial_no integer);
insert into tab1 values('P1','CC1',101,1);
insert into tab1 values('P1','CC4',104,2);
insert into tab1 values('P1','CC5',105,3);
insert into tab1 values('P1','CC2',102,4);
insert into tab1 values('P1','CC3',103,5);
create table tab2(parent varchar2(20), child varchar2(20),previous_rowid integer,row_id integer,next_rowid integer);
insert into tab2 values('P1','CC1',0,101,102);
insert into tab2 values('P1','CC2',101,102,103);
insert into tab2 values('P1','CC3',102,103,104);
insert into tab2 values('P1','CC4',103,104,105);
insert into tab2 values('P1','CC5',104,105,0);
View 8 Replies
View Related
Jul 8, 2010
i want to find out difference between two dates in day-month-year. How can i do it?
For example how many days,months are years are between '01-jul-1979' and '08-jul-2010'
View 4 Replies
View Related
Apr 25, 2011
1) First Problem:
Difference in hours is supposed to be 35 but it comes as 34.When i manually find the difference in days and multiply by 24 it comes as 34.999999999 and floor converts it as 34.. But when i execute the difference between dates alone and convert to 24 it shows as 35. So when i apply floor to this, it should be 35 instead of 34 right?
SQL> select (to_date('2011-05-03 09:00:00', 'yyyy-mm-dd hh24:mi:ss') -
2 to_date('2011-05-01 22:00:00', 'yyyy-mm-dd hh24:mi:ss'))
3 from dual
4 ;
[code].....
1) Second Problem:
For the following query, difference of the dates in minutes is 2100.. so mod(2100,60) should give 0 but it's giving 60.. Separately if if put mod(2100,60) it is giving as 0 only.
SQL> SELECT MOD(((to_date('2011-05-03 09:00:00', 'yyyy-mm-dd hh24:mi:ss') -
2 to_date('2011-05-01 22:00:00', 'yyyy-mm-dd hh24:mi:ss')) * 1440),
3 60) AS duration,
4 (to_date('2011-05-03 09:00:00', 'yyyy-mm-dd hh24:mi:ss') -
5 to_date('2011-05-01 22:00:00', 'yyyy-mm-dd hh24:mi:ss')) * 1440 as diffinmin
[code]....
View 2 Replies
View Related
May 26, 2011
We want to find out difference of data for some tables between current day & previous day. We can use query with minus operation but it will take lot of time since table size is in range from 200 to 500 GB. We have to do this exercise every day.
View 5 Replies
View Related
Jan 8, 2013
Is there any way to run a select command between 2 different schemas without using DB links ?
View 1 Replies
View Related
Feb 2, 2010
One function returns table metadata in xml form. This works for current schema but not for other schemas. Is it a privilege problem?
my code is..
CREATE OR REPLACE FUNCTION TEST.F_DBEG2
RETURN XMLTYPE
AS
Handle NUMBER;
V_OUTPUT_TOTAL XMLTYPE;
V_CNT NUMBER := 0;
BEGIN
[code]....
but when i select the object of another schema, got output.
SELECT * FROM TEST_NEW.DEPT;
Which privilege i need?
View 9 Replies
View Related
Jun 6, 2012
I'm trying to get the Create-Statements of all tables of several schemas:
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name,'<schmema>')
FROM (SELECT TABLE_NAME, OWNER FROM SYS.ALL_TABLES WHERE owner='<schema>') u
Is there a way to create a loop to handle several schemas listed in a array, for example?
View 10 Replies
View Related
Oct 17, 2012
Detail table will look like below:
Product_id issue_date action_date Force_date
1 10/10/2012 10/10/2012 10/10/2012
2 10/10/2012 10/10/2012 10/10/2012
3 10/10/2012 13/10/2012 15/10/2012
[code]....
Need the data like
Issue_date count_action_date count_Force_date (diff(action_date,force_date) 1 2 3 4 5 6(days since over)
10/10/2012 3 4 1 4 2 1 0 0
How to get the data like this? automatically how to get 123.... and how to calculate the difference by which day the count of difference is going?
View 3 Replies
View Related
Apr 27, 2011
I am trying to export schemas from 10g to 11g. The NLS_CHARACTERSET for 10g is WE8ISO8859P1 and the NLS_CHARACTERSET for 11g is WE8MSWIN1252. Is it fine or do I need to change the character set, so that I will be able to successfully do the export/import?
View -1 Replies
View Related
Jul 14, 2011
I have a role mfg_grp .I want to know, to whom the role is granted and which objects and which privileges on those objects are assigned to this role.
View 4 Replies
View Related
Sep 16, 2013
I need to retrieve the list of tables with same name from 2 different schemas.
View 10 Replies
View Related
May 25, 2011
I have following schemas in my database scott,sh,hr...I created a triger on a schema scott with the following method
1. sqlplus / as sysdba
2. CREATE TABLE LOGIN_AUDIT_INFO_ALL (
operation VARCHAR2(30),
obj_owner VARCHAR2(30),
object_name VARCHAR2(30),
sql_text VARCHAR2(64),
attempt_by VARCHAR2(30),
attempt_dt DATE);
3.CREATE OR REPLACE TRIGGER login_audit_prod_schemas
AFTER CREATE OR ALTER OR DROP
ON SCOTT.SCHEMA
[code]....
But it don't fulfill my requirement. trigger is fired when scott perform any action. but my requirment is that trigger should be fired when create action is performed on scott by hr,sh or scott. i also want a single trigger which fulfill the requirement.
View 8 Replies
View Related
May 19, 2013
i have schema A and i want to check who(which schemas) can access schema A's objects and what privileges other schemas have on objects of schema A.
View 7 Replies
View Related
Feb 6, 2013
i am trying to generate a SUM from the individual schemas to put on this report but i can't seem to get it right...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=WINDOWS-1252">
<meta name="generator" content="SQL*Plus 11.2.0">
<TITLE>Launch page </TITLE></head>
<body>
<table border='1' width='90%' align='center' summary='Script output'>
[code].....
View 1 Replies
View Related
Aug 5, 2013
find the below task. I have unique schemas. and every schema we have many tables.I would like to know
1. I have Scott schema and here I have 10 tables. EMP,DEPT,SALGARDE ( and these tables having different priviliges).
2. another schema MACIN having table DEPT, SALS, GRADE ( having different priviliges) Now I would like to know Schema 1 having permissions to see the tables and he is doing some modifications,inserting,deleting .... on tables containing in MACIN schema.like this it is happening in vice verse in max schemas. now I would like to know who all are having access to login to another schema and what are the priviliges they have till now on what tables they applied changes...is it possible to figure out? if yes how can we?
View 6 Replies
View Related
Sep 22, 2013
After successfully installing the 12c, how can I connect to pdb to use the scott or hr schemas?By default when I connect as sys or system from sqlplus it is connecting to orcl not to pdborcl.also how can we make scott connection in sql developer.
View 11 Replies
View Related
Apr 17, 2013
My primary objective was to compare objects in schemas in two different databases and find out the differences, Execute DDL's in the database where objects are missing and syn schemas in two different databases.
So I need to compare schemas in databases. Which tool will be user friendly to make a comparison of database objects existing in schemas in two different databases.
I'd like to see if I can get a list of pro and cons between Toad and SQL Developer for comparing schemas pros and cons. How to make a comparison. I have some idea on using TOAD but was not familiar with SQL Developer.
Below is my requirement:-
Connect to Source
Connect to Target
Compare schemas with different object types
Find out differences
Generate DDL's for the missing objects or for the objects in difference report
Run them in missing instace(Source/Target)
Make sure both are in sync.
View 2 Replies
View Related
Apr 19, 2010
I connect to an Oracle-10g database using OEM, and if I click to see the list of users, roles, storage options, ... everything is ok, but if I click to see the list of schemas, I get "1031: insufficient privileges" error.
The user account I use has the SELECT_ANY_DICTIONARY privilege and SELECT_CATALOG_ROLE role granted, and if I try to do "select * from dba_tables" in the SQL*Plus, I get a result.
The matter is even more strange because, if I use the SYSTEM account, I get the same error (!!!).
Do I need any other privilege/role to see the user's schemas with OEM?
View 2 Replies
View Related
Jul 25, 2010
Is it possible to create two objects in different schemas in a single database.
For example in Schema A, table "T1" is there, is to possible to create a table with the same name "T1" in Schema B.
View 4 Replies
View Related
Jan 20, 2011
I have two schemas with 149 tables in each schema, what I need to do is to prove that the content(data) between the two schemas is identical. I know that all the table names between the two schemas are the same, just need to prove that there is no difference in data.
So the query needs to prove that Schema A content = Schema B content
I know I cant do a simple select from Schema A.tab1 minus select Schema B.tab1 but since there are 159 tables, I am not sure if this is an efficient way of doing it.
View 14 Replies
View Related
Oct 13, 2013
Database: 12cR1, 12.0.1.0, x64System: Oracle Linux 6.4, x64
I installed a simple starter database during the installation of Oracle Database 12cR1 with the PDBORCL option selected (default) and would like to install the Oracle Example data, such as users HR schema, etc.
according to URL....IDENTIFIED BY hr *ERROR at line 1:ORA-65096: invalid common user or role name
Perhaps the scripts were not designed for container and plug-able databases. I did the following:
alter pluggable database pdborcl open;alter session set container=PDBORCL;@?/demo/schema/human_resources/hr_main.sqlUser altered. Grant succeeded.Grant succeeded.Connected.GRANT execute ON sys.dbms_stats TO hr
*ERROR at line 1:ORA-01917: user or role 'HR' does not exist
I could probably create a normal database, but I wonder if there is any other option without having to modify the setup scripts.
View 2 Replies
View Related
Jun 12, 2012
Im using APEX 4.0. We startet with APEX 2.2 and upgraded it till 4.0. Database is 10g
The application generates emails which schould be send by APEX background job via APEX_MAIL.PUSH_QUEUE. Currently no mails will be send. Mails are added to APEX_MAIL_QUEUE only. I don´t see anything in columns MAIL_SEND_COUNT and MAIL_SEND_ERROR. Administrators of email server say that they don´t see any attempt to send the mails in our mail queue in mail server logs.
It´s possible to send mails with UTL_SMTP!There is no error produced by APEX push_queue background job.But there are several jobs running:
Schema: FLOWS_030100
Job: wwv_flow_mail.pusch_queue(...)
Job: wwv_flow_cache.purge_sessions(..)
Schema: APEX_0400000
Job: wwv_flow_mail.pusch_queue(...)
Ok, it´s possible that´s this is an error of our database administrator.
1. Shouldn´t I see the two background jobs (push_queue, purge_sessions) in schema APEX_0400000?
2. Should I kill push_queue job in schema FLOWS_030100? Where schould the jobs run?
3. How can I debug push_queue? Even if I run it manually I don´t get any return values/errors?
4. Must the jobs have job id 4002 and 4001?
View 3 Replies
View Related
Mar 11, 2012
There are two different DBs having similar schema. Need to compare the rows in the tables and insert in the 1st DB whatever is different in 2nd DB.
Can I choose which rows to insert which to discard from 2nd DB in 1st DB.
View 2 Replies
View Related
Oct 19, 2011
I would like to know the Replication method which is fast and the best approach,we need two schemas to be moved/replicated to a new reporting database.It appears that data is to be flown in one way,do we proceed with Materialized view replication or please clarify about Oracle Streams and Advanced replication. what are the factors to decide the replication method.
View 3 Replies
View Related
Jan 10, 2013
RDBMS Version:11.2.0.3
Both source and Target DBs are in Grid Infrastructure version : 11.2.0.3
Planning to Migrate RHEL 5.4 to Solaris 10
Currently we have 3 schemas with a combined size of 4 Terabyte in 11.2.0.3 RAC ASM in RHEL 5.4. All these 3 schemas share one tablespace which has around 150 datafiles.
We want to move these 3 schemas to a Solaris RAC DB with ASM.
If we use Transportable tablespace , should there be any down time for Target DB ?
View 6 Replies
View Related
Feb 7, 2013
We have 2 apex schemas
APEX_030000
APEX_040200
Before executing the apxchpwd.sql, found the "alter session command" sets schema to APEX_030000. So we changed that to APEX_040200. Then we executed the sql script. It executed fine.
But now when we try to login to apex, and pressing enter after providing the username/pwd, it raises the following exception
Error Error in PLSQL code raised during plug-in processing.
ORA-06508: PL/SQL: could not find program unit being called
View 1 Replies
View Related