02.Oracle/DataBase2008. 7. 7. 17:25
반응형
여기서는 full=y를 사용했을 경우만 생각해본다.
이는 DBA권한을 가진 사람이 모든 데이터베이스에 대해 백업을 실시할 때 사용한다.
full옵션을 사용할 수 있으려면 정확히 EXP_FULL_DATABASE 권한을 가져야한다.
export유틸리티를 사용하기 위해 catexp.sql이라는 유틸리티스크립트를 실행해야 하는데
이것은 catalog.sql이 실행되면서 부수적으로 실행되므로 그리 신경쓸 필요는 없다.

export는 논리적인 백업으로 완벽한 복구에 사용되기에는 무리이다.
많은(아주 많은 것 같다.) 사이트들이 백업수단으로 export를 사용하는 것 같다.
사용하기 쉬운 것과 짧은 시간에 할 수 있다는 것이 그 이유가 아닌가 생각된다.
개인적인 생각에는 export의 경우, 각 schema에 대한 백업수단(export시 owner옵션을 사용한 백업)으로서만
사용하는 것이 좋을것 같다.

full=y를 사용할 경우 inctype으로 complete, cumulative, incremental 3가지가 사용될 수 있다.
complete는 무조건 전체 데이터베이스를 백업.
cumulative는 complete이후 변경된 데이블에 대해서만 백업
incremental는 위 2가지 백업뒤 변경된 놈들에 대해 백업

cumulative는 incremental로 생성되는 파일수를 줄여주는 역활을 한다.
즉, 이전에 incremental백업을 2번한 상황에서 comulative백업을 하면 이전의 2개의 incremental백업은
cumulative백업으로 커버가 된다. 즉, 이전 2개의 incremental백업은 복구시 필요치 않고, cumulative백업
하나만 있으면 되는 것이다.

2주일간의 백업정책을 세운다면,
처음 complete백업을 받는다.
일별로 incremental백업을 받는다.
하지만, 수요일, 일요일은 incremental백업대신 cumulative백업을 한다.
2주가 되는 일요일에 complete백업을 한다.

복구의 순서는,
가장 최근의 complete백업한 것을 resotre한다.
가장 최근의 complete백업후에 발생한 cumulative백업들을 restore한다.
(cumulative백업이 없다면 incremental백업으로 대체)
위에서 행한 cumulative백업들중 가장 최근의 cumulative백업후의 incremental백업들을
가장 오래된 것부터 차례로 restore한다.

정리하면,
complete의 경우 주말에 한번 정도
incremental의 경우 날마다
cumulative의 경우 주중에 한번(수요일정도)

오라클이 complete백업후의 변동된 사항을 어떻게 알수 있을까?
당연히 내부적인 테이블에 이런 정보를 저장하고 있다.
언제 complete, cumulative백업들이 발생했는가등등.. 문서하단에 자세히 설명하겠다.

[kang@piruks kang]$ exp userid=system/xxxxxx full=y inctype=complete

Export: Release 8.1.6.1.0 - Production on Thu Nov 2 15:35:28 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Export done in UTF8 character set and KO16KSC5601 NCHAR character set

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. . exporting table                    DEF$_AQCALL          0 rows exported
. . exporting table                   DEF$_AQERROR          0 rows exported
. . exporting table                  DEF$_CALLDEST          0 rows exported
. . exporting table               DEF$_DEFAULTDEST          0 rows exported
. . exporting table               DEF$_DESTINATION          0 rows exported
. . exporting table                     DEF$_ERROR          0 rows exported
. . exporting table                       DEF$_LOB          0 rows exported
. . exporting table                    DEF$_ORIGIN          0 rows exported
. . exporting table                DEF$_PROPAGATOR          0 rows exported
. . exporting table       DEF$_PUSHED_TRANSACTIONS          0 rows exported
. . exporting table                  DEF$_TEMP$LOB          0 rows exported
. . exporting table                           HELP        816 rows exported
. . exporting table        SQLPLUS_PRODUCT_PROFILE          0 rows exported
. about to export OUTLN's tables via Conventional Path ...
. . exporting table                            OL$          0 rows exported
. . exporting table                       OL$HINTS          0 rows exported
. about to export DBSNMP's tables via Conventional Path ...
. about to export TRACESVR's tables via Conventional Path ...
. about to export KANG's tables via Conventional Path ...
. . exporting table                           TEST          1 rows exported
. exporting referential integrity constraints
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting triggers
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting user history table
. exporting default and system auditing options
. exporting statistics
Export terminated successfully without warnings.

