Database copy dropped objects in source schema

I was seeking out a quick way to copy an entire schema from one db to another and I was happy when I found the "database copy" feature. I checked the documentation and found that all I needed to do was select the source connection, the target connection, and choose either create, truncate, or drop objects. Well I had some objects in the source db from a previous failed attempt at copying all the objects via script. To remedy that the drop objects option, according to the documentation " Drops any existing table with the same name, and then creates and loads it from the source." Ok, great. The summary shows up with a bunch of entries which I didn't pay too much attention too. Fine, continue...running....progress...so far so good..and the log shows up. I see drops, I see moving data, and I see a whole bunch of errors with no useful information with them. Check the target schema...nothings there, all objects are dropped. Ok, lets have a look at the source and see whats going on. Refresh tables...nothing...refresh...refresh...nothing. The source schema has all its objects GONE too! One lonely type is saved in the source schema, that's it. Am I a total moron and misinterpreting how database copy works? Can anyone shed some light on this? Anyway to recover my source objects? As the source db is not production I am out of luck as there is no recent backup.
Source: 9i
Target: 11g
sql developer v 2.1.1.64.45
-j

OK the problem was that my target connection was inadvertently pointing to the source. It was set properly before but stuff went bad and i switched the connection from TNS to basic, then back to TNS. Apparently when switching back to TNS the wrong entry was selected. Not sure if I chose it or it was selected from a different connection. In any case, very stupid of me.
thanks K.
Edited by: [email protected] on Jun 17, 2010 6:45 AM

