|
Oracle9i Enterprise Edition User's Guide
Release 2 (9.2.0.1.0) for OS/390 Part No. A97312-01 |
|
The Export and Import utilities are used to move Oracle database tables and other objects from one database to another. The databases can be on the same platform (for instance, both OS/390) or on different platforms.
The executables for Oracle Export and Import are named EXP and IMP. If you make these available to your TSO session by placing them in your STEPLIB, it disables the abbreviated forms of the native (IDCAMS) export and import commands, which are also EXP and IMP.
This chapter describes the function of each of these utilities as they relate to the OS/390 operating system and contains the following sections:
The information in this chapter supplements the documentation for the Oracle utilities in Oracle9i Database Utilities.
The Export (EXP) utility reads data from the Oracle9i database according to your request and writes an OS/390 sequential data set. Export is used to provide backups of the Oracle tables and database. It is also used to move data from one Oracle9i database to another.
The Export utility has additional functions for users with Oracle DBA authority. For example, to perform incremental or cumulative Exports, DBA authority is required. Refer to the Oracle9i Enterprise Edition System Administration Guide for OS/390 for a description of the Export utility for database administrators.
When running Export under USS, considerations are the same as described in the Oracle9i Database Utilities manual. Refer to Chapter 4, " Accessing Oracle9i Under USS", for general information about running utilities in the USS environment.
The syntax for running Export under TSO is:
EXP [userid[/password[@connect-string]]
where:
userid
|
is the Oracle user id. This parameter is optional. |
password
|
is the password associated with userid. This parameter is optional.
|
connect-string
|
is a tnsnames alias name or a complete Oracle Net address string. This parameter is optional if the Oracle database server is specified using methods described in Chapter 2. Refer to Chapter 9 for further details. |
The normal OS/390 EOF key sequence, /*, ends the Export utility from any prompt. The alias of EXP is ORAEXP.
Export is supported in the batch environment through the ORAEXP JCL procedure. The following is a copy of this procedure:
//ORAEXP PROC INDEX=oran, // LIBV=orav, // SYSOUT='SYSOUT=*', // USERID='NAME/PASSWORD' //ORAEXP EXEC PGM=EXP,REGION=4M, // PARM='&USERID' //STEPLIB DD DSN=&INDEX..&LIBV..CMDLOAD,DISP=SHR //ORA$LIB DD DSN=&INDEX..&LIBV..MESG,DISP=SHR //SYSOUT DD &SYSOUT,DCB=(LRECL=132,BLKSIZE=1320,RECFM=VB) //SYSERR DD SYSOUT=*,DCB=(LRECL=132,BLKSIZE=1320,RECFM=VB) //ORAPRINT DD SYSOUT=*
To run this JCL procedure, you must include additional DD statements that refer to other required data sets. The following example assumes the Oracle9i database server is installed with a system identification (SID) of ORA1:
//USER1JOB JOB ........ //STEP1 EXEC ORAEXP, // PARM='SCOTT/TIGER PARFILE=/DD/PARFILE' //ORA@ORA1 DD DUMMY //SYSIN DD DUMMY //EXPTFL DD DSN=userid.EXPDTFL.TEST, // DISP=(NEW,CATLG,DELETE), // VOL=SER=TEMP01,UNIT=SYSDA, // SPACE=(TRK,(5,5),RLSE), // DCB=(RECFM=FB,LRECL=4096,BLKSIZE=24576) //PARFILE DD * DIRECT=N BUFFER=10240 FILE=/DD/EXPTFL GRANTS=Y INDEXES=Y ROWS=Y CONSTRAINTS=Y COMPRESS=N FULL=N TABLES=(DEPT) /*
In this example, Oracle user SCOTT with password TIGER performs an Export of data from the database instance whose OSDI service SID ORA1. The Export parameters reside in PARFILE instream data. As an alternative, the Export responses can be included as SYSIN instream data.
To further illustrate, you can use Export in two ways:
Enter the command EXP user name and password PARFILE=filename with the remaining Export parameters contained in the specified file. This is the preferred method. If you use this method, then PARFILE cannot be a PDS member.
Enter the command EXP user name and password followed by various parameters that control how Export runs. You can use this method as long as the number of parameters does not exceed the maximum length of a command line on your system. The parameter redirection attribute ++ can be used to redirect parameters to the input file.
For more information on using Export, refer to Oracle9i Database Utilities.
Export issues the following return codes:
| 0 | is a normal (successful) completion. Review results carefully as a 0 return code can indicate an error not serious enough to terminate the utility, but invalidates the Export file. |
| 8 |
is an end due to an irrecoverable error. The error can be one of the following:
|
When exporting to non-OS/390 systems, ensure the data transfer process does not result in the translation of the Export file from EBCDIC to ASCII or from one EBCDIC character set to another. This translation, if necessary, is provided by the Import utility on the receiving system. If an external translation is performed, then Import ends with an irrecoverable error and you receive the following error message:
Seals don't match
You must also ensure Exports to other operating system environments are done on compatible media.
The Import (IMP) utility reads data from a sequential data set prepared by the Export utility and writes data into an Oracle9i database.
The Import utility has additional functions for users with Oracle DBA authority. Refer to the Oracle9i Enterprise Edition System Administration Guide for OS/390 for a description of Import with DBA authority.
When running Import under USS, considerations are the same as described in the Oracle9i Database Utilities manual. Refer to Chapter 4, " Accessing Oracle9i Under USS", for general information about running utilities in the USS environment.
The syntax for running the Import utility under TSO is:
IMP [userid[/password[@connect-string]]
where:
userid
|
is the Oracle user id. This parameter is optional. |
password
|
is the password associated with userid. This parameter is optional.
|
connect-string
|
is a tnsnames alias name or a complete Oracle Net address string. This parameter is optional if the Oracle database server is specified using methods described in Chapter 2. Refer to Chapter 9 for further details. |
Use the normal OS/390 EOF key sequence (/*) to end the Import utility from any prompt. The IMP alias is ORAIMP.
Import is supported in the batch environment through the ORAIMP JCL procedure. A copy of this procedure is:
//ORAIMP PROC INDEX=oran, // LIBV=orav, // SYSOUT='SYSOUT=*', // USERID='NAME/PASSWORD' //ORAIMP EXEC PGM=IMP,REGION=4M, // PARM='&USERID' //STEPLIB DD DSN=&INDEX..&LIBV..CMDLOAD,DISP=SHR //ORA$LIB DD DSN=&INDEX..&LIBV..MESG,DISP=SHR //SYSOUT DD &SYSOUT,DCB=(LRECL=132,BLKSIZE=1320,RECFM=VB) //SYSERR DD SYSOUT=*,DCB=(LRECL=132,BLKSIZE=1320,RECFM=VB) //ORAPRINT DD SYSOUT=*
The following JCL illustrates the use of the previous procedure:
//USER1JOB JOB ........ //STEP1 EXEC ORAIMP, // USERID=, // PARM='PARFILE=/DD/PARFILE' //ORA@ORA1 DD DUMMY //SYSIN DD DUMMY //EXPTFL DD DSN=userid.EXPDTFL.TEST,DISP=SHR //PARFILE DD * USERID=SCOTT/TIGER BUFFER=10240 FILE=/DD/EXPTFL SHOW=N IGNORE=N GRANTS=Y INDEXES=Y ROWS=Y FULL=Y COMMIT=Y /*
In this example, data is imported to the database instance whose OSDI service SID is ORA1. The Import parameters reside in PARFILE instream data. These responses can alternatively be specified as SYSIN instream data.
To further illustrate, you can use Import in two ways:
Enter the command IMP user name and password PARFILE=filename with the remaining Import parameters contained in the specified file. This is the preferred method. If you use this method, then PARFILE cannot be a PDS member.
Enter the command IMP user name and password followed by various parameters that control how Import runs. You can use this method as long as the number of parameters does not exceed the maximum length of a command line on your system. The parameter redirection attribute ++ can be used to redirect parameters to the input file.
For more information about Import, refer to Oracle9i Database Utilities.
Import provides one of the following return codes:
| 0 | is a normal (successful) completion. Review results carefully as a 0 return code can indicate an error not serious enough to end the utility, but invalidates the Import file. |
| 8 | is an end due to an irrecoverable error. The Import log file contains an error message describing the error. |
When importing from non-OS/390 systems, ensure your data transfer process does not translate the Export file from ASCII to EBCDIC. This translation, if needed, is provided by the Import utility on the OS/390 system. If an external translation is performed, then Import ends with an irrecoverable error and you receive the following error message:
Seals don't match
You must also ensure Exports done for eventual Import to OS/390 environments are done on compatible media.
|
Note: Importing partitioned tables that are partitioned on character values into an OS/390 table might not be possible if they were exported from an ASCII database. The same is true for importing into an ASCII database after exporting from OS/390. If this is required, then use conventional path export and create the table before importing. |
|
![]() Copyright © 2002 Oracle Corporation All rights reserved |
|