Importing the exported file along with sequences.
Ravi Rai, April 24, 2017 - 9:03 am UTC
Hello Connor McDonald
Thank you for reply.
Now its Working fine.
Next step, I have to import that exported file in another schema KNK1 along with sequences.
Kindly find the code.
declare
h1 number;
v_schema VARCHAR2(32);
v_time VARCHAR2(32);
v_job_state varchar2(4000);
begin
SELECT to_char(SYSDATE, 'DD_MM_YYYY_hh24_mi_ss') INTO v_time FROM DUAL;
v_schema:='KNK1';
h1 := dbms_datapump.open(operation => 'IMPORT', job_mode => 'SCHEMA');
DBMS_DATAPUMP.add_file (h1,filename => 'test.DMP',directory => 'EXP',filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);
DBMS_DATAPUMP.add_file (handle => h1,directory => 'EXP',filename => 'IMPapi.log',filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
dbms_datapump.metadata_filter(handle => h1,name => 'SCHEMA_EXPR',value => '= ''KNK1''');
dbms_datapump.metadata_filter(handle => h1,name => 'NAME_EXPR',value => 'IN (''T_VISIT'',''T_SUBVISIT'',''T_SERVICES'')', object_type => 'TABLE');
dbms_datapump.metadata_filter(handle => h1,name => 'NAME_EXPR',value => 'IN (''PATIENT_INFO_SEQ'',''PATIENT_SERVICES_REG2_SEQ'')', object_type => 'SEQUENCE');
dbms_datapump.set_parameter (h1, 'TABLE_EXISTS_ACTION', 'REPLACE');
dbms_datapump.start_job(h1);
DBMS_DATAPUMP.WAIT_FOR_JOB(h1, v_job_state);
DBMS_OUTPUT.PUT_LINE(v_job_state);
end;
But I am facing following issue.
ORA-31627: API call succeeded but more information is available
Kindly help me.
Thanks
Ravi Rai
Oracle Apex Developer
(Sarada Research Labs)
May 02, 2017 - 3:16 am UTC
Anything the log file ?
Reg : Log in Importing sequences along with tables
Ravi Rai, May 02, 2017 - 8:55 am UTC
Master table "KNK1"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
ORA-39039: Schema expression "= 'KNK1'" contains no valid schemas.
ORA-31655: no data or metadata objects selected for job
Starting "KNK1"."SYS_IMPORT_SCHEMA_01":
Job "KNK1"."SYS_IMPORT_SCHEMA_01" successfully completed at 14:19:15
Kindly help me to figure out this problem.