Exporting tables between 2 schemas

Hi all,
I am trying to export a table from user sp1 to sp2
I have exported it successfully.
C:\Documents and Settings\shanky>expdp sp1/shanky directory=dba_data_pump DUMPFI
LE=customer.dmp LOGFILE=customer.log TABLES=sp1.customer
Export: Release 10.1.0.2.0 - Production on Saturday, 19 July, 2008 0:13
Copyright (c) 2003, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Starting "SP1"."SYS_EXPORT_TABLE_01": sp1/******** directory=dba_data_pump DUMP
FILE=customer.dmp LOGFILE=customer.log TABLES=sp1.customer
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "SP1"."CUSTOMER" 5.437 KB 2 rows
Master table "SP1"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
Dump file set for SP1.SYS_EXPORT_TABLE_01 is:
E:\ORACLE\CUSTOMER.DMP
Job "SP1"."SYS_EXPORT_TABLE_01" successfully completed at 00:13
But while importing I am getting following error.
C:\Documents and Settings\shanky>impdp sp2/shanky directory=dba_data_pump DUMPFI
LE=customer.dmp TABLES=customer sqlfile=today.sql
Import: Release 10.1.0.2.0 - Production on Saturday, 19 July, 2008 0:02
Copyright (c) 2003, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
ORA-31655: no data or metadata objects selected for job
ORA-39039: Schema expression "IN ('SP2')" contains no valid schemas.
Master table "SP2"."SYS_SQL_FILE_TABLE_01" successfully loaded/unloaded
Starting "SP2"."SYS_SQL_FILE_TABLE_01": sp2/******** directory=dba_data_pump DU
MPFILE=customer.dmp TABLES=customer sqlfile=today.sql
Job "SP2"."SYS_SQL_FILE_TABLE_01" successfully completed at 00:02
Please help..

I think you need to use the REMAP_SCHEMA option. I think impdp can't "see" the Customer table, because it's not yet in schema sp2.
See: impdp with remap_schema trouble

Similar Messages

  • Is it possible to export tables from diffrent schema using expdp?

    Hi,
    We can export tables from different schema using exp. Ex: exp user/pass file=sample.dmp log=sample.log tables=scott.dept,system.sales ...But
    Is it possible in expdp?
    Thanks in advance ..
    Thanks,

    Hi,
    you have to use "schemas=user1,user2 include=table:"in('table1,table2')" use parfileexpdp scott/tiger@db10g schemas=SCOTT include=TABLE:"IN ('EMP', 'DEPT')" directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log{quote}
    I am not able to perform it using parfile also.Using parfile it shows "UDE-00010: multiple job modes requested, schema and tables."
    When trying the below, i get error
    {code}
    bash-3.00$ expdp directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=(\'MM\',\'MMM\') include=TABLE:\"IN\(\'EA_EET_TMP\',\'WS_DT\'\)\"
    Export: Release 10.2.0.4.0 - 64bit Production on Friday, 15 October, 2010 18:34:32
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Username: / as sysdba
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Starting "SYS"."SYS_EXPORT_SCHEMA_01": /******** AS SYSDBA directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=('MM','MMM') include=TABLE:"IN('EA_EET_TMP','WS_DT')"
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
    Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported "MM"."EA_EET_TMP" 0 KB 0 rows
    ORA-39165: Schema MMM was not found.
    Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
    /export/home/nucleus/dump/test.dmp
    Job "SYS"."SYS_EXPORT_SCHEMA_01" completed with 1 error(s) at 18:35:19
    {code}
    When checking expdp help=y shows :-
    {code}TABLES Identifies a list of tables to export - one schema only.{code}
    As per few testing,tables from different schemas are not possible to export using expdp in a single command.
    Anand

  • How to export tables from development server to production server

    HI,
    Any body plz let me know how to export tables from development server to production server. what are the user names and password i need to ask my manager to do that. what are the requirements i need to ask him.
    Plz reply me ASAP.
    Thanks in advance.

    hi buddy
    first of all you should let us know the environment of production and development servers
    database versions
    and you need to have userid which has privilege to export tables of other schema. userid(owner) of the tables you want to export.
    Traditional way
    export tables in development server and then ftp to production and then import
    in the above case you should have similar database structure(tablespace etc) to avoid errors...
    if there are few tables only , you can use dblink instead of export and import...

  • Can we export DATA from all tables in a schema?

    Hi,
    I have a question; Can we export all the DATA from all the tables present in the schema to any source (eigther CSV, TXT, DAt, etc..)?
    Or
    Can I have a PL/SQL procedure to display DATA from all Tables in a schema?
    With Best Regards,
    - Naveed

    Hi,
    This is pretty much what you need.
    DECLARE
    V_COUNT NUMBER;
    v_sql varchar2(1000);
    IN_OWNER_NAME VARCHAR2(100) := 'AP' ; -- SCHEMA NAME
    TYPE T_COL_NAME is table of varchar2(1000) index by binary_integer;
    v_col_tbl t_col_name;
    BEGIN
    FOR i in
    (SELECT object_name
    FROM dba_objects
         WHERE owner = IN_OWNER_NAME
         AND object_type ='TABLE'
    and rownum < 2)
    LOOP
    v_sql := 'SELECT COUNT(*) FROM ' || i.object_name ;
    EXECUTE IMMEDIATE v_sql INTO V_COUNT;
    if v_count > 0 then
    v_sql := 'SELECT * FROM ' || i.object_name ;
    select column_name
    bulk collect
    into v_col_tbl
    from DBA_TAB_COLUMNS
    WHERE TABLE_NAME = I.OBJECT_NAME
    AND OWNER = IN_OWNER_NAME;
    -- start selecting the column and exporting using the column names selected.     
    end if;
    if v_col_tbl.count > 0 then
    for i in v_col_tbl.first .. v_col_tbl.last
    loop
    DBMS_OUTPUT.PUT_lINE(v_col_tbl(i));
    end loop;
    end if;
    DBMS_OUTPUT.PUT_lINE( i.object_name || '-' || v_count);
    END LOOP;
    END;
    - Ronel

  • How to restore a single table from a DP Export from a different schema?

    Environment:
    Oracle 11.2.0.3 EE on Solaris
    I was looking at the documentation on DP Import trying to find the correct syntax to import a single table from a DP Export of a different schema.
    So, I want to load table USER1.TABLE1 into USER2.TABLE1 from a DP Export.
    Looking at the REMAP_TABLE options:
    REMAP_TABLE=[schema.]old_tablename[.partition]:new_tablename
    OR
    REMAP_TABLE=[schema.]old_tablename[:partition]:new_tablenameI can't see where to specify the target schema name. The examples had the new table name residing in the same schema with just a new name.
    I looked at the REMAP_SCHEMA but the docs say that will import the entire schema into the new schema and I only want one (1) table.
    Any suggestions are most welcome!
    -gary

    I thought I tried that combination and it seemed to me that the REMAP_SCHEMA somehow over-rode the TABLES= parameter >and started loading all the objects.If it does fail (and it should not) then please post the details here and I will try to see what is happening.
    Let me get back into the sandbox and try it again. I admit I was in a bit of a hurry when I did it the first time.We are all in a hurry, no worries. If it fails, please post the details and the log file.
    Does it make any sense that one parameter would override another?No, this should never happen. We have tons of checks to make sure the job can't have multiple meanings. For example, you can't say
    full=y schemas=foo --- Which do you want, a full export or a list of schema exports, etc.
    Your suggestion was the first thing I thought would work.This should work. If not, please post the log file with the command and the results.
    Dean
    Thanks again for the help and stay tuned for my new attempt.
    -gary

  • {SOL}Problem in Export/Import a simple table between two diff. characterset

    Hi ,
    I have created a simple table on SCOTT schema....
    SQL> CREATE TABLE TEST(A NUMBER(1) , B VARCHAR2(10));
    Table created
    SQL> INSERT INTO TEST VALUES(1 , 'TEST_TEST');
    1 row inserted
    SQL> COMMIT;
    Commit complete
    SQL> INSERT INTO TEST VALUES(2 , 'ΤΕΣΤ_ΤΕΣΤ');     <------------greek chars
    1 row inserted
    SQL> COMMIT;
    Commit complete
    The nls_parameters:
    SQL> SELECT * FROM NLS_INSTANCE_PARAMETERS;
    PARAMETER                      VALUE
    NLS_LANGUAGE                   GREEK
    NLS_TERRITORY                  GREECE
    NLS_SORT                      
    NLS_DATE_LANGUAGE             
    NLS_DATE_FORMAT               
    NLS_CURRENCY                  
    NLS_NUMERIC_CHARACTERS        
    NLS_ISO_CURRENCY              
    NLS_CALENDAR                  
    NLS_TIME_FORMAT               
    NLS_TIMESTAMP_FORMAT          
    NLS_TIME_TZ_FORMAT            
    NLS_TIMESTAMP_TZ_FORMAT       
    NLS_DUAL_CURRENCY             
    NLS_COMP                      
    NLS_LENGTH_SEMANTICS           BYTE
    NLS_NCHAR_CONV_EXCP            FALSE
    17 rows selected
    SQL> SELECT * FROM NLS_SESSION_PARAMETERS;
    PARAMETER                      VALUE
    NLS_LANGUAGE                   AMERICAN
    NLS_TERRITORY                  AMERICA
    NLS_CURRENCY                   $
    NLS_ISO_CURRENCY               AMERICA
    NLS_NUMERIC_CHARACTERS         .,
    NLS_CALENDAR                   GREGORIAN
    NLS_DATE_FORMAT                DD-MON-RR
    NLS_DATE_LANGUAGE              AMERICAN
    NLS_SORT                       BINARY
    NLS_TIME_FORMAT                HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY              $
    NLS_COMP                       BINARY
    NLS_LENGTH_SEMANTICS           BYTE
    NLS_NCHAR_CONV_EXCP            FALSE
    17 rows selected
    and db characterset is EL8MSWIN1253
    I export such as(following generally the instuctions found on Note:227332.1-Metalink):
    C:\Documents and Settings\s_k>SET ORACLE_SID=EPESY
    C:\Documents and Settings\s_k>SET NLS_LANG=GREEK_GREECE.EL8MSWIN1253
    C:\Documents and Settings\s_k>C:\oracle\product\10.2.0\database10g\BIN\exp SYSTE
    M/passwd@EPESY FILE=C:\TEST.DMP TABLES=(SCOTT.TEST) ROWS=Y LOG=C:\TEST2.TXT
    Export: Release 10.2.0.1.0 - Production on ╩Ϋ± ╔ΎΫΊ 22 12:28:58 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    ╕ήώΊί ≤²Ίϊί≤ύ ≤ί: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr
    oduction
    With the Partitioning, OLAP and Data Mining options
    ╟ ίΌάή∙ή▐ ▌ήώΊί ≤ΪΎ ≤ίΪ ≈ά±άΆΪ▐±∙Ί EL8MSWIN1253 Άάώ ≤ΪΎ ≤ίΪ ≈ά±άΆΪ▐±∙Ί NCHAR AL1
    6UTF16
    ╨±ΎίΪΎώΉά≤▀ά ήώά ίΌάή∙ή▐ Ϊ∙Ί Ώ±Ύ≤ϊώΎ±ώ≤Ή▌Ί∙Ί ΏώΊ▄Ά∙Ί Ή▌≤∙ ╙ΫΉέάΪώΆ▐≥ ─ώάϊ±ΎΉ▐≥ .
    ╧ Ϊ±▌≈∙Ί ≈±▐≤Ϊύ≥ ▄ΈΈάΌί ≤ί SCOTT
    . . ίΌάή∙ή▐ ΪΎΫ Ώ▀ΊάΆά                           TEST          2 ή±άΉΉ▌≥ ίΌ▐≈ϋύ≤
    άΊ
    ╟ ίΌάή∙ή▐ ΪίΈί▀∙≤ί ίΏώΪΫ≈■≥ ≈∙±▀≥ Ώ±ΎίώϊΎΏΎ▀ύ≤ύ.Then , i shutdown this database and i start the other.....
    with this nls_parameters
    SQL> select * from nls_session_parameters;
    PARAMETER                                                                        VALUE
    NLS_LANGUAGE                                                                     AMERICAN
    NLS_TERRITORY                                                                    AMERICA
    NLS_CURRENCY                                                                     $
    NLS_ISO_CURRENCY                                                                 AMERICA
    NLS_NUMERIC_CHARACTERS                                                           .,
    NLS_CALENDAR                                                                     GREGORIAN
    NLS_DATE_FORMAT                                                                  DD-MON-RR
    NLS_DATE_LANGUAGE                                                                AMERICAN
    NLS_SORT                                                                         BINARY
    NLS_TIME_FORMAT                                                                  HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT                                                             DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT                                                               HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT                                                          DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY                                                                $
    NLS_COMP                                                                         BINARY
    NLS_LENGTH_SEMANTICS                                                             CHAR
    NLS_NCHAR_CONV_EXCP                                                              FALSE
    17 rows selected
    SQL>
    SQL> select * from nls_instance_parameters;
    PARAMETER                                                                        VALUE
    NLS_LANGUAGE                                                                     GREEK
    NLS_TERRITORY                                                                    GREECE
    NLS_SORT                                                                        
    NLS_DATE_LANGUAGE                                                               
    NLS_DATE_FORMAT                                                                 
    NLS_CURRENCY                                                                    
    NLS_NUMERIC_CHARACTERS                                                          
    NLS_ISO_CURRENCY                                                                
    NLS_CALENDAR                                                                    
    NLS_TIME_FORMAT                                                                 
    NLS_TIMESTAMP_FORMAT                                                            
    NLS_TIME_TZ_FORMAT                                                              
    NLS_TIMESTAMP_TZ_FORMAT                                                         
    NLS_DUAL_CURRENCY                                                               
    NLS_COMP                                                                        
    NLS_LENGTH_SEMANTICS                                                             CHAR
    NLS_NCHAR_CONV_EXCP                                                              FALSE
    17 rows selected
    with this db characterset: UTF8
    C:\Documents and Settings\s_k>SET NLS_LANG=GREEK_GREECE.EL8MSWIN1253
    C:\Documents and Settings\s_k>C:\oracle\product\10.2.0\database10g\BIN\imp syste
    m/passwd@info FROMUSER=SCOTT TOUSER=SCOTT FILE=C:\TEST.DMP LOG=C:\TEST0_IMP.TXT
    Import: Release 10.2.0.1.0 - Production on ╩Ϋ± ╔ΎΫΊ 22 12:40:16 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    ╕ήώΊί ≤²Ίϊί≤ύ ≤ί: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr
    oduction
    With the Partitioning, OLAP and Data Mining options
    ┴±≈ί▀Ύ ίΌάή∙ή▐≥ ϊύΉώΎΫ±ή▐ϋύΆί άΏⁿ EXPORT:V10.02.01 Ή▌≤∙ ≤ΫΉέάΪώΆ▐≥ ϊώάϊ±ΎΉ▐≥
    ίώ≤άή∙ή▐ ▌ήώΊί ≤ί ≤ίΪ ≈ά±άΆΪ▐±∙Ί EL8MSWIN1253 Άάώ ≤ίΪ ≈ά±άΆΪ▐±∙Ί NCHAR UTF8
    server ίώ≤άή∙ή▐≥ ≈±ύ≤ώΉΎΏΎώί▀ ≤ίΪ ≈ά±άΆΪ▐±∙Ί UTF8 (ϊΫΊάΪ▐ ΉίΪάΪ±ΎΏ▐ ≤ίΪ ≈ά±άΆΪ▐±
    ∙Ί)
    server ίΌάή∙ή▐≥ ≈±ύ≤ώΉΎΏΎώί▀ ≤ίΪ ≈ά±άΆΪ▐±∙Ί NCHAR AL16UTF16 (ϊΫΊάΪ▐ ΉίΪάΪ±ΎΏ▐ ≤ί
    Ϊ ≈ά±άΆΪ▐±∙Ί nchar)
    . ίώ≤άή∙ή▐ Ϊ∙Ί άΊΪώΆίώΉ▌Ί∙Ί ΪΎΫ SCOTT ≤ΪΎ SCOTT
    . . ίώ≤άή∙ή▐ ΪΎΫ Ώ▀ΊάΆά                         "TEST"          2 ή±άΉΉ▌≥ ίώ≤▐≈ϋ
    ύ≤άΊ
    ╟ ίώ≤άή∙ή▐ ΪίΈί▀∙≤ί ίΏώΪΫ≈■≥ ≈∙±▀≥ Ώ±ΎίώϊΎΏΎ▀ύ≤ύ.
    C:\Documents and Settings\s_k>SQLPLUS SCOTT/TIGER
    SQL*Plus: Release 10.2.0.1.0 - Production on ╩Ϋ± ╔ΎΫΊ 22 12:41:20 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    ╙²Ίϊί≤ύ ≤ί:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> SELECT * FROM TEST;
             A B
             1 TEST_TEST
             2 ????_????What may be the cause.....????
    Note: I use db 10g v.2 on Windows XP platform.. and the two db instances reside on the same machine....
    Thanks...
    Sim

    "Generally speaking the value of the NLS_LANG registry key or environment variable needs to be equal to the characterset of the database."
    Yes...that's why i have set the NLS_LANG env.variable to GREEK_GREECE.EL8MSWIN1253 ..equal to:
    SQL> select * from nls_database_parameters;
    PARAMETER                      VALUE
    NLS_LANGUAGE                   AMERICAN
    NLS_TERRITORY                  AMERICA
    NLS_CURRENCY                   $
    NLS_ISO_CURRENCY               AMERICA
    NLS_NUMERIC_CHARACTERS         .,
    NLS_CHARACTERSET EL8MSWIN1253
    NLS_CALENDAR                   GREGORIAN
    NLS_DATE_FORMAT                DD-MON-RR
    NLS_DATE_LANGUAGE              AMERICAN
    NLS_SORT                       BINARY
    NLS_TIME_FORMAT                HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY              $
    NLS_COMP                       BINARY
    NLS_LENGTH_SEMANTICS           BYTE
    NLS_NCHAR_CONV_EXCP            FALSE
    NLS_NCHAR_CHARACTERSET         AL16UTF16
    NLS_RDBMS_VERSION              10.2.0.1.0"nls_language doesn't come into play, nor nls_instance_parameters."
    Yes...it's true.
    "So, in the dump you posted, no one can tell whether those characters were INSERTed correctly at all. Your NLS_LANG *registry key* may have been set to an incorrect value (it defaults to American_America.MSWIN1252)."
    Actually , i have used a third-party tool PL/SQL Developer (which does have the OracleDB10g as default home).
    Looking at the Windows registry of OracleDB10g the NLS_LANG is equal to GREEK_GREECE.EL8MSWIN1253.
    "Thirdly, as I implied above the NLS_LANG on import should have been American_America.UTF8."
    According to the Note 227332.1 , if the db characterset of the two dbs are not the same.. then it is preferable the conversion should be done on the import process and not the export....
    So, in an example described there -export from a AMERICAN_AMERICA.WE8MSWIN1252 db and import on UTF8 db - (seems exactly the same as mine) the import is done as such:
    c:\>set NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
           c:\>imp ....
    The conversion to UTF8 is done while inserting the data
           in the UTF8 database.Additional notes....
    I have used many different patterns doing the import......
    1) Use of AMERICAN_AMERICA.UTF8
    2) Use of GREEK_GREECE.EL8ISO8859P7
    3) Use the appropriate NLS_LANG that corresponds to the display of chcp command....
    All tries display some '?' chars.....
    Anyway... I 'll continue reading ... and testing
    Thanks... a lot for your points
    Sim

  • Compare table data between two schemas?

    Hi,
    I am looking for a script to compare the table data between the schemas (two different databases)? I know how to compare table by table but looking for a generic script where I can compare all the tables data from one schema to another schema?
    Thanks a lot...

    here the idea, adapt it with your needs :)
    Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
    Connected as SYS
    SQL> create user user1 identified by user1;
    User created
    SQL> grant create  session to user1;
    Grant succeeded
    SQL> grant create table to user1;
    Grant succeeded
    SQL> alter user user1 quota 10m on DATA;
    User altered
    SQL> create user user2 identified by user2;
    User created
    SQL> alter user user2 quota 10m on DATA;
    User altered
    SQL> grant create table to user2;
    Grant succeeded
    SQL> grant create  session to user2;
    Grant succeeded
    SQL> create table user1.test(a Number) tablespace DATA;
    Table created
    SQL> create table user2.test(a Number) tablespace DATA;
    Table created
    SQL> insert into user1.test values (1);
    1 row inserted
    SQL> insert into user1.test values (2);
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> insert into user2.test values (2);
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> create table sys.logs(Diff number) tablespace data;
    Table created
    SQL> select * from sys.logs;
          DIFF
    SQL>
    CREATE OR REPLACE PROCEDURE TEST_MY_DIFF IS
      CURSOR CUR_ IS
        SELECT D.TABLE_NAME T_NAME FROM DBA_TABLES D WHERE D.OWNER = 'USER1';
      W_DIFF NUMBER;
      TYPE CV_TYP IS REF CURSOR;
      CV CV_TYP;
    BEGIN
      EXECUTE IMMEDIATE 'TRUNCATE TABLE SYS.LOGS';
      FOR I IN CUR_ LOOP
        W_DIFF := 0;
        OPEN CV FOR 'select count(*)
    from
    ( select * from USER1.' || I.T_NAME || '
    minus
    select * from USER2.' || I.T_NAME || ' )
    union all
    ( select * from USER2.' || I.T_NAME || '
    minus
    select * from USER1.' || I.T_NAME || ')
        LOOP
          FETCH CV
            INTO W_DIFF;
          INSERT INTO SYS.LOGS VALUES (W_DIFF);
          COMMIT;
          EXIT WHEN CV%NOTFOUND;
        END LOOP;
      END LOOP;
    EXCEPTION
      WHEN OTHERS THEN
        NULL;
    END;
    SQL> BEGIN
      2  test_my_diff;
      3  end;
      4  /
    PL/SQL procedure successfully completed
    SQL> select * from sys.logs;
          DIFF
             1
             1

  • Unable to take export from particular tables from the schema.

    i created a schema duser data is imported and now i want to take select tables from this schema.
    the tables are (partyhdr,partyaddressdtl,partycontactdtl,partydsdtl,partytdsexcludedtl,partycurrencydtl)
    D:\>EXP DUSER/LOG@ORCL FILE=20121221PARTY0228PM.DMP TABLES=PARTYHDR,PARTYADDRESS
    DTL,PARTYCONTACTDTL,PARTYTDSDTL,PARTYTDSEXCLUDEDTL,PARTYCURRENCYDTL;
    Export: Release 10.1.0.2.0 - Production on Fri Dec 21 14:30:21 2012
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Release 10.1.0.2.0 - Production
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    . . exporting table PARTYHDR 19387 rows exported
    . . exporting table PARTYADDRESSDTL 20747 rows exported
    . . exporting table PARTYCONTACTDTL 226 rows exported
    . . exporting table PARTYTDSDTL 53 rows exported
    . . exporting table PARTYTDSEXCLUDEDTL 2 rows exported
    EXP-00011: DUSER.PARTYCURRENCYDTL; does not exist
    Export terminated successfully with warnings.
    as i check in schema partycurrencydtl table is their AND SHOWING RECORDS ALSO.
    SELECT OBJECT_TYPE FROM ALL_OBJECTS WHERE OWNER='DUSER'AND OBJECT_NAME='PARTYCURRENCYDTL';
    OBJECT_TYPE
    TABLE
    i am able understand why this particualr table is not exporting.
    Kindly help out.

    Dear hitqon,
    i am facing the below problem in export only,but their is no problem in import.
    Tablespace Details
    FILE-NAME TABLESPACE_NAME BYTES BLOCKS
    D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\AXPERT.DBF AXPERT 8589934592 1048576
    Version:
    WE ARE USING version
    Oracle Database 10g Release 10.1.0.2.0 - Production
    PL/SQL Release 10.1.0.2.0 - Production
    CORE     10.1.0.2.0     Production
    TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
    NLSRTL Version 10.1.0.2.0 - Production
    D:\>EXP CENTRAL/LOG@ORCL FILE=20121217CENTRAL0857AMFROMSERVER237.DMP
    Export: Release 10.1.0.2.0 - Production on Mon Dec 17 08:57:47 2012
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Release 10.1.0.2.0 - Production
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified users ...
    . exporting pre-schema procedural objects and actions
    . exporting foreign function library names for user CENTRAL
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions for user CENTRAL
    About to export CENTRAL's objects ...
    . exporting database links
    . exporting sequence numbers
    . exporting cluster definitions
    EXP-00056: ORACLE error 24324 encountered
    ORA-24324: service handle not initialized
    EXP-00056: ORACLE error 24324 encountered
    ORA-24324: service handle not initialized
    EXP-00000: Export terminated unsuccessfully
    Only export will be successfully,when we restarted the oracle services. How to over come this issue with out restarting the oracle services.
    Edited by: leen on Dec 28, 2012 12:43 AM

  • Export dump only 1000 tables from the schema which contains 3000 tables.

    Hi,
    I have an requirement to export the dump only with particular 1000 tables from the schema which contains 3000 tables.
    As I want to take the dump, I need to mention the List of tables in "TABLES" Parameter. But syntax won't allow for 1000 tables.
    Kindly guide me on this to proceed further to take the dump of only particular 1000 tables.
    Thanks in advance.
    Thanks,
    Orahar.

    I have an requirement to export the dump only with particular 1000 tables from the schema which contains 3000 tables.
    As I want to take the dump, I need to mention the List of tables in "TABLES" Parameter. But syntax won't allow for 1000 tables.
    Kindly guide me on this to proceed further to take the dump of only particular 1000 tables.You haven't mentioned the oracle release version.
    if you're using 10g, you could use datapump export/import to achieve this. Not a straight way.
    Check Metalink Export/Import DataPump Parameters INCLUDE and EXCLUDE - How to Load and Unload Specific Objects - 341733.1
    Under section 9. Exporting or Importing a large number of objects.
    HTH
    -Anantha

  • Copying tables between schema owners

    In Timesten, can you copy tables across schemas/owners?
    i.e. OWNER_A.TABLE_Y to OWNER_B.TABLE_Y
    Where TABLE_Y has the same definition? Basically, I'd like to be able to backup one datastore and restore it in another datastore that has the same table definitions, but may have a different owner name.
    Thanks,
    Larry

    I'm not completely clear on exactly what you are looking to do. On one hand you ask about copying tables between schemas. This is easily done:
    CREATE TABLE OWNER_B.TABLE_Y AS SELECT * FROM OWNER_A.TABLE_Y;
    This only works for TimesTen tables that are not part of a cache group; specifically the source table can be part of a cache group but the target table cannot. if the target table is part of a cache group then you need to:
    1. Create the cache group containing the target (cached) table.
    2. INSERT INTO OWNER_B.TABLE_Y SELECT * FROM OWNER_A.TABLE_Y;
    But then you mention backup and restore. Since TimesTen backup/retore (ttBackup/ttRestore) works at a physical level you cannot rename/copy tables as part of that. You might be able to use ttMigrate with the -rename oldOwner:newOwner option but there are some constraints around this (one being that PL/SQL cannot be enabled in the database).
    Chris

  • How to copy data, table rows between tables in different schema

    how do I copy rows from one table in one schema into another table in another schema in same database?

    Hi,
    Give an Access to the respective table in Source Schema to Destinations Schema. If table does not exits in the destination schema use CTAS else Insert into..etc., with your select Query.
    - Pavan Kumar N

  • Different ways to copy data between two schemas in one instance

    Hi there,
    I am searching a good way to copy data between two schemas in the same instance.
    Both schemas have an identical structure such as triggers, tables, views and so on. The only difference is the purpose: one is the productivity system and one is for development.
    I looked at datapump but I do not explicit want to export / import. I want to keep the data in the productivity schema as well as copy it to the other schema. Any ideas? I found out there is a copy statement but I dont't know how that works.
    Thank you so far,
    Jörn

    Thank you for your replies!
    I also thought of creating a second instance for development and move the dev - schema to it. I just don't know whether our server can handle both (performance?). Anyway the idea is to have a possibility to quickly rebuild the data inside a schema without indixes or triggers, just pure data. I thought the easiest way would be to copy the data between the schemas as they are exactly the same. However if you tell me DataPunp is the best solution i won't deny using it :).
    When you export data a file is created. does that also mean that the exported data is deleted inside the schema?
    best regards
    Jörn
    Ps: Guido, you are following me, aren' t you? ;-)

  • Export and Import of Schemas (PY and TM)

    Hi All,
    Is there a way to Export and Import Schemas (PY and TM)?
    Do exist a report standard, or custom , to do it?
    Or if somebody knows all the tables behind a schema.
    Because we have tried to load some tables but when we see the schema some description or comment are not shown, and then become difficult to read it.
    Thanks for any suggestion.
    Massi.

    Can you please let me know Export and Import of APPS and Applsys Schemas in R12 will cause any issue ?If you mean exporting/importing only those two schema between different instances then this is not supported (due to other schema dependencies) and the only supported way to export those two schema is by exporting/importing the complete database.
    Export/Import Process for Oracle E-Business Suite Release 12 using 10gR2 [ID 454616.1]
    Export/import process for R12 using 11gR1 or 11gR2 [ID 741818.1]
    Thanks,
    Hussein

  • Compare DB objects between different schemas

    Hi,
    I want to compare db objects beween 2 different schemas like QA and PROD.
    Please suggest me a tool that compares table definitions,stored procedures and other db objects between different schemas.

    Did you check the above video link which is shared?
    Yes I'd agree with you and also i faced these situations to check what objects i need to export from Dev to Quality ( to analyze what are already correct or what have to be imported again)
    Generally Quality & Prod are in sync.
    Also will be waiting along with you if anyone comments on any such tool.
    Regards,
    Krishna Tangudu

  • Export data from one schema to another schema through sql

    Hello.
    I have 2 schemes. One is called MICC_ADMIN and the other one is called MICC_PROD. What I want is to export from MICC_ADMIN to import in MICC_PROD. I tried to do it with the Data Workshop tool, but one of the table has around 19.000 records, so it gets frozen when is trying to export the data. So I'm wondering if is there any way to do it through sql command. Thanks.
    Regards, Bernardo.

    I am going to assume that you:
    1) want to export DB objects from the source schema (MICC_ADMIN) to your target schema (MICC_PROD)
    2) awant to export the data held in the aforementioned tables between the two schemas
    Firstly, generate the relevant DDL for your DB objects (you can do this in APEX as well - Home>Utilities>Generate DDL then complete the wizard) and run the DDL script in your target schema.
    Secondly, grant access to the relevant tables in the source schema to your target schema and compose DML insert statements to transfer the data from one to another (remembering to disable the relevant constraints/triggers during the process).
    Thereafter, revoke access to your source schema.
    You can, of course execute this in a single script, although better to do so in a test environment first if you can!

Maybe you are looking for

  • Error while using DBMS_METADATA.GET_DDL package.

    Hi all, I want script of DDL of all tables in Database not in particular schema, As I am using below query SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name) FROM ALL_TABLES u WHERE u.nested='NO' AND (u.iot_type is null or u.iot_type='IOT') but it gi

  • Unable to send or receive text messages after updating iOS to 7.0.2

    I am unable to send or receive text messages aftering updating to iOS 7.02. I have an iPhone 4S. I have run all the suggested troubleshooting still can't text. I have been to my carrier, AT&T, there is no issue with my account. AT&T suggested resetti

  • UpdateXML : How to update EmployeeName tag based on EmployeeID value

    Hi All, My XMLType (EMP_DOCUMENT) field in a table stores the following simple XML structure: <DEPARTMENT>      <DEPARTMENT_ID>1</DEPARTMENT_ID>      <DEPARTMENT_NAME>Finance</DEPARTMENT_NAME>      <EMPLOYEE>           <EMPLOYEE_ID>1</EMPLOYEE_ID>   

  • User defined information when Expense Type - OIE

    Hi Gurus, I need to customize internet expense report based on expense type to provide more user friendly information on page. Is this possible by personalizatoin or need to do OAF extension for page. Example: Use selects Expense type = 'Per Diem', n

  • Trouble with 10. Network.

    I set up my AirPort Extreme with a 10. Network.  Why does my iPhone and iPads sometimes look for the network with a 192 address.