CARIS HPD : Database Administration : Exporting and Importing HPD Schemas (Oracle) : Import a Previously Exported Database Schema : Import an Oracle Dump File
 

Import an Oracle Dump File

Once the tablespace and HPD user account are created, the data in the previously exported dump file can be imported into the new database schema. Start a Command Prompt window, and run the Oracle Import data pump (impdp) utility.

The following parameters are passed to the import utility:

Connection string: Connection information for the previously exported HPD database schema being imported here, that is, system/password@database.

DUMPFILE: Name of the database export file created earlier by the export utility.

LOGFILE: Log file to be created to record messages generated during the import.

DIRECTORY: Name of the folder on the server computer storing the export file.

As with the export operation, an Oracle System Administrator user can query the DBA_DIRECTORIES view to list the available directories. Locate the name of the DATA_PUMP_DIR directory, and then check that the previously exported dump file is located there.

An import operation will look something like this – substitute the values of the HPD schema owner, database name, exported dump file name, and the import log file to create. Run the Import Data Pump (impdp) utility from a Windows Command Prompt:

> impdp system@database DUMPFILE=database_hpdowner_date.dmp

      LOGFILE=IMPDP-hpdowner-date.log DIRECTORY=DATA_PUMP_DIR

      SCHEMAS=hpdowner EXCLUDE=STATISTICS

D:\>impdp system@CARISDB DUMPFILE=CARISDB_hpd400_01May2019.dmp LOGFILE=impdp-hpd400-01May2019.log DIRECTORY=DATA_PUMP_DIR SCHEMAS=HPD400 EXCLUDE=STATISTICS

 

Import: Release 12.2.0.1.0 - Production on Wed May 1 20:47:00 2019

 

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Password: <System Password here>

 

Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01":  system/********@CARISDB DUMPFILE=CARISDB_hpd400_01May2019.dmp LOGFILE=impdp-hpd400-01May2019.log DIRECTORY=DATA_PUMP_DIR SCHEMAS=HPD400 EXCLUDE=STATISTICS
Processing object type SCHEMA_EXPORT/USER

                   ...program output messages appear here...

Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed at Wed May 1 21:21:17 2019 elapsed 0 00:05:21

If the output messages show any errors or warnings, take note as some could be resolved after the import process is completed (see later).

If for example, the import log shows problems recreating an Index, it would normally also provide the command that failed to execute. Most times you can create such indexes later on, using the command shown in the import log (minus the storage clauses) connected to a SQLPlus session as the HPD Schema Owner user account to recreate it.

Errors concerning Constraints, for example, about missing Parent Keys are more serious, as they might indicate there are missing rows on the related table. This can happen if there were updates being made by HPD users during the export process. If you receive this type of errors, one might have to recreate the export file.