Export sequence from once schema to another using dbms_datapump

Hello,
Can anybody help me how to export only sequences from one schema to another using dbms_datapump or using any other packages.
I cannot use the expdp/impdp from command prompt.
Thanks.

Hello Richard,
No luck yet, it's new one now.
declare
l_dp_handle NUMBER;
v_job_state varchar2(4000);
l_last_job_state VARCHAR2(30) := 'UNDEFINED';
l_job_state VARCHAR2(30) := 'UNDEFINED';
l_sts KU$_STATUS;
v_logs ku$_LogEntry;
v_row PLS_INTEGER;
BEGIN
dbms_output.put_line('get_sequence - Started');
l_dp_handle := DBMS_DATAPUMP.open(operation => 'IMPORT',
job_mode => 'SCHEMA',
remote_link => 'PSUP_DATA',
version => 'LATEST');
dbms_output.put_line('get_sequence - get handle :'||l_dp_handle);
DBMS_DATAPUMP.add_file(handle => l_dp_handle,
filename => 'test.log',
directory => 'DMPDIR',
filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE); dbms_output.put_line('get_sequence - add file');
DBMS_DATAPUMP.METADATA_FILTER(l_dp_handle, 'SCHEMA_LIST', '''PSUP_DATA'''); dbms_output.put_line('get_sequence - metadata filer1');
DBMS_DATAPUMP.METADATA_FILTER(l_dp_handle,
'INCLUDE_PATH_EXPR',
'IN (''SEQUENCE'')'); dbms_output.put_line('get_sequence - metadata filer2');
DBMS_DATAPUMP.METADATA_REMAP(l_dp_handle,
'REMAP_SCHEMA',
'PSUP_DATA',
'IRIS_DATA'); dbms_output.put_line('get_sequence - metadata remap');
DBMS_DATAPUMP.start_job(l_dp_handle); dbms_output.put_line('get_sequence - starting job');
DBMS_DATAPUMP.WAIT_FOR_JOB(l_dp_handle, v_job_state);
dbms_output.put_line('get_sequence - completed');
exception
WHEN OTHERS THEN
dbms_datapump.get_status(NULL, 8, 0, v_job_state, l_sts);
v_logs := l_sts.error;
v_row := v_logs.FIRST;
LOOP
EXIT WHEN v_row IS NULL;
dbms_output.put_line('logLineNumber=' || v_logs(v_row).logLineNumber);
dbms_output.put_line('errorNumber=' || v_logs(v_row).errorNumber);
dbms_output.put_line('LogText=' || v_logs(v_row).LogText);
v_row := v_logs.NEXT(v_row);
END LOOP;
RAISE;
end;
get_sequence - Started
get_sequence - get handle :58
get_sequence - add file
declare
ERROR at line 1:
ORA-31623: a job is not attached to this session via the specified handle
ORA-06512: at "SYS.DBMS_DATAPUMP", line 2772
ORA-06512: at "SYS.DBMS_DATAPUMP", line 3886
ORA-06512: at line 43
ORA-39001: invalid argument value
I go ogled some of adive i could see is grant create table to user, but my user is having DBA role as well.
Please help.

