viernes, 23 de diciembre de 2016

Oracle Data Pump

Oracle Data Pump is made up of three distinct parts:

  • The command-line clients, expdp and impdp
  • The DBMS_DATAPUMP PL/SQL package (also known as the Data Pump API)
  • The DBMS_METADATA PL/SQL package (also known as the Metadata API)

The Data Pump clients, EXPDP and IMPDP, invoke the Data Pump Export utility and Data Pump Import utility, respectively.

The expdp and impdp clients use the procedures provided in the DBMS_DATAPUMP PL/SQL package to execute export and import commands, using the parameters entered at the command line. These parameters enable the exporting and importing of data and metadata for a complete database or for subsets of a database.

When metadata is moved, Data Pump uses functionality provided by the DBMS_METADATA PL/SQL package. The DBMS_METADATA package provides a centralized facility for the extraction, manipulation, and re-creation of dictionary metadata.

The DBMS_DATAPUMP and DBMS_METADATA PL/SQL packages can be used independently of the Data Pump clients.

The users that perform the operations of (EXPDP and IMPDP) just need the following privileges:

  • CREATE OR REPLACE DIRECTORY test_dir AS '/u01/app/oracle/oradata/';
  • GRANT READ, WRITE ON DIRECTORY test_dir TO scott;
  • GRANT EXP_FULL_DATABASE TO SCOTT
  • GRANT IMP_FULL_DATABASE TO SCOTT
  • OPTION E (INCORRECT)
The EXPDP and IMPDP clients use the procedures provided in the DBMS_DATAPUMP PL/SQL package to execute export and import commands.

Table Exports/Imports

The TABLES parameter is used to specify the tables that are to be exported. The following is an example of the table export and import syntax.
  • expdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log
  • impdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log
The TABLE_EXISTS_ACTION=APPEND parameter allows data to be imported into existing tables.

Schema Exports/Imports

The OWNER parameter of exp has been replaced by the SCHEMAS parameter which is used to specify the schemas to be exported. The following is an example of the schema export and import syntax.
  • expdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log
  • impdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=impdpSCOTT.log

Database Exports/Imports

The FULL parameter indicates that a complete database export is required. The following is an example of the full database export and import syntax.
  • expdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=expdpDB10G.log
  • impdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=impdpDB10G.log
Resultado de imagen para Oracle Data Pump

No hay comentarios.:

Publicar un comentario