Similar Messages

  • How to Create a database copy and specify the source database.

    Hello,
    In my dag environment I would like to create a new database copy and specify the source. My company has database copies in 2 locations. Instead of transferring the data from one location to the other, I would like to specify the source be the copy that is
    in the same location.
    Thank you,
    ~Mark

    Hi,
    We can create a mailbox database, then run EMC and EMS to create a database copy.
    More details about Add a Mailbox Database Copy, for your reference:
    https://technet.microsoft.com/en-us/library/dd298080(v=exchg.141).aspx
    Note: please pay attention to Prerequisites section, for example: 
    1. The specified Mailbox server must not already host a copy of the specified mailbox database.
    2. The server hosting the specified database and the server that will host the database copy must both be in the same database availability group (DAG). The DAG must also have quorum and be healthy.
    Thanks
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Allen Wang
    TechNet Community Support

  • SQL Developer Database Copy truncates DATE columns

    Hope someone can help me. I want to copy all object from one schema to another schema in my Database. I have used the "tools - Database Copy" utility and it copies all of the objects and data however when I query the DATE columns in the destination schema the time element has been truncated? Why has this happened?
    tab_h contains a column h_date of type DATE
    Query
    SELECT TO_CHAR(H_DATE, 'MM-DD-YYYY HH24:MI:SS') from tab_h;
    returns
    02-07-2012 09:54:14
    from the source table
    yet returns
    02-07-2012 00:00:00
    from destination schema? This is the case for all DATE columns in the tables.
    I noticed this was happening in 3.0.04.34 and I upgraded to 3.1.07.42 and it still happens.
    Thank you

    Maybe there's a problem getting the OS settings right; try to add this to \sqldeveloper\bin\sqldeveloper.conf:
    AddVMOption -Duser.region=USIf that works, you can try others closer to you.
    Hope that helps,
    K.

  • Database copy Move data

    Hello,
    I have a database A. of about 15GB size and want to copy the data across to database B. - same schema just a few additional tables.
    When I use Oracle Sql developer and click on tools- database copy and select my source A and destination B. truncate objects the process starts
    but..does not copy any data at all. - it takes only 3 minutes as well.
    why is that?

    well I dont just want to create a duplicate of database A. because B. contains some tables that are still important but unique to B.
    most of the tables between A. and B. are the same and I just want to copy them over from A to B.
    Using the Oracle SQL Developer seems to get the similarities between the schemas and copy those table over BUT it somehow forgets the data altough there
    is a DATA MOVE as part of the copying procedure.
    I know there is the options to create migration repositories but this all seems to complicated to me.
    metalray

  • How to suppress compiler errors without excluding database objects from the "Schema Compare" tool (using VS2013/SSDT)

    Hi,
    In short: How to suppress compiler errors without excluding the object from the "Schema Compare" tool ??
    A bit longer:
    We have a SQL Server 2008 project in Visual Studio 2013 running SQL Server Data Tool.
    An old database, with a lot of history in, has been imported into SSDT and there are many syntax errors preventing the project from compiling/running. An typical error is: "SQL70001: This statement is not recognized in this context".
    Running the "faulty" scripts on the server, executes just fine. I understand that there are syntax errors and they should be rewritten, but it's not gonna happen just like that - it is a slow process over a long period of time.
    I know it is possible to change Build Action to None, but that also exclude the object from appearing in the Schema Compare function/window.
    So - how to ignore some compiler errors and still having the objects to appear when doing "Schema Compare" ??
    Thank you in advance.

    Hi Steven,
    Thanks for your comments.
    Well, it sure does help in the future, but right now i would prefer the other way - to suppress some errors and still allow the scripts to build.
    The thing is that if we "rewrite" the objects into create scripts, then we have a huge test job ahead of us + the database environments (PROD vs DEV and UAT) does not share the same AD or DB users and therefore grants is lost if dropping/creating
    objects, right!
    If you drop a object before creating it, the drop will also drop the roles and grants and since they don't share user table, the create will not be able to add the permissions again. There might be a solution to that, but it is going to be very complicated
    for some newbies like us. We need something we can trust.
    BR
    Peter

  • Performance slows down when moving from stage to test schema within same instance with same database table and objects

    We have created a stage schema and tested application which is working fine when we are moving it to another schema for further testing ( This schema is created using same scripts which were used to create objects in staging schema) the performanc of application (Developed in .NET) slows down drastically
    Some of the store procedures we have checked at Databse/SQLdeveloper level are giving almost same performance but at Application level there is lot of difference
    Can you please help
    We are using Oracke 11g Database

    Are you using the Database Cloud Service?  You cannot create schemas in the Database Cloud Service, which makes me think you are not.  This forum is only for the Database Cloud Service.
    - Rick Greenwald

  • Some objects in sys schema not imported usinf full database import/export.

    Hello All,
    We need to migrate database from one server to new server using same database version 11g Release 2 (11.2.0.1.0). We have some production objects in sys schema. We took full export using full=y and then import on new server using full=y. Other objects belonging to different tablespaces and users has successfully imported but production objects i.e table in sys schema not import.
    We used following commands for export and import:
    # exp system file=/u01/backup/orcl_full_exp.dmp log=/u01/backup/orcl_full_exp.log full=y statistics=none
    # imp system file=/u01/backup/orcl_full_exp.dmp log=/u01/backup/orcl_full_imp.log full=y ignore=y
    Kind Regards,
    Sharjeel

    Hi,
    First of all it is not good practice to keep user object in the sys schema
    second you are useing version 11gr2 what not you go for datapump export/import method.
    third, did you get any error in import, what is the error

  • Moving objects from one schema to another

    Hi,
    again as part of my learning exercise, I was trying to move objects from a schema in 10GR2 to 11GR2 database.
    I am able to use exp and imp commands to achieve this objective -
    On source database -
    $> exp userid=scott/tiger owner=(schemaname) file=data.dmp statistics=none
    Copied the dump file on target server and then
    $> imp userid=scott/tiger file=data.dmp fromuser=uname touser=scott
    And this works fine.
    What I am not able to understand is how I can achieve this by using datapump instead?
    Your help is much appreciated.
    Thanks.

    Thanks.
    Worked perfectly.
    This is what I did (in case someone is in my position)-
    On source database-
    expdp scott/tiger schemas=<source schema>directory=DATA_PUMP_DIR dumpfile=data.dmp job_name=some_job
    Copied dump file to target server.
    On target database-
    $> impdp scott/tiger directory=DATA_PUMP_DIR dumpfile=data.dmp remap_schema=<source schema>:<target schema> job_name=imp_kob

  • Database Copy Doesn't find tables for moving data

    I'm running SQL Dev 3.1.7 on a Win7-64 PC against Oracle 11g. Using the Database Copy function to move and update tables from one instance to another. The application seems to work fine, creating all of the tables, but in the script when it tries to move the data, for some tables it fails as follows:
    Moving Data for object MY_TABLE_NAME
    Unable to perform batch insert.
    MY_TABLE_NAME ORA-00942: table or view does not exist
    Earlier in the script it dropped and then recreated the table in the target instance. The table does exist in the source instance. This occurred for 24 tables out of 105.
    Any ideas what is going on?
    Edited by: user12200489 on May 25, 2012 9:47 AM

    according to the log, it says the table got created. Here's the log entries as they pertain to our APPOINTMENT table ...
    DROP TABLE "APPOINTMENT" cascade constraints;
    table "APPOINTMENT" dropped.
    DROP SEQUENCE "APPOINTMENT_SEQ";
    sequence "APPOINTMENT_SEQ" dropped.
    -- DDL for Sequence APPOINTMENT_SEQ
    CREATE SEQUENCE "APPOINTMENT_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 17721 CACHE 20 NOORDER NOCYCLE ;
    sequence "APPOINTMENT_SEQ" created.
    -- DDL for Table APPOINTMENT
    CREATE TABLE "APPOINTMENT" ("APPOINTMENT_ID" NUMBER(19,0), "PRACTICE_PATIENT_ID" NUMBER(19,0), "PRACTICE_PET_OWNER_ID" NUMBER(19,0), "STAFF_MEMBER_ID" NUMBER(19,0), "APPT_STATUS_ENUM_NAME" VARCHAR2(32 BYTE), "EXT_PRACTICE_APPOINTMENT_ID" VARCHAR2(255 BYTE), "CONFIRMATION_KEY" VARCHAR2(255 BYTE), "REASON" VARCHAR2(255 BYTE), "EXT_REASON" VARCHAR2(255 BYTE), "EXT_SECONDARY_REASON" VARCHAR2(255 BYTE), "NOTE" BLOB, "APPOINTMENT_DATE" TIMESTAMP (6), "CREATED_DATE" TIMESTAMP (6), "CREATED_BY" VARCHAR2(255 BYTE), "LAST_MODIFIED_DATE" TIMESTAMP (6), "LAST_MODIFIED_BY" VARCHAR2(255 BYTE), "CONFIRMATION_TIME" TIMESTAMP (6)) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "VET2PET_T" LOB ("NOTE") STORE AS BASICFILE ( TABLESPACE "VET2PET_T" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION NOCACHE LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
    table "APPOINTMENT" created.
    It even truncates the table before attempting to load the data ...
    TRUNCATE TABLE "APPOINTMENT";
    table "APPOINTMENT" truncated.
    But when it goes to move the data ...
    --- START --------------------------------------------------------------------
    Moving Data for object APPOINTMENT
    Unable to perform batch insert.
    APPOINTMENT ORA-00942: table or view does not exist
    --- END --------------------------------------------------------------------
    There is a lookup table involved but at the time of moving the data none of the foreign keys have been enabled.
    All the indices for the table get created with no issue and here is the log entry for when the constraints are created and enabled ...
    -- Constraints for Table APPOINTMENT
    ALTER TABLE "APPOINTMENT" ADD CONSTRAINT "PK_APPOINTMENT" PRIMARY KEY ("APPOINTMENT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "VET2PET_I" ENABLE;
    ALTER TABLE "APPOINTMENT" MODIFY ("CREATED_BY" NOT NULL ENABLE);
    ALTER TABLE "APPOINTMENT" MODIFY ("CREATED_DATE" NOT NULL ENABLE);
    ALTER TABLE "APPOINTMENT" MODIFY ("CONFIRMATION_KEY" NOT NULL ENABLE);
    ALTER TABLE "APPOINTMENT" MODIFY ("EXT_PRACTICE_APPOINTMENT_ID" NOT NULL ENABLE);
    ALTER TABLE "APPOINTMENT" MODIFY ("APPT_STATUS_ENUM_NAME" NOT NULL ENABLE);
    ALTER TABLE "APPOINTMENT" MODIFY ("PRACTICE_PET_OWNER_ID" NOT NULL ENABLE);
    ALTER TABLE "APPOINTMENT" MODIFY ("PRACTICE_PATIENT_ID" NOT NULL ENABLE);
    ALTER TABLE "APPOINTMENT" MODIFY ("APPOINTMENT_ID" NOT NULL ENABLE);
    ALTER TABLE "APPOINTMENT" MODIFY ("APPOINTMENT_DATE" NOT NULL ENABLE);
    table "APPOINTMENT" altered.
    table "APPOINTMENT" altered.
    table "APPOINTMENT" altered.
    table "APPOINTMENT" altered.
    table "APPOINTMENT" altered.
    table "APPOINTMENT" altered.
    table "APPOINTMENT" altered.
    table "APPOINTMENT" altered.
    table "APPOINTMENT" altered.
    table "APPOINTMENT" altered.
    Any ideas?
    thanks.

  • JDEV 11G TP4 [BUG]: Offline Database / Copying project from workspace

    I have two workspaces.
    In these two workspaces i have a Documentation project containing offline database objects.
    Workspace 1
    +Documentation
    +connection
    +schema
    +objects
    +schema
    +objects
    Workspace 1
    +Documentation
    +connection
    +schema
    +objects
    +schema
    +objects
    I would like to copy the content of one schema from workspace 1 to a project in the workspace 2.
    Both schema have same name.
    Connection is different.
    The active workspace is workspace 2.
    In the wizard i'm able to select the Application (workspace), the project but the connection listed is only the one for workspace 2 (the active one). It normally has to be the ones corresponding to workspace 1 that i selected has the source for the copy.
    The result it that i got the list of objects from Documentation project from workspace 2 instead the desired ones from workspace 1.
    Hope its help

    Loose it again today ... please is it possible to address this problem ... it's really frustrating each time restore the configuration file.

  • Creating views in a new schema to access certain rows of tables in source schema

    Hi,
    Oracle 10.2.0.4
    We are trying to mask certain data from some users. My suggestion is that we create a new schema view_schema on the same instance where we have source tables say in source_schema.
    We then create views in view_schema as below
    CREATE VIEW AS SELECT * FROM source_schema.table where COLUMN_n = 'XYZ';
    we then grant SELECT on these views to a role and assign new users that role to be able to see the viewed data.
    So the questions below.
    We can create views to look at data in another schema WITHOUT giving SELECT permissions directluy on source_schema.tanle?
    This will work and there is no need to create synonyms etc
    WE can manage users and views much easilier
    Does this make sense and would that be better than selecting views with say table_name_view in source schema for this purpose and even creating synonyms for these views with the same tanle names in sourece_schema?
    Thanks

    905989 wrote:
    Hi,
    Oracle 10.2.0.4
    We are trying to mask certain data from some users. My suggestion is that we create a new schema view_schema on the same instance where we have source tables say in source_schema.
    We then create views in view_schema as below
    CREATE VIEW AS SELECT * FROM source_schema.table where COLUMN_n = 'XYZ';
    we then grant SELECT on these views to a role and assign new users that role to be able to see the viewed data.
    So the questions below.
    We can create views to look at data in another schema WITHOUT giving SELECT permissions directluy on source_schema.tanle?
    This will work and there is no need to create synonyms etc
    WE can manage users and views much easilier
    Does this make sense and would that be better than selecting views with say table_name_view in source schema for this purpose and even creating synonyms for these views with the same tanle names in sourece_schema?
    Thanks
    1. You can create the view in another schema (first granting privileges to the view schema) without granting privileges from the source schema
    2. You probably want to create public synonyms for the view(s).  You can refer to the view as schema.view but this is cumbersome
    3. I am not sure about management being easier but added complexity should not be too bad.  Write documentation describing how everything works and the object involved.
    Another, more complicated but more powerful possibility is to use row level security also known as virtual private database - if you have the license.  You create a profile for a table and a procedure to generate WHERE clauses to filter any query against the table and columns defined in the profile.  Again, you need the license to do this.

  • SQL Developer database copy corrupts wrapped PL/SQL

    SQL Developer 3.0.04.34, database 11.2.0.2.2
    Database copy brings over the wrapped pl/sql DDL, but somehow corrupts the code and will not compile.
    It must be recreated from source plb file.
    expdp / impdp does not have this problem.
    This would appear to be a bug.
    Wayne Linton

    user4792902 wrote:
    Also it looks like the SQL Developer loads all the Data from sources Schema for each table in memory and copies to destination Schema.Yes
    Any idea how to over come that...Don't use it, use the database's IMPDP/EXPDP tools for copying large quantities of data or whole schemas or databases.
    Also adding the Filter or selection like the Database Export functionality in Database Copy will really be helpful in this kind of situation. The Developer team has any plans?Probably not right now, but you can request this at the SQL Developer Exchange though, so other users can vote and add weight for possible future implementation.
    Regards,
    K.

  • Database copy with "set define off" option

    Is there an option to do a database copy with a "set define off" option ? I'm copying packages that contain ampersands (&) in strings and during the copy I'm being asked the value of these variables.

    Apologies for spamming this thread, but I'd like to point out a couple of additional issues regarding Database Copy:
    1) On Fedora it tries to create the script file in a system folder ( +/opt/sqldeveloper/sqldeveloper+, IIRC) which obviously doesn't work unless you are root.
    2) DDL generated for objects named like the exporting schema (for example table TEST in schema TEST) is incorrect. For example (note the missing table name):
    -- DDL for Table TEST
    CREATE TABLE
    (     "FIELD1" NUMBER,
    ) ;

  • Database Copy can't copy primary key for tables

    When I use Tools->Database Copy Wizard to copy my existing schema (for example: azteca_KSMMS) to a brand new schema (azteca), I find the primary key for some of the tables can't be copied, also the views seem not valid under the new schema (azteca). Please give me your comments about that. Thanks for your help.
    Kevin

    For example I have a table called workorder, it has a primary key with name (CW_PKEY_519, on WORKORDERID column) from the source schema (azteca_KSMMS). After I database copy to new schema azteca, the primary key lost. The data of workorder and other indexes have been copied to azteca schema.
    Kevin

  • Bug: 1.5.1 database copy dies silently

    When using the tool 'Database copy' with a source schema with a lot of data, the tool dies silently with the following error :
    Exception in thread "RunnerThread" java.lang.OutOfMemoryError: Java heap space
    The same exception also happens when using the tool 'Database Export', even during dumping the data, it dies with the same error.
    Could this be fixed? that way sqldeveloper can be used to put data from one database to another database.
    Thanks,
    Jan

    SQL Developer gives the error in the console when it is started in debug mode, the ide itself doesn't give any notion.
    Giving SQL Developer JVM more memory is indeed a workaround but with the amount of data I try to unload or copy, SQL Developer will fail before the end I fear.
    It would be nice if this behavior is recognized as a bug and will be fixed in a future release.
    Thanks,
    Jan

Maybe you are looking for