3.1 Database Diff

I was playing around with the Database Diff tool in 3.1, and I was trying to compare an object between 2 instances, where the objects were owned by a schema of the same name, AND where that schema was not the username I was logged-in with.
It looks like the compare tool kept trying to compare an object in the target schema with a matching object in the schema I was logged in with, rather than looking in the target schema in both instances.
Is there a way to do this? For example, could someone logged in as SMITTHJ compare objects in 2 separate instances, where the object MOVIE was owned by SCOTT in both instances?
Thanks,
--=Chuck

I also ran into a variation of this bizarre assumption and actually thought it was a bug while attempting to export a schema using a SYS connection. The target schema for export was not SYS, but tons of SYS and SYSTEM objects appeared in the export file, while not appearing in the summary of which objects would be exported.
If you want the gory details : Re: EA 3.1 - Database export - export file contains SYS objects - BUG ?
Both functions (export and diff) assume that the connected schema is relevant to the function, which I find a bizarre assumption.
Please add my vote to have the Diff and Export functionality changed to not assume the connected schema is the basis of comparison.

Similar Messages

  • Database Diff script creates redundant indexes and fails

    In Version 4.1.0.18, I create a table such that the primary key constraint and unique index have the same name:
        CREATE TABLE "MY_TABLE"
         ( "CORP_ID" CHAR(2 BYTE),
           "COMPANY_ID" NUMBER(5,0),
           CONSTRAINT "PK_MY_TABLE" PRIMARY KEY ("CORP_ID", "COMPANY_ID") ENABLE
    The DDL export of this table yields a different approach but the same end results:
        CREATE TABLE "MY_TABLE"
         ( "CORP_ID" CHAR(2 BYTE),
           "COMPANY_ID" NUMBER(5,0)
        CREATE UNIQUE INDEX "PK_MY_TABLE" ON "MY_TABLE" ("CORP_ID", "COMPANY_ID");
        ALTER TABLE "MY_TABLE" ADD CONSTRAINT "PK_MY_TABLE" PRIMARY KEY ("CORP_ID", "COMPANY_ID") ENABLE;
    Perfectly fine - no issue there.
    But if I do a complete Database Diff (all object types) and the target database is missing the table, the resulting script uses a combined approach:
        CREATE TABLE "MY_TABLE"
         ( "CORP_ID" CHAR(2) NOT NULL ENABLE,
           "GL_ACCOUNT" VARCHAR2(16),
           CONSTRAINT "PK_MY_TABLE" PRIMARY KEY ("CORP_ID","COMPANY_ID") ENABLE
       CREATE UNIQUE INDEX ."PK_MY_TABLE" ON "MY_TABLE" ("CORP_ID","COMPANY_ID");
    In this script, the CREATE TABLE will correctly create both the constraint and index.  Therefore the CREATE INDEX fails because the index already exists.

    In this script, the CREATE TABLE will correctly create both the constraint and index.  Therefore the CREATE INDEX fails because the index already exists.
    Can't help you beyond saying that is a bug since the DIFF should NOT do both of those.
    Someone from the sql dev team will need to tell you if the bug is in sql dev or the package sql dev is using to do the diff.
    Can you open the log window and review the SQL being generated/executed by sql dev?
    Sql Dev is likely using the DBMS_METADATA_DIFF package to generate the diff:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_metadiff.htm
    If they are using it correctly but you get that error then it is an Oracle DB bug that needs to be filed.
    If sql dev is using the package incorrectly then sql dev has a bug and the team can address that.
    Sorry I can't help you more.

  • SQL Dev  3.0.04 Database Diff on Tables ignores Enabled/Disabled flag. Bug?

    Hello everyone,
    it seems like SQLDeveloper Ver. 3.0.0.4 Tools -> Database Diff ignores ENABLED/DISABLED flag when comparing tables. Namely, two tables (in two schemas) were reported identical although a foreign key constraint was enabled in one schema and disabled in the other schema.
    Am I missing something or is this indeed a bug?
    Many thanks,
    Bob

    Hello everyone,
    it seems like SQLDeveloper Ver. 3.0.0.4 Tools -> Database Diff ignores ENABLED/DISABLED flag when comparing tables. Namely, two tables (in two schemas) were reported identical although a foreign key constraint was enabled in one schema and disabled in the other schema.
    Am I missing something or is this indeed a bug?
    Many thanks,
    Bob

  • SQL Developer 4.0 - Database Diff - turn off schema name in generated script

    SQL Developer 4 / RDBMS 11GR2
    I know SQL Developer 4 is EA, but maybe the question has the same answer in 3.3.  Also if 4.0 EA questions need to be asked in a different forum, please advise.
    I am new to SQL Developer and I admit to using brand Z (TOAD) for many, many years.
    (1) When using Database Diff, is there a setting to turn off the schema name that is displayed in the scripts that are generated?  I looked in PREFERENCES, but if it is there, I did not see it.
    (2) While I have found good resources on SQL Developer, is there a FAQ on Database DIff that answers a lot of these silly type questions?
    Thanks in advance

    On the first screen of the DIFF wizard there's a check box for 'Schema' - uncheck that.

  • SQL Developer 3.1 EA - Database Diff Issues

    Hi
    I am using SQL Developer 3.1 EA to generate database difference script to upgrade my db. This is really very useful and very good tool for compare two different databases and generate the difference script.
    There are few bugs (?) identified while using database diff tool.
    1. If there is a column mismatch in Source and Destination tables, directly drop the table and recreate new one. This is not a good solution for upgrading database with some other database (data loss is the major issue). Microsoft handled this situation in VS2010 to create temp table with new structure then move data to the temp table and finally drop the original table and rename temp table to original. I am expecting the same method in Database Diff also.
    Sample Code:
    --Changed TABLE
    --F_SYSTEM_2
    DROP TABLE "ED9461001ER09_D1"."F_SYSTEM_2";
    CREATE TABLE "ED9461001ER09_D1"."F_SYSTEM_2"
    (     "SYS2_SEQN" NUMBER(9,0) DEFAULT 0 NOT NULL ENABLE, ....
    2. Primary key constraint created with table creation for new tables. But late point of time, Create unique index statement also trying to create the same to lead runtime error.
    Sample Code:
    --New TABLE
    --F_SYSTEM_3
    CREATE TABLE "ED9461001ER09_D1"."F_SYSTEM_3"
    (     "SYS3_CORVU_DB_NAME" VARCHAR2(50),
         "SYS3_CORVU_DB_SCAP" VARCHAR2(8),
         "SYS3_CORVU_DB_VIEWURL" VARCHAR2(2048),
         "SYS3_CORVU_HP_NAME" VARCHAR2(50),
         CONSTRAINT "PK_F_SYSTEM_3" PRIMARY KEY ("SYS3_SEQU") ENABLE
    --New INDEX
    --PK_F_SYSTEM_3
    CREATE UNIQUE INDEX "ED9461001ER09_D1"."PK_F_SYSTEM_3" ON "ED9461001ER09_D1"."F_SYSTEM_3" ("SYS3_SEQU");
    3. If there is an difference in procedures, script generated with two Create Procedure statements (Source and Destination) which is irrelevant.
    --Changed PROCEDURE
    --GET_DI_COUNT
    CREATE OR REPLACE PROCEDURE "ED9461001ER09_D1"."GET_DI_COUNT"      (PP_SEQU int,
    --Changed PROCEDURE
    --GET_DI_COUNT
    CREATE OR REPLACE PROCEDURE EDISAPAC10_D1.GET_DI_COUNT      (PP_SEQU int,
    I am expecting your solution / clarification.
    Regards
    Nagarajan Santhan

    1. Makes sense. You can request this at the SQL Developer Exchange, so other users can vote and add weight for possible future implementation.
    2. Long standing bug. As it won't make your computer explode, apparently low priority to fix.
    3. I'm unable to use the comparison feature in EA3. I do get the progress dialog comparing the different procedures and functions, but when finished it just disappears, and no comparison sheet opens, like the whole operation just got cancelled. No exceptions in the console, just a lot of these in the logging page:
    update returning false for Grid1oracle.ide.Context[{Context.WORKSPACE=Databases.jws, Context.PROJECT=IdeConnections%23DES+-+Reddis.jpr, Context.SELECTION=[Loracle.ide.model.Element;@1353c19, Context.EVENT=null, Context.VIEW=LoggingMessagePane.Logging Page}]Can someone from the team suggest something to debug?
    Thanks,
    K.

  • Sql developer database diff - generate script not working

    Using SQL devleloper 2.1. Database diff generate script gives errors making it completely non-usable
    ORA-31600: invalid input value 0 for parameter SEGMENT_ATTRIBUTES in function SET_TRANSFORM_PARAM
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 8150
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 9270
    ORA-06512: at "SYS.DBMS_METADATA", line 4757
    ORA-06512: at line 1
    and
    Illegal Lock State: executeOracleQuery requires connection lock to be held. oracle.dbtools.raptor.diff.oracle.table.DiffTableRefConstraints.setup(DiffTableRefConstraints.java:215) called oracle.dbtools.db.DBUtil.executeQuery(DBUtil.java:681) without it
    I do get the differences visually (yes, I am bugged that constraints are not smart enough to compare on content of the constraint....problem when the contstraint names are sys-nnnnnn generated). Just cannot create the script.
    Any ideas to solve this issue? Thanks in advance, Kelly

    Can reproduce same issue in 11gR1.. DIFF works fine in 10gR2.
    I noticed that 10gR2 allows something like:
    DBMS_METADATA.SET_TRANSFORM_PARAM(th,'SEGMENT_ATTRIBUTES',0);
    and 11GR2 returns error similar to error SQLNAVIGATOR returns while running diff:
    DBMS_METADATA.SET_TRANSFORM_PARAM(th,'SEGMENT_ATTRIBUTES',0);
    end;
    Error report:
    ORA-31600: invalid input value 0 for parameter SEGMENT_ATTRIBUTES in function SET_TRANSFORM_PARAM
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 8424
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 9484
    ORA-06512: at "SYS.DBMS_METADATA", line 3950
    Its safe to assume that this is SQLDEVELOPER bug. Hope it will be addressed sometime.
    Edited by: user5420304 on Jun 15, 2010 10:29 AM

  • When comparing database tables with lob columns via "Database diff" in different environments indexes are shown as different

    When using "Database diff" selecting other schemas only for compare own objects are shown too!Hi!
    For tables with lob columns (clob, blob, etc.) indexes with system names are automatically created per lob column.
    If I am on different database instances (eg. dev/test) these system names can differ and are shown as differences, but these is a false positive.
    Unfortunately there is now way to influence the index names.
    Any chance to fix this in sql developer?
    Best regards
    Torsten

    Only the Sql Dev team can respond to that question.
    Such indexes should ONLY be created by Oracle and should NOT be part of any DDL that you, the user, maintains outside the database since they will be created by Oracle when the table is created and will be named at that time.
    It is up to the Sql Dev team to decide whether to deal with that issue and how to deal with it.

  • Database Diff not working using 3.1 - 64 bit

    Hi there,
    I have just tried using the utility Database Diff in 3.1 on windows 64-bit and this does not produce any differences between 2 similar schemas. I have just downloaded 3.1 32-bit (Java included) and this works fine. I am running Windows 7 64bit.
    Any ideas?
    Regards,
    VicC

    I have managed to sort this out, I was trying to speed up the startup of SQL Developer and disabled some of the extensions. The crucial one here is Versioning support. This must be enabled for Database Diff to work.
    Regards,
    VicC

  • Database Diff Wizard Tool problem

    Using Oracle SQL Developer 1.5.1 Build 5440.
    Third Party Extension jtds-1.1.2.jar
    I'm trying to determine if the Database Diff Wizard Tool contains functionality to allow/support diff compares between objects found in an Oracle Db instance and objects found in a MSSQL 2005 Db instance? I've established successful connections to each of the Db instances and can open/browse each one via the Connections browser. If compares between Oracle and MSSQL Db objects (vs. Oracle-to-Oracle only) are supported I must not have something configured correctly. Upon opening the Diff Wizard, (Tools --> Database Diff) and clicking on either the Source Connection or Destination Connection drop-downs only my Oracle Db connected instances are listed for selection. Could someone with experience using the Diff Wizard Tool offer assistance? (Provided SQL Developer supports this function).
    Thanks!

    Folks,
    I'm trying to compare two tables using Oracle SQL Developer, but I'm not being successful. :-(
    The tables are the same, but they are placed in two differente environments: development and production.
    Every time we need to make changes, we do it firstly at development environment. And I need to know which differences don't exist yet in production environment.
    Everytime I try to compare tables, I always receive a diff report with just one difference, like below:
    Type | Owner | Name | Change | Diff Count
    Table SINFA Artesao CREATE 1
    And in the the details window, there's the DDL of the table (source connection).
    Does someone have any idea of what's the problem?
    Thanks,
    Auler.

  • 30EA1--Database Diff not working even after changing Tools Preferences

    Trying to use Database Diff but even after changing Tools > Preferences > Database > Licensing, I still get the error message saying I have to make changes to the Licensing check box. Anyone have a workaround or experience the same problem?

    When you connect to any database error disappears, but still it's a bug.

  • Oracle database diff issue

    I get the following errors when clicking on an object in the diff report:
    Unable to compare objects.
    Ensure that you have the required permissions.
    You must own the objects or have select_catalog_role.
    But the user of the specified connections in the first window of the database diff tool is the owner so I'm unsure why I'm getting this.  As a side note, the specified user does not have select_catalog_role; if this is required then the given error is misleading (because it says one or the other)...
    SQL Developer version 3.2.10.09 Build MAIN-09.57

    Hi,
    1) You can schedule job for cleanup logs
    <b>http://help.sap.com/saphelp_nw2004s/helpdata/en/15/01df3a1fd91974e10000000a11402f/frameset.htm</b>
    2) Tablespace reorganization sapdba
    3) DE-FRAGMENTING OF TABLESPACE
    Example: <b>PSAPTEMP</b>
    sqlplus> <b>alter tablespace psaptemp COALESCE;</b>
    regards,
    kanthi

  • 3.1 EA3: Database Diff  license needed?

    Hello,
    Do I need the Oracle Change Management Pack Licence to use the revised Database Diff functionality as it was the case with SQL Developer 3.0 ?
    Thanks for clarification.
    Manfred

    No, not anymore. I remember someone from the team saying so, and you can see yourself sqldev doesn't ask confirmation of any license before displaying the diff dialog...
    Have fun,
    K.

  • Sql developer database diff generating incorrect diff scripts

    I am wondering whether this may have to do with incorrect preference settings. Note I am NOT diffing 2 schemas that I log in as. That shouldn't matter. I log in as a DBA user.
    I am getting alot of alter statements such as
    alter table add constraint NOT NULL
    This errors out because the table already has a NOT null constraint.
    I then checked both databases to make sure I didn't run my diffs in the wrong direction. Both databases have this NOT NULL constraints.
    I just checked a create table statement. The table exists in both databases. What am I missing here? Is there some setting in preferences about how database diff works?

    Can reproduce same issue in 11gR1.. DIFF works fine in 10gR2.
    I noticed that 10gR2 allows something like:
    DBMS_METADATA.SET_TRANSFORM_PARAM(th,'SEGMENT_ATTRIBUTES',0);
    and 11GR2 returns error similar to error SQLNAVIGATOR returns while running diff:
    DBMS_METADATA.SET_TRANSFORM_PARAM(th,'SEGMENT_ATTRIBUTES',0);
    end;
    Error report:
    ORA-31600: invalid input value 0 for parameter SEGMENT_ATTRIBUTES in function SET_TRANSFORM_PARAM
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 8424
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 9484
    ORA-06512: at "SYS.DBMS_METADATA", line 3950
    Its safe to assume that this is SQLDEVELOPER bug. Hope it will be addressed sometime.
    Edited by: user5420304 on Jun 15, 2010 10:29 AM

  • Database Diff - Schema names

    Hi I'm using very latest version of the SQL developer. I was using Database Diff feature . I found that it generates a script so I can use to synchronize. But I'm would be nice if it can add schema name infront of the object, which doesn't. Is there any option to show the schema name. This is diffecult when I compare multiple object from different schemas
    thanks.

    No, but you could request on the announced SQL Developer Exchange e.g. to have the same options as the ObjectViewer Parameters.
    Regards,
    K.

  • Database Diff - Identical package bodies are reported as different

    SQLDeveloper - Version 3.2.10.09
    Package bodies (DDL) on both source and destination database are identical but package body on the source database is marked as "invalid" and package body on destination database is marked as "valid" - then Database Diff reports that package bodies different. (but on panel showing DDL for both compared package bodies there is visible no difference).
    After compiling package body on the source database (no changes in DDL) and when status of that package body changed to "valid" - now Database Diff correctly shows no difference.
    Is that intentional behavior or bug?

    >
    According to the CM team, in the previous (pre-MDAPI) incarnation of CM, status was not compared, and got complaints about that.
    >
    Point taken. Though it seems these days whichever path you take you will get complaints. ;)
    >
    It would be possible to provide the option whether to compare status of objects that have status (PL/SQL objects, triggers, views, indexes) provided MDAPI reports the status, but it's a fairly hefty enhancement.
    >
    I take that to mean that the results do now, and will continue to, take status into account.
    Perhaps my experience is using the functionality differently than what your team is working with.
    I make heavy use of the DBMS_METADATA and DBMS_METADATA_DIFF packages. Much of that functionality operates on CLOBS containing data in either the raw XML or the SXML format.
    So, to me, an XML in a CLOB has no status. So in comparing XML1 in CLOB1 to XML2 in CLOB2 the status that MIGHT have existed on the real object in the real database is irrelevant. I do comparisons between what is in version control and what is from some other source. That other source might have been, or might still be, an object in a database but status is meaningless since DDL in version control has no status. That is why, for my use cases, I wouldn't want to see a comparison fail due to a status issue.
    Oracle® Database PL/SQL Packages and Types Reference
    http://docs.oracle.com/cd/E14072_01/appdev.112/e10577/d_metadiff.htm
    >
    85 DBMS_METADATA_DIFF
    The DBMS_METADATA_DIFF package contains the interfaces for comparing two metadata documents in SXML format. The result of the comparison is an SXML difference document. This document can be converted to other formats using the DBMS_METADATA submit interface and the CONVERT API.
    >
    That is the basis for the comments I was making; that METADATA doesn't necessarily represent an actual object in an actual database.
    Thanks for the links; I will add my vote there.

Maybe you are looking for