Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Oracle impdp -help

impdp -help

Import: Release 19.0.0.0.0 – Production on Thu May 4 01:44:31 2023
Version 19.16.0.0.0

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

The Data Pump Import utility provides a mechanism for transferring data objects
between Oracle databases. The utility is invoked with the following command:

 Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp

You can control how Import runs by entering the ‘impdp’ command followed
by various parameters. To specify parameters, you use keywords:

 Format:  impdp KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
 Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp

USERID must be the first parameter on the command line.


The available keywords and their descriptions follow. Default values are listed within square brackets.

ABORT_STEP
Stop the job after it is initialized or at the indicated object.
Valid values are -1 or N where N is zero or greater.
N corresponds to the object’s process order number in the master table.

ACCESS_METHOD
Instructs Import to use a particular method to load data.
Valid keyword values are: [AUTOMATIC], CONVENTIONAL, DIRECT_PATH,
EXTERNAL_TABLE, and INSERT_AS_SELECT.

ATTACH
Attach to an existing job.
For example, ATTACH=job_name.

CLUSTER
Utilize cluster resources and distribute workers across the Oracle RAC [YES].

CONTENT
Specifies data to load.
Valid keywords are: [ALL], DATA_ONLY and METADATA_ONLY.

DATA_OPTIONS
Data layer option flags.
Valid keywords are: DISABLE_APPEND_HINT, ENABLE_NETWORK_COMPRESSION,
REJECT_ROWS_WITH_REPL_CHAR, SKIP_CONSTRAINT_ERRORS, CONTINUE_LOAD_ON_FORMAT_ERROR,
TRUST_EXISTING_TABLE_PARTITIONS and VALIDATE_TABLE_DATA.

DIRECTORY
Directory object to be used for dump, log and SQL files.

DUMPFILE
List of dump files to import from [expdat.dmp].
For example, DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp.

ENCRYPTION_PASSWORD
Password key for accessing encrypted data within a dump file.
Not valid for network import jobs.

ENCRYPTION_PWD_PROMPT
Specifies whether to prompt for the encryption password [NO].
Terminal echo is suppressed while standard input is read.

ESTIMATE
Calculate network job estimates.
Valid keywords are: [BLOCKS] and STATISTICS.

EXCLUDE
Exclude specific object types.
For example, EXCLUDE=SCHEMA:”=’HR'”.

FLASHBACK_SCN
SCN used to reset session snapshot.

FLASHBACK_TIME
Time used to find the closest corresponding SCN value.

FULL
Import everything from source [YES].

HELP
Display help messages [NO].

INCLUDE
Include specific object types.
For example, INCLUDE=TABLE_DATA.

JOB_NAME
Name of import job to create.

KEEP_MASTER
Retain the master table after an import job that completes successfully [NO].

LOGFILE
Log file name [import.log].

LOGTIME
Specifies that messages displayed during import operations be timestamped.
Valid keyword values are: ALL, [NONE], LOGFILE and STATUS.

MASTER_ONLY
Import just the master table and then stop the job [NO].

METRICS
Report additional job information to the import log file [NO].

NETWORK_LINK
Name of remote database link to the source system.

NOLOGFILE
Do not write log file [NO].

PARALLEL
Change the number of active workers for current job.

PARFILE
Specify parameter file.

PARTITION_OPTIONS
Specify how partitions should be transformed.
Valid keywords are: DEPARTITION, MERGE and [NONE].

QUERY
Predicate clause used to import a subset of a table.
For example, QUERY=employees:”WHERE department_id > 10″.

REMAP_DATA
Specify a data conversion function.
For example, REMAP_DATA=EMP.EMPNO:REMAPPKG.EMPNO.

REMAP_DATAFILE
Redefine data file references in all DDL statements.

REMAP_SCHEMA
Objects from one schema are loaded into another schema.

REMAP_TABLE
Table names are remapped to another table.
For example, REMAP_TABLE=HR.EMPLOYEES:EMPS.

REMAP_TABLESPACE
Tablespace objects are remapped to another tablespace.

REUSE_DATAFILES
Tablespace will be initialized if it already exists [NO].

SCHEMAS
List of schemas to import.

SERVICE_NAME
Name of an active service and associated resource group to constrain Oracle RAC resources.

SKIP_UNUSABLE_INDEXES
Skip indexes that were set to the Index Unusable state.

SOURCE_EDITION
Edition to be used for extracting metadata.

SQLFILE
Write all the SQL DDL to a specified file.

STATUS
Frequency (secs) job status is to be monitored where
the default [0] will show new status when available.

STREAMS_CONFIGURATION
Enable the loading of Streams metadata [YES].

TABLE_EXISTS_ACTION
Action to take if imported object already exists.
Valid keywords are: APPEND, REPLACE, [SKIP] and TRUNCATE.

TABLES
Identifies a list of tables to import.
For example, TABLES=HR.EMPLOYEES,SH.SALES:SALES_1995.

