Oracle commands for exporting imported data through PL/SQL data pump

Source: Internet
Author: User
1: Data Export command declare --- create data pump work handle h1number; begin -- create a user-defined Data Pump for schema backup

1: Data Export command declare --- create data pump work handle h1 number; begin -- create a user-defined Data Pump for schema backup

1: Data Export command

Declare

--- Create a data pump handle

H1 number;

Begin

-- Create a user-defined Data Pump for schema backup

H1: = dbms_datapump.open (operation => 'Port', job_mode => 'scheme ');

-- Define storage files

Dbms_datapump.add_file (handle => h1, filename => 'myhr1. dmp ');

-- Define filter conditions

Dbms_datapump.metadata_filter (handle => h1, name => 'schema _ expt ', value => 'in' MYHR ''');

-- Start the Data Pump session

Dbms_datapump.start_job (handle => h1 );

-- Disconnect the Data Pump session

Dbms_datapump.detach (handle => h1 );

End;


2: Data Import command

Declare

-- Create a data pump handle

H1 number;

Begin

-- Create a user-defined data pump and connect it to orcllib for access

H1: = dbms_datapump.open (operation => 'import', job_mode => 'scheme', remote_link => 'orcllib ');

-- Import the MYHR object mode to the MYHR_TEST object mode.

Dbms_datapump.metadata_remap (handle => h1, name => 'remap _ scheme', old_value => 'myhr', value => 'myhr _ test ');

-- Write logs to the test2.log File

Dbms_datapump.add_file (handle => h1, filename => 'test2. log', filetype => dbms_datapump.KU $ _ FILE_TYPE_LOG_FILE );

-- Start the Data Pump session

Dbms_datapump.start_job (handle => h1 );

-- Disconnect the Data Pump session

Dbms_datapump.detach (handle => h1 );

End;

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.