Skip to Main Content

Cloud Platform

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

unable to export schema on Autonomous Database apex service

User_B75VPOct 6 2022 — edited Oct 6 2022

Hi ,
I am trying to export schema using the below procedure but getting an error. Is there any way to export schema in the autonomous Database apex service? If anyone has an idea about this please let me know.
Thanks.

DECLARE
-- replace with your values
export_schema VARCHAR2(64) := 'TEST_SCHEMA';
--import_schema VARCHAR2(64) := 'TEST_SCHEMA'; -- in case you want to remap schema
data_pump_dir VARCHAR2(64) := 'DATA_PUMP_DIR';
dump_file_name VARCHAR2(256) := 'https://objectstorage----------------/n/idzokx2rhmot/b/bucket-20220930-1212/o/TEST_SCHEMA.dmp';
credential_name VARCHAR2(64) := 'OBJECT_STORE_TEST';
parallel NUMBER := 4;

job_handle NUMBER;
job_name VARCHAR2(64);
job_status VARCHAR2(128);
output_message VARCHAR2(1024);
BEGIN
job_name := dbms_scheduler.generate_job_name('export');
job_handle := dbms_datapump.open(operation => 'IMPORT', job_mode => 'SCHEMA', job_name => job_name);
dbms_datapump.add_file(handle => job_handle, filename => dump_file_name, directory => credential_name, filetype => dbms_datapump.ku$_file_type_uridump_file);
dbms_datapump.add_file(handle => job_handle, filename => export_schema || '_import.log', directory => data_pump_dir, filetype => 3);
--dbms_datapump.metadata_remap(job_handle, 'REMAP_SCHEMA', exported_schema, import_schema);
dbms_datapump.metadata_filter(handle => job_handle, name => 'SCHEMA_EXPR', value => '= ''TEST_SCHEMA''');
dbms_datapump.set_parallel(handle => job_handle, degree => parallel);
dbms_datapump.start_job(handle => job_handle, skip_current => 0, abort_step => 0);
dbms_datapump.wait_for_job(handle => job_handle, job_state => job_status);
output_message := 'Data Pump EXPORT Execution: ''' || job_status || '''';
dbms_output.put_line(output_message);
END;
/
error.PNG

Comments
Post Details
Added on Oct 6 2022
0 comments
210 views