[kang@piruks kang]$ ls -l
total 155
-rw-rw-r--    1 kang     kang       155648 11월  2 15:37 expdat.dmp
drwxrwxr-x    4 kang     kang         1024 10월 27 13:02 public_html/
drwxrwxr-x    2 kang     kang         1024 10월 15 12:54 test/

complete로 백업후 바로 cumulative로 다시 실행해 봤다.
역시 변경사항이 없으니 .. 별 일은 하지 않는것 같다.
백업받을 파일을 지정하지 않으면 complete로 백업받은 파일을 덮어쓰니까
다른 곳으로 미리 옮겨놓는 것이 좋을 것 같다.

[kang@piruks kang]$ exp userid=system/xxxxxx full=y inctype=cumulative

Export: Release 8.1.6.1.0 - Production on Thu Nov 2 15:39:22 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Export done in UTF8 character set and KO16KSC5601 NCHAR character set

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. about to export OUTLN's tables via Conventional Path ...
. about to export DBSNMP's tables via Conventional Path ...
. about to export TRACESVR's tables via Conventional Path ...
. about to export KANG's tables via Conventional Path ...
. exporting referential integrity constraints
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting triggers
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting user history table
. exporting default and system auditing options
. exporting information about dropped objects
. exporting statistics
Export terminated successfully without warnings.

파일의 크기가 줄었다.
[kang@piruks kang]$ ls -l                                              
total 27
-rw-rw-r--    1 kang     kang        24576 11월  2 15:42 expdat.dmp
drwxrwxr-x    4 kang     kang         1024 10월 27 13:02 public_html/
drwxrwxr-x    2 kang     kang         1024 10월 15 12:54 test/

역시 아무런 변경없이 incremental로 다시 실행해봤다.
생각한대로 별 일은 하지 않는다. 파일크기도 cumulative와 같았다.

[kang@piruks kang]$ exp userid=system/xxxxxx full=y inctype=incremental

Export: Release 8.1.6.1.0 - Production on Thu Nov 2 15:40:29 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Export done in UTF8 character set and KO16KSC5601 NCHAR character set

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. about to export OUTLN's tables via Conventional Path ...
. about to export DBSNMP's tables via Conventional Path ...
. about to export TRACESVR's tables via Conventional Path ...
. about to export KANG's tables via Conventional Path ...
. exporting referential integrity constraints
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting triggers
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting user history table
. exporting default and system auditing options
. exporting information about dropped objects
. exporting statistics
Export terminated successfully without warnings.

[kang@piruks kang]$ ls -l                                               
total 27
-rw-rw-r--    1 kang     kang        24576 11월  2 15:43 expdat.dmp
drwxrwxr-x    4 kang     kang         1024 10월 27 13:02 public_html/
drwxrwxr-x    2 kang     kang         1024 10월 15 12:54 test/


음.. 데이터를 하나 넣어보고 다시 해보자
[kang@piruks kang]$ sqlplus kang/xxxxxx                             

SQL*Plus: Release 8.1.6.0.0 - Production on Thu Nov 2 15:46:34 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to:
Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production

SQL> insert into test values ('하하하', 29);

1 row created.

SQL> exit
Disconnected from Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production

incremental로 다시 백업
물론 변경사항이 있으니 뭔가 할 거다.
test테이블에 대해 2개의 row를 백업받았다.
export는 row단위로 백업하는 것이 아니기때문에 이는 test라는 테이블전체를 백업받은 것이다.
다시 한번 말하는데 export는 변경된
테이블에 대해 백업을 실시한다.
[kang@piruks kang]$ exp userid=system/xxxxxx full=y inctype=incremental

Export: Release 8.1.6.1.0 - Production on Thu Nov 2 15:48:11 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Export done in UTF8 character set and KO16KSC5601 NCHAR character set

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. about to export OUTLN's tables via Conventional Path ...
. about to export DBSNMP's tables via Conventional Path ...
. about to export TRACESVR's tables via Conventional Path ...
. about to export KANG's tables via Conventional Path ...
. . exporting table                           TEST          2 rows exported
. exporting referential integrity constraints
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting triggers
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting user history table
. exporting default and system auditing options
. exporting information about dropped objects
. exporting statistics
Export terminated successfully without warnings.
[kang@piruks kang]$ ls -l
total 27
-rw-rw-r--    1 kang     kang        24576 11월  2 15:48 expdat.dmp
drwxrwxr-x    4 kang     kang         1024 10월 27 13:02 public_html/
drwxrwxr-x    2 kang     kang         1024 10월 15 12:54 test/