Similar Messages

  • Moving procedures and sequences from one schema to another

    Hi all,
    Is there any way to export the procedures and sequences alone from one schema to another? If not is there any way to generate the procedure creating scripts from the source schema.
    I used the following script SET HEADING OFF
    SET PAGESIZE 999
    SET LINESIZE 100
    SELECT DBMS_METADATA.GET_DDL('PROCEDURE', NAME, owner) || '/' FROM ALL_SOURCE WHERE
    OWNER='SCOTT' AND TYPE='PROCEDURE'
    SPOOL C:\A.SQL
    SPOOL OFF
    [/CODE]
    But the problem is in the out put script it is cutting the line .. for egCREATE OR REPLACE PROCEDURE "QC_PFIZER_REL5"."SPGETNEXTDS
    S_ID"
    ( V_ID OUT NUMBER )
    IS
    BEGIN
    SELECT SEQUENCE_DSS_Id.NEXTVAL INTO V_ID FROM DUAL;
    END ;
    i experimented with increasing linesize but it is not helping. I am using 9.2.0.5 on windows 2003.
    Thanks
    Muneer

    Similar to getting the code from user_source, you could get sequences from user_sequences.
    SQL> select dbms_metadata.get_ddl('SEQUENCE', sequence_name) from user_sequences ;
    DBMS_METADATA.GET_DDL('SEQUENCE',SEQUENCE_NAME)
       CREATE SEQUENCE  "SCOTT"."SEQ"  MINVALUE 1 MAXVALUE 1.00000000000000E+27 INCR
    EMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE
    1 row selected.
    SQL>

  • 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!

  • 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 do i transfer music from one ipod to another using itunes

    how do i transfer music from one ipod to another using itunes

    Welcome to the Apple Community.
    There is more than one way, but to get it all on all devices, connect the first device to iTunes and choose to transfer the music from the device from the file menu. Once everything is in iTunes connect the second device, select the device in the device list, navigate to the music tab and check the content you wish to sync, click apply/sync.

  • How do I move a table from one schema to another schema on Oracle XE?

    How do I move a table from one schema to another schema on Oracle XE?

    Hi,
    I tried to use the insert/select statement that you had given, it did not work.
    The error is ORA-00913: too many values.
    But finally what I did was, I went into the system schema where the table was and generated the DDL through the utilities and afterwards I imported them into the schema that I am currently working on. It solved the problem!
    However I am still curious to know why the insert/select statement did not work? Do you know any site/tutorial which gives a real time example?
    Thank you
    Skye

  • How do I move a table from one schema to another schema?

    How do I move a table from one schema to another schema?

    Grant access to the table from the source schema to destination schema.
      GRANT SELECT ON <TABLE_NAME> TO  <DESTINATION SCHEMA>A simple way would be to use CREATE Table with select syntax (in destination schema)
      CREATE TABLE <TABLE_NAME> AS SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME><li>However, you would be in <b><u>trouble when the table has index,constraints and triggers</u></b>.
    So you can better of grab the DDL statement of the table(and any additional components) andd then create the table in the destination schema.You can use SQL developer, Toad or Apex's Object browser for this.
    After the table is created, Insert the records using SELECT.
    INSERT INTO <TABLE_NAME> SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME>This question is discussed in great detail in this <b>AskTom thread</b>

  • Best LKM to move data from with in Oracle from one schema to another Schema

    Hi Gurus,
    What is the best KM to move data from one schema to another schema within same oracle database.
    Thanks in advance

    Dear,
    If your source and target are on the same database server then you dont need LKM.
    You have to 1. create one data server for the database server
    2. Create one physical schema for your source and another physical schema for your target under the above created data server.
    3. Then create models for each above created physical schema
    In this case you just need IKM knowledge module
    Please refer http://oditrainings.blogspot.in/2012/08/odi-interface-source-target-on-same.html
    If your source and target are on different server then you must create two different data servers in topology. You have to use LKM.
    The best LKM to use is LKM oracle to Oracle dblink. But you should have proper grants to use it
    If your source has very few records you can go with LKM SQL to Oracle other wise use LKM oracle to Oracle dblink

  • Copying data contianing long datatype from one schema to another

    I'm using Oracle 8.1.7 and trying to move copy data from one schema to another.
    Usually an easy task. This time the data contains longs so I can't use standard SQL. The data in the long is too long for a PL/SQL long datatype so that's not worked.
    I've tried the COPY FROM command but get the invalid sql command error.
    Can anyone save my hair?

    The COPY command doesn't have to be all on one line. The continuation character for SQL*Plus commands is a hyphen.
    SQL> prompt "Hello"
    "Hello"
    SQL> prompt -
    "Hello""Hello"
    SQL>Metalink is the website for customers that pay for Oracle support. Go to www.oracle.com and click on the metalink button on the top left of the screen. It's called Metalink because Oracle support levels are named after metals: bronze, silver, gold.

  • Copy data from one schema to another schema tables

    Hi,
    I was doing a copy using sql developer copy feature, data copy worked perfect but for few table data didn't move there are about 30 tables from schema prod to schema dev i need to move tables are already created only data needs to be moved from prod to dev
    Can you suggest me any method were I can move all the tables data at a time from one schema to another. Please suggest.
    Thanks
    Sudhir

    Hi,
    If table structure is the same then:
    insert into dev.table_name
    select
    from
      prod.table_name  --if prod is in another database change to prod.table_name@db_link_to_prod_db
    commit
    ;Hope this helps. Otherwise give some more info about where these schema's are.
    Regards,
    Peter

  • Can I move photos from one computer to another using Vault?

    Can I move photos from one computer to another using Vault?  I use an external hard drive as a vault for my Imac and I want to import photos to my Macbook pro.  I have aperture 3 on both units.  Can I just plug the ext. drive into the laptop and import from the vault?

    You can't import from the vault but you can restore that vault onto the MBP. This will restore the complete library that is contained in the vault.

  • HT4527 I am trying to transfer music files from one PC to another using homeshare and although I can view the music as a shared folder I cannot initiate the "import" process.  I have iTunes 11.0.1.12 on both computers so the help screenshots do not help a

    I am trying to transfer music files from one PC to another using homeshare and although I can view the music as a shared folder I cannot initiate the "import" process.  I have iTunes 11.0.1.12 on both computers so the help screenshots do not help as such

    Then stop trying to use HomeShare and use one of the other options listed in the document from which your question was posted.

  • How do I move from one website to another using Safari, while still allowing Pandora to provide music in the background? It seems that when ever I open a new URL, I lose Pandora.

    How do I move from one website to another using Safari, while still allowing Pandora to provide music in the background? It seems that when ever I open a new URL, I lose Pandora.

    Try running Pandora in its own tab and leaving that tab open (Safari 7.1.5, OS 10.9.5).  I don't have Pandora to try this, but it works for me otherwise.
    Good luck
    srb

  • Loading data from one table to another using cursor

    Hi,
    I have given the below command to load the data from 1 table to another using cursor.
    declare
    cursor mycursor IS
    SELECT extract_name,from_date,to_date,BETA from temp_table where EXTRACT_NAME='GIFTCARD_DETAILS';
    Begin
    for mycursor_1 IN mycursor loop
    insert into tmp_tab columns(col1,col2,col3,col5) values(mycursor_1.EXTRACT_NAME,mycursor_1.from_date,mycursor_1.to_date,mycursor_1.BETA);
    End loop;
    commit;
    end;
    It is working fine.
    But I want to hard code some of the columns ( like flags ) which are not there in 1st table and load them into 2nd table.
    In db2 we will give commands like
    varSqlStatus=`db2 "declare mycurs cursor for select extract_name,from_date,to_date,BETA,'N','Y' from temp_table"`
    varSqlStatus=`db2 "load from mycurs of cursor modified by identityignore insert into tmp_tab(col1,col2,col3,col5,col6,col7) nonrecoverable"`
    But I want it in oracle 10g, Can any one help me in this.

    Have you tried either of the two options :
    1. Modify the CURSOR itself :
    cursor mycursor IS
    SELECT extract_name,from_date,to_date,BETA,'N','Y' from temp_table where EXTRACT_NAME='GIFTCARD_DETAILS';2. Modify the INSERT statement itself :
    insert into tmp_tab columns(col1,col2,col3,col5,col6,col7) values(mycursor_1.EXTRACT_NAME,mycursor_1.from_date,mycursor_1.to_date,mycursor_1.BETA,'N','Y');

  • Upgarded to PE 13 - How do I drag an image from one screen to another (using 2 monitors)

    upgarded to PE 13 - How do I drag an image from one screen to another (using 2 monitors)

    upgarded to PE 13 - How do I drag an image from one screen to another (using 2 monitors)

Maybe you are looking for

  • IPod's music library only shows items purchased from iTunes store?

    I'm really frustrated because I've only had this iPod since Christmas and it's already giving me grief. My iPod is synced with 918 songs: However, my music library on the device itself only displays 65, as seen here: These songs are ones I've purchas

  • SENDmail issue to Lotus Notes Reciever

    Hi All, The SENDmail function of SAP has been working great in the PROD system. However, there was a problem regarding the Lotus Notes side. The reciever in the Lotus Notes experienced an error stated as : 'Sorry, an uncorrectable error has occured.

  • [JOB] Web Developer

    Please reference Charles Parcell when applying. Celerity has won an outsourced contract to manage dynamic content for a large extranet presence for a Fortune 200 financial services firm. We are looking for Web Developers to join our team. You must po

  • Invoking ActiveBPEL Process from Oracle

    Hi, I've a problem when trying to invoke a process that is deployed in ActiveBPEL Open Source Engine as Web Service.Short description of the (simple) scenario: I defined a BPEL Process in Oracle that receives a message (containing two strings) and de

  • How to attach programatically the object form itself?

    I want to attach the object form to the form with javascript. Is this possible? Thanx in advance