0% found this document useful (0 votes)
31 views

Data Pump

The document provides instructions for creating a database directory called dmpdir pointing to the /opt/oracle directory, granting permissions to the scott user, and using expdp to export the scott schema to a dump file called scott.dmp. It also shows how to import the dump file into another database using impdp as the system user. Finally, it demonstrates performing an export using the DBMS_DATAPUMP PL/SQL package to write export logs and the dump file to the DMPDIR directory.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Data Pump

The document provides instructions for creating a database directory called dmpdir pointing to the /opt/oracle directory, granting permissions to the scott user, and using expdp to export the scott schema to a dump file called scott.dmp. It also shows how to import the dump file into another database using impdp as the system user. Finally, it demonstrates performing an export using the DBMS_DATAPUMP PL/SQL package to write export logs and the dump file to the DMPDIR directory.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Create database directories

Execute the following commands to create a database directory. This directory must point to
a valid directory on the same server as the database:

CREATE DIRECTORY dmpdir AS '/opt/oracle';

GRANT read, write ON DIRECTORY dmpdir TO scott;

$ expdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp

Import into another database

impdp system/oracle DIRECTORY=dmpdir DUMPFILE=scott.dmp

DECLARE
hand NUMBER;
BEGIN
hand := Dbms_DataPump.Open(operation => 'EXPORT',
job_mode => 'FULL',
job_name => 'FULLEXPJOB',
version => 'COMPATIBLE');
Dbms_DataPump.Add_File(handle => hand,
filename => 'expdp_plsql.log',
directory => 'DMPDIR',
filetype => 3);
Dbms_DataPump.Add_File(handle => hand,
filename => 'expdp_plsql.dmp',
directory => 'DMPDIR',
filetype => 1);
-- Dbms_DataPump.Set_Parameter(handle => hand,
-- name => 'ESTIMATE',
-- value => 'STATISTICS');
Dbms_DataPump.Start_Job(hand);
END;

You might also like