Oracle Export and Import Utilities

2011. 2. 21. 10:05일 이야기

1. Export and Import Utility 가 하는 일
   - Historical Archive를 생성한다.
   - Table의 데이터와 구조를 Binary File로 저장한다.
   - Oracle의 다른버전으로 Migration 할 때 사용하면 좋다.
     - 갑작스런 drop or truncate로부터 복구를 목적으로 사용된다.
2. Export 사용법 (exp scott/tiger file=/backup/orabackup.dmp owner=scott)
   $ exp scott/tiger tables=(dept,emp) \
   > file=emp.dmp log=exp.log compress=n \
   > direct=y recordlength=32768
   
   [syntax]
   $ exp [keyword=]{value | (value, value ...)}
      [ [ [,] keyword=]{value | (value, value ...)} ] ...

Parameter   Description 
USERID   Username/password of schema objects to export 
FILE   Name of output file 
ROWS   Include table rows in export file: (Y)ex/(N)o 
FULL   Export entire database : (Y)es/(N)o 
OWNER   Users to export : Username 
TABLES   Tables to export : List of tables 
INDEXES   Indexes to export : (Y)es/(N)o 
DIRECT   Specify direct mode export : (Y)es/(N)o -- 좀더 빨리처리한다. 
INCTYPE   Type of export level 
PARFILE   Name of file in which parameters are specified. 
HELP   Display export parameters in interactive mode (Y) 
LOG   Name of file for informational and error messages 
CONSISTENT   Read-consistent view of the database when data is updated during an export : (Y)es/(N)o 
BUFFER   Size of the data buffer in bytes : (Integer) 
POINT_IN_TIME_RECOVER   Indicates whether or not the Export utility exports one or more tablespaces in an Oracle database
Refer to the Oracle Server Readme, Relaease 8.0.4 
RECOVERY_TABLESPACES   Specifies the tablespaces that will be recovered using point-in-time recovery 
Refer to the Oracle Server Readme, Release 8.0.4 
COMPRESS   Specified to include all data in one extent : (Y)es/(N)o 

3. Import 사용법 (imp scott/tiger file=/backup/orabackup.dmp full=y commit=y)
   $ imp scott/tiger tables=(dept, emp) \
   > file=emp.dmp log=imp.log ignore=y

Parameter   Description 
USERID   Username/passwordof schema objects to export 
FILE   Name of the input file. Must be a valid Export Utility file. 
ROWS   Include table rows in import file. 
IGNORE   Ignore create errors due to an object's existence. 
FULL   Import entire file. 
TABLES   Tables to import 
INDEXES   Indexes to import 
INCTYPE   Specifies the type of incremental import. Options are SYSTEM and RESTORE. 
PARFILE   Parameter specification file 
HELP   Display export parameters in interactive mode. 
LOG   File for informational and error messages 
DESTROY   Specifies whether or not the existing datafile making up the database should be reused. 
FROMUSER   A list of schemas containing objects to import 
TOUSERS   Specifies a list of usernames whose schemas will be imported. 
INDEXFILE   Specifies a file to receive index-creation commands. 
POINT_IN_TIME_RECOVER   Indicates whether or not Import recovers one or more tablespaces in an Oracle database to a 
prior point in time without affecting the rest of the database. 
Refer to the Oracle Server Readme, Release 8.0.4 

  ================================================ 
    * Oracle Community OracleClub.com 
    * http://www.oracleclub.com 
    * http://www.oramaster.net 
  ================================================