Use Oracle Data Pump to Export Data from Autonomous Database
Oracle Data Pump offers very fast bulk data and metadata movement between Autonomous Database and other Oracle databases.
Oracle recommends using the latest Oracle Data Pump version for exporting data from Autonomous Database to other Oracle databases, as it contains enhancements and fixes for a better experience. Download the latest version of Oracle Instant Client and download the Tools Package, which includes Oracle Data Pump, for your platform from Oracle Instant Client Downloads. See the installation instructions on the platform install download page for the installation steps required after you download Oracle Instant Client and the Tools Package.
-
Option 1: Move Data with Data Pump Export to an Autonomous Database Directory
Use Oracle Data Pump to export the data to a directory on your database, and then move the data from the directory to Cloud Object Store. This method can be beneficial when you want to move data from your Autonomous Database to multiple target databases. Instead of exporting the data to multiple Cloud Object Stores, you can create a dump file set once and use it for multiple target databases.
Perform the following steps to move data from Autonomous Database by exporting it to a directory on your database:- Export data to a directory on Autonomous Database and move the dump file set from the directory to your Cloud Object Store. See Export Data Using a Directory on Autonomous Database.
- Download the dump files from the Cloud Object Store, import the data into the target database, and clean up the Cloud Object Store. See Download Dump Files, Run Data Pump Import, and Clean Up Object Store.
-
Option 2: Move Data with Data Pump Export to Object Store
Using this export method you use Oracle Data Pump to directly export data to your object store. This export method is supported with Oracle Cloud Infrastructure Object Storage and Oracle Cloud Infrastructure Object Storage Classic. This avoids the overhead of creating a dump file set in a directory on your Autonomous Database and then moving the dump file set to the Cloud Object Store. When you plan to move data to a single target database, this method saves effort and speeds up the export process.
Perform the following steps to move data from Autonomous Database by exporting it directly to your object store:- Export data from Autonomous Database to a Cloud Object Store directly. See Export Data From Autonomous Database to Object Store Directly.
- Download the dump files from the Cloud Object Store, import the data into the target database, and clean up the Cloud Object Store. See Download Dump Files, Run Data Pump Import, and Clean Up Object Store.
- Export Data Using a Directory on Autonomous Database
- Export Data From Autonomous Database to Object Store Directly
Shows how to use Oracle Data Pump to export data from Autonomous Database to Cloud Object Store directly. - Download Dump Files, Run Data Pump Import, and Clean Up Object Store
If required, download the dump files from Cloud Object Store and use Oracle Data Pump Import to import the dump file set to the target database. Then perform any required clean up.
Parent topic: Export Data From Autonomous Database
Export Data Using a Directory on Autonomous Database
Use Data Pump to Create a Dump File Set on Autonomous Database
-
Create a directory in which to store the dump files containing the exported data. For example:
CREATE DIRECTORY data_export_dir as 'data_export';
-
Run Data Pump Export with the dumpfile parameter set, the filesize parameter set to less than 50G, and the directory parameter set. For example, the following shows how to export a schema named
SALES
in an Autonomous Database namedATPC1
with 16 OCPUs:expdp sales/password@ATPC1_high directory=data_export_dir dumpfile=exp%L.dmp parallel=16 encryption_pwd_prompt=yes filesize=1G logfile=export.log
Notes for Data Pump parameters:-
In case of ECPUs,
parallel
must be set to 0.25 times the ECPU count. The above example with 16 ECPUs will haveparallel
set to 0.25 x 16, that is, 4 withexpdp
. -
If during the export with
expdp
you use theencryption_pwd_prompt=yes
parameter, then you must useencryption_pwd_prompt=yes
with your import and input the same password at theimpdp
prompt to decrypt the dump files (remember the password you supply with export). The maximum length of the encryption password is 128 bytes. -
The
dumpfile
parameter supports the%L
and%l
wildcards in addition to the legacy%U
and%u
wildcards. For example,dumpfile=export%L.dmp
.Use the
%L
or%l
wildcard for exports from Oracle Database Release 12.2 and higher. This wildcard expands the dumpfile file name into a 3-digit to 10-digit, variable-width incrementing integer, starting at 100 and ending at 2147483646.
For the best export performance use the
HIGH
database service for your export connection and set thePARALLEL
parameter to the number of CPUs in your a database. For information on which database service name to connect to run Data Pump Export, see Predefined Database Service Names for Autonomous Databases.After the export is finished you can see the generated dump files by running a query like the following:SELECT * FROM DBMS_CLOUD.LIST_FILES('DATA_EXPORT_DIR');
For example, the output from this query shows the generated dump files and the export log file:OBJECT_NAME BYTES CHECKSUM CREATED LAST_MODIFIED ---------------------- ---------- ----–---- –------------------------–----- -------------------- exp01.dmp 12288 12-NOV-19 06.10.47.0 PM GMT 12-NOV-19... exp02.dmp 8192 12-NOV-19 06.10.48.0 PM GMT 12-NOV-19... exp03.dmp 1171456 12-NOV-19 06.10.48.0 PM GMT 12-NOV-19... exp04.dmp 348160 12-NOV-19 06.10.48.0 PM GMT 12-NOV-19... export.log 1663 12-NOV-19 06.10.50.0 PM GMT 12-NOV-19...
-
-
To perform a full export or to export objects that are owned by other users, you need the
DATAPUMP_CLOUD_EXP
role. -
The API you use to move the dump files to your Object Storage supports file sizes up to 50GB, so make sure you do not specify sizes higher than that in the filesize argument.
-
For more information on Oracle Data Pump Export see Oracle Database Utilities.
Move Dump File Set from Autonomous Database to Your Cloud Object Store
-
Connect to your Autonomous Database.
-
Store your Cloud Object Storage credential using the
DBMS_CREDENTIAL.CREATE_CREDENTIAL
procedure. For example:BEGIN
DBMS_CREDENTIAL.CREATE_CREDENTIAL
( credential_name => 'DEF_CRED_NAME', username => 'adb_user@oracle.com', password => 'password' ); END; /The values you provide forusername
andpassword
depend on the Cloud Object Storage service you are using:-
Oracle Cloud Infrastructure Object Storage:
username
is your Oracle Cloud Infrastructure user name andpassword
is your Oracle Cloud Infrastructure auth token. See Working with Auth Tokens. -
Oracle Cloud Infrastructure Object Storage Classic:
username
is your Oracle Cloud Infrastructure Classic user name andpassword
is your Oracle Cloud Infrastructure Classic password.This operation stores the credentials in the database in an encrypted format. You can use any name for the credential name. Note that this step is required only once unless your object store credentials change. Once you store the credentials you can then use the same credential name for all data loads.
-
-
Move the dump files from the Autonomous Database to your Cloud Object Store by calling
DBMS_CLOUD.PUT_OBJECT
.For example:BEGIN
DBMS_CLOUD.PUT_OBJECT
(credential_name => 'DEF_CRED_NAME', object_uri => 'https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/idthydc0kinr/mybucket/exp01.dmp', directory_name => 'DATA_EXPORT_DIR', file_name => 'exp01.dmp');DBMS_CLOUD.PUT_OBJECT
(credential_name => 'DEF_CRED_NAME', object_uri => 'https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/idthydc0kinr/mybucket/exp02.dmp', directory_name => 'DATA_EXPORT_DIR', file_name => 'exp02.dmp');DBMS_CLOUD.PUT_OBJECT
(credential_name => 'DEF_CRED_NAME', object_uri => 'https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/idthydc0kinr/mybucket/exp03.dmp', directory_name => 'DATA_EXPORT_DIR', file_name => 'exp03.dmp');DBMS_CLOUD.PUT_OBJECT
(credential_name => 'DEF_CRED_NAME', object_uri => 'https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/idthydc0kinr/mybucket/exp04.dmp', directory_name => 'DATA_EXPORT_DIR', file_name => 'exp04.dmp'); END; /See PUT_OBJECT Procedure for information on
PUT_OBJECT
.
Export Data From Autonomous Database to Object Store Directly
Shows how to use Oracle Data Pump to export data from Autonomous Database to Cloud Object Store directly.
Download Dump Files, Run Data Pump Import, and Clean Up Object Store
If required, download the dump files from Cloud Object Store and use Oracle Data Pump Import to import the dump file set to the target database. Then perform any required clean up.
For detailed information on Oracle Data Pump Import parameters see Oracle Database Utilities.