TABLESPACES
Identifies a list of tablespaces to import.

TARGET_EDITION
Edition to be used for loading metadata.

TRANSFORM
Metadata transform to apply to applicable objects.
Valid keywords are: DISABLE_ARCHIVE_LOGGING, INMEMORY, INMEMORY_CLAUSE,
LOB_STORAGE, OID, PCTSPACE, SEGMENT_ATTRIBUTES, SEGMENT_CREATION,
STORAGE, and TABLE_COMPRESSION_CLAUSE.

TRANSPORTABLE
Options for choosing transportable data movement.
Valid keywords are: ALWAYS and [NEVER].
Only valid in NETWORK_LINK mode import operations.

TRANSPORT_DATAFILES
List of data files to be imported by transportable mode.

TRANSPORT_FULL_CHECK
Verify storage segments of all tables [NO].
Only valid in NETWORK_LINK mode import operations.

TRANSPORT_TABLESPACES
List of tablespaces from which metadata is loaded.
Only valid in NETWORK_LINK mode import operations.

VERSION
Version of objects to import.
Valid keywords are: [COMPATIBLE], LATEST, or any valid database version.
Only valid for NETWORK_LINK and SQLFILE.

VIEWS_AS_TABLES
Identifies one or more views to be imported as tables.
For example, VIEWS_AS_TABLES=HR.EMP_DETAILS_VIEW.
Note that in network import mode, a table name is appended
to the view name.


The following commands are valid while in interactive mode.
Note: abbreviations are allowed.

CONTINUE_CLIENT
Return to logging mode. Job will be restarted if idle.

EXIT_CLIENT
Quit client session and leave job running.

HELP
Summarize interactive commands.

KILL_JOB
Detach and delete job.

PARALLEL
Change the number of active workers for current job.

START_JOB
Start or resume current job.
Valid keywords are: SKIP_CURRENT.

STATUS
Frequency (secs) job status is to be monitored where
the default [0] will show new status when available.

STOP_JOB
Orderly shutdown of job execution and exits the client.
Valid keywords are: IMMEDIATE.

STOP_WORKER
Stops a hung or stuck worker.

TRACE
Set trace/debug flags for the current job.

Oracle Errors & their solutions.

Error

SQL> SELECT name FROM v$database;
SELECT name FROM v$database
                 *
ERROR at line 1:
ORA-01507: database not mounted

SQL> select * from global_name
  2  ;
select * from global_name
              *
ERROR at line 1:
ORA-01219: database or pluggable database not open: queries allowed on fixed
tables or views only

SQL> print dbname;
SP2-0552: Bind variable "DBNAME" not declared.

https://www.oratable.com/find-your-database-name-in-oracle/

Solution

Error

QL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-15000: command disallowed by current instance type

Error

SQL> CREATE OR REPLACE DIRECTORY datapump_dir AS '/tmp/rajesh';
CREATE OR REPLACE DIRECTORY datapump_dir AS '/tmp/rajesh'
*
ERROR at line 1:
ORA-01109: database not open

Solution

As the error states - the database is not open - it was previously shut down, and someone left it in the middle of the startup process. They may either be intentional, or unintentional (i.e., it was supposed to be open, but failed to do so).

Assuming that's nothing wrong with the database itself, you could open it with a simple statement:(Since the question is asked specifically in the context of SQLPlus, kindly remember to put a statement terminator(Semicolon) at the end mandatorily, otherwise, it will result in an error.)

ALTER DATABASE OPEN;

Error

QL> ALTER DATABASE OPEN;
ALTER DATABASE OPEN
*
ERROR at line 1:
ORA-15000: command disallowed by current instance type
\

Error

SQL> SELECT SERVICE_NAME, INSTANCE_NAME, STATUS FROM GV$SERVICENAMES WHERE INSTANCE_NAME='bbdc2';
SELECT SERVICE_NAME, INSTANCE_NAME, STATUS FROM GV$SERVICENAMES WHERE INSTANCE_NAME='bbdc2'
                                                *
ERROR at line 1:
ORA-01219: database or pluggable database not open: queries allowed on fixed
tables or views only

Solution

To resolve this error, you need to first open the database before querying the dynamic performance view. You can do this by connecting to the database using SQL*Plus as a user with SYSDBA privileges, and then executing the ALTER DATABASE OPEN command:

sql
Copy code
sqlplus / as sysdba
ALTER DATABASE OPEN;
Once the database is open, you can then execute the original query to get the service names:

SOME COMMANDS

To check what database we have in this cluster.
$ srvctl config database
$ srvctl status database -d bbdc
$ srvctl status database -d bbdc -n node-name1

Error

