Import a single package from data pump export

I wanted to import just a package from a Data Pump export file (dmp.)
en español

$ORACLE_HOME/bin/impdp system/**** directory=imp_dir dumpfile=ORADB_13_12_31_part_%U.dmp logfile=ORADB_imp_pckg.log table_exists_action=REPLACE SCHEMAS=SALES include=PACKAGE:PRICING_PKG

But I got an error message:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning option
ORA-39001: invalid argument value
ORA-39071: Value for INCLUDE is badly formed.
ORA-00920: invalid relational operator

Turns out that the name of the objects in the include clause must be surrounded with quotation marks that must be escaped with \ (back slashes):

$ORACLE_HOME/bin/impdp system/**** directory=imp_dir dumpfile=ORADB_13_12_31_part_%U.dmp logfile=ORADB_imp_pckg.log table_exists_
action=REPLACE SCHEMAS=SALES include=PACKAGE:\”=\’PRICING_PKG\’\”

This worked

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning option
Master table “SYSTEM”.”SYS_IMPORT_SCHEMA_01″ successfully loaded/unloaded
Starting “SYSTEM”.”SYS_IMPORT_SCHEMA_01″:  system/******** directory=imp_dir dumpfile=ORADB_13_12_31_part_%U.dmp logfile=ORADB_imp_pckg.log table_exists_action=REPLACE SCHEMAS=SALES include=PACKAGE:”=’PRICING_PKG'”
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE/PACKAGE_SPEC
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE_BODIES/PACKAGE/PACKAGE_BODY
Job “SYSTEM”.”SYS_IMPORT_SCHEMA_01″ successfully completed at 11:00:05

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s