이번에는 좀더 데이터를 많이 집어넣어 보자
[kang@piruks kang]$ sqlplus kang/xxxxxx

SQL*Plus: Release 8.1.6.0.0 - Production on Thu Nov 2 15:49:16 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to:
Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production

SQL> insert into test values ('&a', 30);
Enter value for a: 슈퍼맨
old   1: insert into test values ('&a', 30)
new   1: insert into test values ('슈퍼?, 30)

1 row created.

SQL> /
Enter value for a: 배트맨
old   1: insert into test values ('&a', 30)
new   1: insert into test values ('배트?, 30)

1 row created.

SQL> /
Enter value for a: vicman
old   1: insert into test values ('&a', 30)
new   1: insert into test values ('vicman', 30)

1 row created.

SQL> quit
Disconnected from Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
[kang@piruks kang]$ exp userid=system/xxxxxx full=y inctype=incremental

Export: Release 8.1.6.1.0 - Production on Thu Nov 2 15:50:24 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Export done in UTF8 character set and KO16KSC5601 NCHAR character set

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. about to export OUTLN's tables via Conventional Path ...
. about to export DBSNMP's tables via Conventional Path ...
. about to export TRACESVR's tables via Conventional Path ...
. about to export KANG's tables via Conventional Path ...
. . exporting table                           TEST          5 rows exported
. exporting referential integrity constraints
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting triggers
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting user history table
. exporting default and system auditing options
. exporting information about dropped objects
. exporting statistics
Export terminated successfully without warnings.

입력한 데이터가 별로 되지 않아 백업파일의 크기에 영향이 없다. 쩝..
[kang@piruks kang]$ ls -l
total 28
-rw-r--r--    1 kang     kang            5 11월  2 15:51 HantermLog.GDPo9B
-rw-rw-r--    1 kang     kang        24576 11월  2 15:50 expdat.dmp
drwxrwxr-x    4 kang     kang         1024 10월 27 13:02 public_html/
drwxrwxr-x    2 kang     kang         1024 10월 15 12:54 test/

incremental과 cumulative의 차이점이라고 발견할 수 있는 것은 한가지다.
cumulative가 incremental로 백업받은 것을 다시 백업할 수 있지만,
incremental백업은 cumulative로 백업받은 것을 다시 백업할 수 없다는 것이다.
음.. 중요한 사실인가? 밑에 cumulative와 incremental의 예를 보면 알 수 있을 것이다.

[kang@piruks kang]$ exp userid=system/xxxxxx full=y inctype=cumulative

Export: Release 8.1.6.1.0 - Production on Thu Nov 2 15:51:48 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Export done in UTF8 character set and KO16KSC5601 NCHAR character set

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. about to export OUTLN's tables via Conventional Path ...
. about to export DBSNMP's tables via Conventional Path ...
. about to export TRACESVR's tables via Conventional Path ...
. about to export KANG's tables via Conventional Path ...
. . exporting table                           TEST          5 rows exported
. exporting referential integrity constraints
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting triggers
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting user history table
. exporting default and system auditing options
. exporting information about dropped objects
. exporting statistics
Export terminated successfully without warnings.

cumulative백업후 데이터베이스에 아무런 변경없는 상태에서 incremental백업은 무의미하다.
즉 cumulative가 받은 백업데이터를 백업하지 못한다.

[kang@piruks kang]$ exp userid=system/xxxxxx full=y inctype=incremental

Export: Release 8.1.6.1.0 - Production on Thu Nov 2 15:52:05 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Export done in UTF8 character set and KO16KSC5601 NCHAR character set

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. about to export OUTLN's tables via Conventional Path ...
. about to export DBSNMP's tables via Conventional Path ...
. about to export TRACESVR's tables via Conventional Path ...
. about to export KANG's tables via Conventional Path ...
. exporting referential integrity constraints
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting triggers
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting user history table
. exporting default and system auditing options
. exporting information about dropped objects
. exporting statistics
Export terminated successfully without warnings.




일반사용자는 데이터베이스 full백업이 불가능하다.
[kang@piruks kang]$ exp userid=kang/xxxxxx full=y inctype=incremental

Export: Release 8.1.6.1.0 - Production on Thu Nov 2 15:43:53 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
EXP-00023: must be a DBA to do Full Database export
(2)U(sers), or (3)T(ables): (2)U >

EXP-00022: must be SYS or SYSTEM to do incremental export
EXP-00000: Export terminated unsuccessfully
[kang@piruks kang]$


full패러미터사용시 tables와 owner패러미터는 사용하지 못한다.
[kang@piruks kang]$ exp userid=system/xxxxxx full=y inctype=complete tables=kang.test

Export: Release 8.1.6.1.0 - Production on Thu Nov 2 15:45:55 2000

(c) Copyright 1999 Oracle Corporation.  All rights reserved.


Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
EXP-00026: conflicting modes specified
EXP-00000: Export terminated unsuccessfully
[kang@piruks kang]$


incexp, incfil, incvid
sys계정에 보면, incexp, incfil, incvid테이블이 있다.
보통의 owner, table백업으로는 이 테이블들이 채워지지 않는다.
cumulative, incremental을 해야 이 놈들의  테이블이 채워진다.
백업을 하면 백업기록을 남겨야 incremental backup을 할 수 있는데 이 놈들이다.

incexp: export된 스키마들의 정보를 가짐(보통 무지하게 row가 많다)
incfil: incremental backup이 된 export파일들
incvid: 다음 export id를 가짐(즉, 지금 한게 id가 1이라면 다음은 2가 된다.)

exp userid=system/xxxx file=fullexp.dmp full=y inctype=complete
exp userid=system/xxxx file=cumexp.dmp full=y inctype=cumulative
exp userid=sys/xxxx file=incexp.dmp full=y inctype=incremental

이렇게 2번을 하고, DB 에서 조회

SQL> select * from incfil;

     EXPID EXPTYPE  EXPFILE                        EXPDATE   EXPUSER
---------- -------- ------------------------------ --------- ------------------------------
         1 X        fullexp.dmp                    12-JAN-01 SYSTEM
         2 C        cumexp.dmp                     12-JAN-01 SYSTEM
         3 I        incexp.dmp                     12-JAN-01 SYS

SQL> select * from incvid;

     EXPID
----------
         3


SQL> select * from incexp where rownum<5;

    OWNER# NAME                      TYPE# CTIME     ITIME          EXPID
---------- -------------------- ---------- --------- --------- ----------
         5 DEF$_AQCALL                   2 12-JAN-01 12-JAN-01          1
         5 DEF$_AQERROR                  2 12-JAN-01 12-JAN-01          1
         5 DEF$_CALLDEST                 2 12-JAN-01 12-JAN-01          1
         5 DEF$_DEFAULTDEST              2 12-JAN-01 12-JAN-01          1



------------------------------------------------------------------------------------------------

[엑스포트(Export)]

 

Export 유틸리티의 명령행 모드를 사용하여 데이터베이스 데이터를 운영 체제 파일로 복사할 수 있습니다. 이 파일은 Import 유틸리티에서만 읽을 수 있습니다.

예제

행을 포함하여 scott의 스키마에 속한 emp 및 dept 테이블을 포함하는 expincr1.dmp 엑스포트 파일을 생성합니다.

$ exp scott/tiger tables=(emp,dept) rows=y file=expincr1.dmp

행을 포함하여 scott의 스키마에 속한 모든 객체를 포함하도록 expdat.dmp라는 빠른 엑스포트 파일을 생성합니다.

$ exp system/manager owner=SCOTT DIRECT=Y

ts_emp 테이블스페이스에 속한 모든 객체의 정의를 포함하는 expdat.dmp 엑스포트 파일을 생성하고 ts_emp.log 로그 파일을 생성합니다.

$ exp system/manager TRANSPORT_TABLESPACE=y TABLESPACES=(ts_emp) LOG=ts_emp.log

마지막 누적 또는 완전 엑스포트 이후 데이터베이스에서 수정된 모든 정의 및 데이터를 포함하는 expcum1.dmp 엑스포트 파일을 생성합니다.

$ exp system/manager FULL=y INCTYPE=cumulative FILE=expcum1.dmp

참고: 명령행 모드 옵션은 대화식 모드 옵션과 유사합니다.

 

엑스포트 매개변수

매개변수

설명

USERID

엑스포트할 스키마 객체의 사용자 이름/암호

FILE

출력 파일 이름

ROWS

엑스포트 파일에 테이블 행을 포함시킬 것인지 여부: (Y)es/(N)o

FULL

전체 데이터베이스를 엑스포트할 것인지 여부: (Y)es/(N)o

OWNER

엑스포트할 사용자: 사용자 이름

TABLES

엑스포트할 테이블: 테이블 목록

INDEXES

인덱스를 엑스포트할 것인지 여부: (Y)es/(N)o

DIRECT

직접 모드 엑스포트 지정 여부: (Y)es/(N)o

INCTYPE

엑스포트 레벨 유형

PARFILE

매개변수가 지정된 파일 이름

HELP

대화식 모드에서 엑스포트 매개변수 표시(Y)

LOG

정보 및 오류 메시지용 파일 이름

CONSISTENT

엑스포트 중에 데이터가 갱신될 경우 데이터베이스의 읽기 일관성 뷰를 제공할 것인지 여부: (Y)es/(N)o

BUFFER

데이터 버퍼 크기(바이트): (정수)

TRANSPORT_TABLESPACE

이동 가능한 테이블스페이스 메타 데이터의 엑스포트 설정(릴리스 8.1 전용)

TABLESPACES

이동할 테이블스페이스(릴리스 8.1 전용)

POINT_IN_TIME_RECOVER

Export 유틸리티가 Oracle 데이터베이스에 있는 하나 이상의 테이블스페이스를 엑스포트할지 여부 표시(릴리스 8.0 전용)

RECOVERY_TABLESPACES

포인트 인 타임 복구를 사용하여 복구할 테이블스페이스 지정(릴리스 8.0 전용)
Oracle Server Readme, Release 8.0.4 참조

COMPRESS

하나의 확장 영역에 모든 데이터를 포함시킬지 여부 지정: (Y)es/(N)o

참고: 위에 나열한 매개변수는 모든 Export 유틸리티 매개변수의 전체 목록이 아니며 DBA가 복원을 위해 자주 사용하는 매개변수입니다

 

 

[임포트(import)]

 

expincr1.dmp 엑스포트 파일을 사용하여 행을 포함해 emp 및 dept 테이블을 scott 스키마로 임포트합니다.

$ imp scott/tiger tables=(emp,dept) rows=y file=expincr1.dmp

expincr1.dmp 엑스포트 파일을 사용하여 행을 포함해 Scott 스키마에 속한 모든 객체를 임포트합니다.

$ imp system/manager FROMUSER=scott file=expincr1.dmp

expdat.dmp 엑스포트 파일을 사용하여 ts_emp 테이블스페이스에 속한 모든 객체의 정의를 임포트합니다.

$ imp system/manager TRANSPORT_TABLESPACE=y TABLESPACES=ts_emp

참고: 명령행 모드 옵션은 대화식 모드 옵션과 유사합니다.

 

임포트 매개변수

매개변수

설명

USERID

임포트할 스키마 객체의 사용자 이름/암호

FILE

입력 파일의 이름. 유효한 Export 유틸리티 파일이어야 합니다.

ROWS

임포트 파일에 테이블 행을 포함시킬지 여부

IGNORE

해당 객체가 존재할 경우 생성 오류 무시

FULL

전체 파일 임포트

TABLES

임포트할 테이블

INDEXES

인덱스를 임포트할 것인지 여부

INCTYPE

증분 임포트 유형 지정. SYSTEM 및 RESTORE 옵션이 있습니다.

PARFILE

매개변수 사양 파일

HELP

대화식 모드에서 엑스포트 매개변수 표시

LOG

정보 및 오류 메시지용 파일

DESTROY

데이터베이스를 구성하는 기존 데이터 파일을 재사용해야 할지 여부 지정

FROMUSER

임포트할 객체를 포함하는 스키마 목록

TOUSER

임포트할 스키마를 소유한 사용자 이름 목록 지정

INDEXFILE

인덱스 생성 명령을 받을 파일 지정

TRANSPORT_TABLESPACE

엑스포트 파일에 있는 이동 가능한 테이블스페이스 메타 데이터를 Import 유틸리티가 임포트하도록 명령

TABLESPACES

데이터베이스로 이동할 테이블스페이스 목록

DATAFILES

데이터베이스로 이동할 데이터 파일 목록

TTS_OWNERS

이동 가능한 테이블스페이스 집합에 있는 데이터를 소유한 사용자 목록

POINT_IN_TIME_RECOVER

Import 유틸리티가 나머지 데이터베이스에 영향을 주지 않고 Oracle 데이터베이스에 있는 하나 이상의 테이블스페이스를 이전 시점으로 복구할지 여부 표시(릴리스 8.0 전용)

참고: 위에 나열한 매개변수는 모든 Import 유틸리티 매개변수의 전체 목록이 아니며 DBA가 복원 작업을 위해 자주 사용하는 매개변수입니다.

Posted by 1010