Documentation Center

Syntax for dbimport.pl

OSCommand
Windowsdbimport.pl -dbase dbname@ODBC_DSN -i “importdir/ file”
Linuxdbimport.pl -dbase dbname@SID -i “importdir/file”
  • Issue the command from any Contenta client workstation that has been installed with the administration tools.
  • The input from this command is a file created by the Syntax for dbexport.pl command, named dbname.dmp where dbname is the name of the database.

Oracle: The .dmp file may be located on the resident system, or on the Oracle server if dbexport.pl was run with the -datapump switch.

MSSQL:

  • The .dmp file must be located on the MSSQL database server. The value for the importdir argument is the full path from the database server location where the .dmp file is located.
  • You cannot import a database from another server (ODBC_DSN must be resident). If you exported from a different server, move the .dmp file to the MSSQL server for this environment.
SwitchDescription
-dbaseRequired: dbname

The name to apply to the Contenta database when imported. The new database name does not have to match the name of the Contenta database (file) that was exported.

Windows:

dbname@ODBC_DSN

—or—

Linux:

dbname@SID

Optional: ODBC_DSN (Windows)

The ODBC data source name. If not specified, the default is used—as defined in the registry for XYV_PDM_ODBC_DSN

Optional: SID (Linux)

The system identifier. If not specified, the default is used—as defined in the registry for XYE_PDM_DATABASE_SID

-i “importdir/file.dmp”Required
  • importdir is the complete path to the exported database which you want to import. Use quotes around importdir/file to ensure no errors.
  • file is the name of the dump (dbname.dmp) file. MSSQL: the filename extension .dmp is required.
-xyadminpwd xyadmin_pwdOptional if password is default, manager.

Required if password is not default; see Adding and Changing the Database Passwords.

This is the password for the Oracle or MSSQL database.

-pdmpwd db_passwdOptional if password is the default, pcmuser.

Required if password is not default; seeAdding and Changing the Database Passwords

This is the password for the Contenta database.

Oracle Only The following switches are Oracle database switches. If you are using an MSSQL database these switches are not available/not necessary.
-datapump -dir dumpdir -i dumpfile

—or—

-datapump -i dumpdir:dumpfile

—or—

-datapump -i dumpfile

[In the cases above, the dumpfile name matches the “XYdmp__dbname” that was output by dbexport.pl; in the cases below, the names do not match, so the source schema must be supplied via -src.]

—or—

-datapump -dir dumpdir -i dumpfile -src origsrcschema

—or—

-datapump -i dumpdir:dumpfile -src origsrcschema

—or—

-datapump -i dumpfile -src origsrcschema

Optional

The input dumpdir can be specified either with -dir or as a prefix to -i, but not both, otherwise it defaults to the value of the environment/registry variable XYV_PDM_DBDUMP_DIR if set, or “XY_DBDUMP_DIR” if not set.

The input dumpfile name is typically in the form output by dbexport.pl, beginning with “XY” and ending with “__dbname” (double underscore dbname, and extension “.dmp” need not be specified), in which case dbimport.pl extracts the source schema “dbname” from this dumpfile name. For example, to import a database that was exported by running dbexport.pl with -dbase aaa -o bbb.dmp, the dmp filename is XYBBB__AAA.dmp, and you would run dbimport.pl with -i XYbbb__aaa. If for some reason you have a dumpfile with a different name, you can specify the source schema explicitly with -src. Note: Examples of the most commonly used switch combinations, which are explained in the descriptions above, are in the left-hand column. Other combinations are also possible if the dumpfile is not specified, as described in the next paragraph.

If the dumpfile is not specified, dbimport.pl defaults to XYDB__dbname (double underscore dbname) and in this case dbname is either specified with -src or else it is the same as the -dbase dbname being imported to (in which case you are re-importing a dump from a database of the same name). There must be a colon (:) after dumpdir if it is specified without dumpfile; that is, it must be specified as follows: -i dumpdir:

-sid SID

(Windows)

Required if specifying a remote DSN.
Optional: SID

The system identifier. If not specified, the default is used — as defined in the environment for XYE_PDM_DATABASE_SID

-tblspace tblspacenameOptional

Where tblspacename is the name of the tablespace for application data.

Default: As defined in the variable XYV_PDM_TABLESPACE.

-tmptblspace tmptblspacenameOptional

Where tmptblspacename is the name of the temporary tablespace.

Default: As defined in the variable XYV_PDM_TMPTBLSPACE.

-indxtblspace indxtblspacenameOptional

Where indxtblspacename is the name of the index table space.

Default: As defined in the variable XYV_PDM_INDXTBLESPACE.

-usedbaroleUse if dbimport fails with the error:

IMP-00013: only a DBA can import a file exported by another DBA

Use to grant dba permissions to the XYADMIN database user using Oracle system and password specified with -systempwd (see below).

When the import is complete, the dba permissions are revoked. If used then -systempwd must be used.

-systempwd systempassword Where systempassword is the Oracle system user’s password.

Must be used if -usedbarole is used.