[oracle@tcb-oracle1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed May 3 14:58:58 2023
Version 19.16.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.

ERROR:
ORA-12547: TNS:lost contact


Enter user-name: ^C

Error

Version 19.16.0.0.0
[oracle@tcb-oracle1 ~]$ impdp \"/ as sysdba\" DIRECTORY=MY_DIR DUMPFILE=2022Sep27_exp_meta_a4m.dmp LOGFILE=importamlpoc.log

Import: Release 19.0.0.0.0 - Production on Thu May 4 00:56:07 2023
Version 19.16.0.0.0

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

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39002: invalid operation
ORA-39061: import mode FULL conflicts with export mode TRANSPORTABLE

Error


[oracle@tcb-oracle1 rajesh]$ impdp \"/ as sysdba\" DUMPFILE=2022Sep27_exp_meta_a4m.dmp DIRECTORY=MY_DIR  LOGFILE=importamlpoc.log TRANSPORTABLE=ALWAYS

Import: Release 19.0.0.0.0 - Production on Thu May 4 01:38:29 2023
Version 19.16.0.0.0

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

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39001: invalid argument value
ORA-39207: Value  ALWAYS is invalid for parameter TRANSPORTABLE.

Error

1 ORA-39112: Dependent object type REF_CONSTRAINT:"BAOBAB"."FK_CFG_DD_TELEBANK_CFG_INACTIV" skipped, base object type TABLE:"BAOBAB"."CFG_DD_TELEBANK" creation failed
      1 ORA-39112: Dependent object type REF_CONSTRAINT:"BAOBAB"."FK_CFG_DD_TELEBANK_CFG_PORT_IN" skipped, base object type TABLE:"BAOBAB"."CFG_DD_TELEBANK" creation failed
      1 ORA-39112: Dependent object type REF_CONSTRAINT:"BAOBAB"."FK_CFG_DD_TELEBANK_CFG_UNIT" skipped, base object type TABLE:"BAOBAB"."CFG_DD_TELEBANK" creation failed
      1 ORA-39112: Dependent object type REF_CONSTRAINT:"BAOBAB"."FK_CFG_DD_TELEBANK_CNS_CHANNEL" skipped, base object type TABLE:"BAOBAB"."CFG_DD_TELEBANK" creation failed
      1 ORA-39112: Dependent object type REF_CONSTRAINT:"BAOBAB"."FK_CFG_DD_TELEBANK_TER_COMMON" skipped, base object type TABLE:"BAOBAB"."CFG_DD_TELEBANK" creation failed
      1 ORA-39112: Dependent object type REF_CONSTRAINT:"BAOBAB"."FK_CFG_DD_VOICE_CFG_INACTIVITY" skipped, base object type TABLE:"BAOBAB"."CFG_DD_VOICE" creation failed
      1 ORA-39112: Dependent object type REF_CONSTRAINT:"BAOBAB"."FK_CFG_DD_VOICE_CFG_PORT" skipped, base object type TABLE:"BAOBAB"."CFG_DD_VOICE" creation failed

Error

oracle@tcb-oracle1 rajesh]$ grep "ORA-" importamlpoc.log | sort | uniq -c | cut -f1 -d "." | sort | uniq -c
      1    1098 ORA-01917: user or role 'BAO_READROLE' does not exist
      1      12 ORA-01917: user or role 'BAO_PADSSROLE' does not exist
      1      16 ORA-01917: user or role 'SRV_TWO_PDMS' does not exist
      1       1 ORA-01435: user does not exist
      1       1 ORA-01917: user or role 'NOTI_TEST' does not exist
      1       1 ORA-31625: Schema TWO_DS1 is needed to import this object, but is unaccessible
    254       1 ORA-39082: Object type TRIGGER:"BAOBAB"
      1       1 ORA-39083: Object type INDEX failed to create with error:
    108       1 ORA-39151: Table "BAOBAB"
      1      25 ORA-01917: user or role 'LOYALTWO' does not exist
      1       2 ORA-01917: user or role 'SRV_IAM_FIMI' does not exist
      1       2 ORA-01917: user or role 'SRV_IAM_TWO' does not exist
      1      30 ORA-01917: user or role 'TWA' does not exist
      1     318 ORA-01917: user or role 'BAO_SYSROLE' does not exist
      1     328 ORA-01917: user or role 'BAO_KEYROLE' does not exist
      1      37 ORA-01917: user or role 'SRV_GRAFANA_MONITOR' does not exist
      1      38 ORA-01917: user or role 'BAOLOGIN1' does not exist
      1      38 ORA-01917: user or role 'BAOLOGIN2' does not exist
      1    4353 ORA-01917: user or role 'BAO_WRITEROLE' does not exist
      1      45 ORA-01917: user or role 'BAO_CMDROLE' does not exist
      1      45 ORA-01917: user or role 'BAOLOGIN' does not exist
      1       5 ORA-01917: user or role 'SRV_TWO_CMREPORT' does not exist
      1    6540 ORA-39083: Object type OBJECT_GRANT failed to create with error:
      1      72 ORA-01917: user or role 'DWHTWO' does not exist
      1      75 ORA-01917: user or role 'TWO_DS1' does not exist