Wednesday, September 21, 2011

DIRECTORY and ENCRYPTION parameter in Datapump


DIRECTORY:

Specifies the location to which Export can write the dump file set and the log file.

DATA_PUMP_DIR is the default directory name which points to D:\app\Vishwanath\admin\delhi\dpdump location.

Creation of directory involves two stages:

1.)create directory dpump as 'D:\>backup\dump\';

Granting read,write permission to user who will do the import or export operation.

2.) grant read,write on directory dpump to scott.


ENCRYPTION: 

To enable encryption, either the ENCRYPTION or ENCRYPTION_PASSWORD parameter, or both, must be specified. If only the ENCRYPTION_PASSWORD parameter is specified, then the ENCRYPTION parameter defaults to ALL. If neither ENCRYPTION nor ENCRYPTION_PASSWORD is specified, then ENCRYPTION defaults to NONE.
Data pump encryption is specified by the encryption parameter, the algorithm of the encryption and the mode of the encryption

ENCRYPTION :  Encrypt part or all of the dump file where valid keyword
     ALL: Both metadata and data are encrypted
     DATA_ONLY: Only data is encrypted.
 ENCRYPTED_COLUMNS_ONLY: Only encrypted columns are written to the dump file in an encrypted format
    METADATA_ONLY: Only metadata is encrypt
    NONE: Nothing is encrypted

ENCRYPTION_ALGORITHM  Specify how encryption should be done where valid keyword values are: (AES128 | AES192 |  AES256 ).

ENCRYPTION_MODE  Method of generating encryption key where valid keyword values are :
( DUAL | PASSWORD | TRANSPARENT ) .

ENCRYPTION_PASSWORD  Password key for creating encrypted column data

c:\>expdp system/sys@delhi dumpfile=scott.dmp logfile=scott_log.log  schemas=scott encryption=all encryption_password=pass encryption_algorithm=AES256 ENCRYPTION_MODE=password

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/********@delhi dumpfile=scott.dmp logfile=scott_log.log schemas=scott encryption=all encryption_password=******** encryption_algorithm=AES256 ENCRYPTION_MODE=password
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
. . exported "SCOTT"."DEPT"                              5.945 KB       4 rows
. . exported "SCOTT"."EMP"                               8.578 KB      14 rows
. . exported "SCOTT"."SALGRADE"                          5.875 KB       5 rows
. . exported "SCOTT"."BONUS"                                 0 KB       0 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  D:\APP\BISHWANATH\ADMIN\DELHI\DPDUMP\SCOTT.DMP
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 11:53:54

SQL> host impdp system/sys@delhi dumpfile= scott.dmp logfile=scott_log_imp.log

Import: Release 11.2.0.1.0 - Production on Wed Sep 21 11:55:11 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39174: Encryption password must be supplied.

c:\>impdp system/sys@delhi dumpfile= scott.dmp logfile=scott_log_imp_1.log encryption_password=pass 

Import: Release 11.2.0.1.0 - Production on Wed Sep 21 11:57:28 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/********@delhi dumpfile= logfile=scott_log_imp_1.log encryption_password=********
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "SCOTT"."DEPT"                              5.945 KB       4 rows
. . imported "SCOTT"."EMP"                               8.578 KB      14 rows
. . imported "SCOTT"."SALGRADE"                          5.875 KB       5 rows
. . imported "SCOTT"."BONUS"                                 0 KB       0 rows
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 11:57:31

Enjoy:-)