Export(exp, expdp)

export (exp, expdp) Ŭ DB ̿ ̺ ü ̵ϴ ϴ , ͽƮ ϸ õ ü(̺, ε, ) ǰ, ͵ ͽƮ Ϸ ȴ.
ͽƮ ̳ʸ ͷ Ϸ ۼǸ, import (imp, impdp) Ͽ ͸ о ִ. Ʈ ƿƼ ʰ ͽƮ ǥϷ imp scott/tiger file=expdat.dmp show=Yó SHOW Ű ϸ ȴ.

ͽƮ ϱ ۾ Ǿ Ѵ.
1) catexp.sql Ǵ catalog.sql ũƮ Ѵ. ũƮ ͽƮ ϱ غ۾ ϴ ũƮ̴.

• ʿ ͽƮ

• ʿ ѵ EXP_FULL_DATABASE ѿ ο

• EXP_FULL_DATABASE DBA ѿ ο

• ġ catexp.sql

2) ͽƮ ũ ȮѴ. ʿ ִ ũ USER_SEGMENTS 並 Ͽ Ȯ ִ.

	SQL> select sum(bytes) from user_segments
	  2         where segment_type='TABLE';
 
	SUM(BYTES)
	----------
	     65536
 
	SQL> 
3) ͽƮ ִ ȮѴ. ͽƮ ϱ ؼ CREATE SESSION EXP_FULL_DATABASE ־ Ѵ.
(user_role_privs user_sys_privs 信 ڿ ־ Ѱ ִ.)

ýۿ غǾ ִ dba_roles ȮѴ.


ͽƮ ϱ

ͽƮ ϴ ϴ.
1) ࿡ ϱ

	EXP Ű= Ǵ Ű=(1,2,...)
2) ͷƼ 忡 ϱ
OEM(oracle engterprise manager) Export Wizard ϴ Էµ ɾ Ѵ.

Է
exp username/password@instance as sysdbaͽƮ
exp username/password@instanceͽƮ
exp username/password as sysdbaͽƮ
exp username/passwordͽƮ
exp username@instance as sysdbapasswordԷ Ʈ
exp username@instancepasswordԷ Ʈ
exp usernamepasswordԷ Ʈ
exp username as sysdbapassword Է Ʈ
exp / as sysdbapassword Ȯξ
exp /password Ȯξ
exp /@instance as sysdbapassword Ȯξ
exp /@instancepassword Ȯξ

3) Ű Ͽ ϱ
ͽƮ õ Ű Ͽ ϰ Ͽ ϴ Ѵ. Ű Ȯڴ .dat̴.

	exp PARFILE≠
	exp username/password PARFILE≠
Ű ϳó ۼ ִ.
	PARAMETER=value
	PARAMETER=(value)
	PARAMETER=(value1,value2,...)

 Export ƿƼ   ִ Ű̴.
Űǹ
USERID/PASSWORD   id ȣ Է
BUFFER OS ͸ о ũ, 0̸ ѹ 1྿
FILE expdat.dmp ü ϸ
GRANTS Y ü role privilege
INDEXS Y ̺ ε Բ
ROWS Y ̺
CONSTRAINTS Y ̺ ǵ Ͽ
COMPRESS Y ü ͽƮ ϳ ͽƮ
, 50K¥ 3 segment exportϸ IMPORT 150k¥ ϳ segment Ҵ
׷ N ϰ Ǹ, SEGMENT ũ ϰ 50K¥ 3 ״
FULL N ͺ̽ ü ͸
Y ü DB EXPORT EXP_FULL_DATABASE (role)
TRANSPORT_TABLESPACE Y ͺ̽ tablespace ̵ų
OWNER Y ü ϰ ִ ID
TABLES   TABLE mode EXPORT schema.TABLE
TABLES=(scott.emp,system.dept)
COMPLETE   ̺
INCREMENTAL   ֱٿ (complete,cumulative,incremental) ̺
RECORD   SYS.INVID, SYS.INCEXP ̺ INCREMENTAL ͽƮ Ѵ.
HELP   Export ɼ
LOG   α Ϸ
CONSISTENT N ̺ ǰ ִٸ
STATISTICS   ü Ͽ Բ
compute   ̺
estimate   ̺ Ϻ
NONE  
DIRECT N Y export DIRECT PATH
N export CONVENTIONAL PATH
FEEDBACK (ǥþ) ǵ Ǹ . ǥø
RECORDLENGTH O/S record ũ, ũ ۿ buffer ũ⸦
PARLOG N export parameter list ϰ ִ parameter log ̸ ϸ parameter

Ŭ 10g ʹ expdp ƿƼ Ͽ data pump export ֵ Ͽ.

keyword
• FULL=Y, OWNER=user, TABLES=schema.table Ķʹ export mode ϴ parameterν Բ . , export full,table,owner Ķʹ ÿ .
• parameter ϸ鼭 exportϴ parameter LOG Ͽ .
• CONSISTENT=Y ͸ export ؾ Ѵ. ̺ ū , ROLLBACK SEGMENT ؼ snapshot ؾ ϹǷ ϵȴ.
• export ̺ Ǿ ʴ data block COMPRESS=Y ɼ ʴ . COMPRESS=Y ɼ object Ҵ EXTENT ũ INITIAL EXTENT ϱ ׷ object ʿϰ Ҵϰ ȴ.
• DIRECT PATH ϸ ȴ.


ͽƮ

ͽƮ ǥ 4 ͽƮ 尡 ִ.
ڴ ̺ 带 ְ, EXP_FULL_DATABASE ڴ 4 带 ִ.
export ϴ ͺ̽ ü, ̺̽ , , ̺ 4 尡 ִ.

ͺ̽ ü • ü ͺ̽ export 쿡
• ͺ̽ object߿ SYS SCHEMA object export
• database mode exportϷ exp_full_database ־
̺̽ ̺̽ ̺, ̺ , ε, ̺ , Ʈ, ŬƮ, ó, , ν, ó봽, , , , audit
• export 쿡
• ڽ object export
• exp_full_database ο ڴ ٸ ̺ export
̺ • ̺ export 쿡
• ̺ Meta data , data dictionary export
• ڽ ̺ export ̺ ɷ ִ constraint privilege exportȴ.
• ɼ(ROWs) ̺ row ԽŰų ִ.
• exp_full_database ο ڴ ٸ ̺ export

忡 ͽƮ Ʈ ִ ü .
ü
̺üDB̺̽
analyze table/statistics0000
auditing information000 
B*tree,bitmap,
domain functional indexes
0000
database links 00 
default roles  0 
dictionary aliases  0 
object grants0000
password history  0 
private synonym 00 
profiles  0 
public synonym  0 
referential integrity constraints000 
role grants  0 
roles  0 
rollback segment identifiers  0 
sequence numbers 00 
system privilege grants  0 
table constraint
(primary,check,unique)
0000
table data000 

忡 ִ ü ϸ .
ͺ̽ ü • ̺
• ε
• ̺
• Ʈ
• ŬƮ


• ν
• ó

• /
• (audit)
̺̽ • ̺̽ ̺
• ̺
• ε
• ̺
• Ʈ
• ŬƮ


• ν
• ó

• /
• (audit)
ڸ • ̺
• ̺

• ε
• ̺
• ̺ Ʈ
• ŬƮ
• ͺ̽ ũ

• ν
• ó

̺ • ̺
• ̺

• ε
• ̺
• Ʈ

Ŭ 10g ʹ expdp ƿƼ Ͽ  data pump export  ֵ Ͽ. 
  
$ exp userid=scott/password full=y  user mode export 
$ exp scott/password FILE=exp_scott_dept.dmp LOG=exp_scott_dept.log TABLES=dept  table mode export 
$ exp userid=SCOTT/password TABLES=(SCOTT.DEPT,SCOTT.EMP)  scott Ư ü
$ exp userid=SYSTEM/password FULL=Y     ü(Database Mode)
$ exp userid=SYSTEM/password TRANSPORT_TABLESPACE=Y  ٸ ̺̽   ̵
$ exp userid=SYSTEM/password tablespace='USERS'  Tablespace Mode
$ exp userid=SYSTEM/password OWNER=SCOTT  scott ü


$ exp help=Y

Export: Release 11.1.0.6.0 - Production on Wed Jun 10 12:47:02 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.



You can let Export prompt you for parameters by entering the EXP
command followed by your username/password:

     Example: EXP SCOTT/TIGER

Or, you can control how Export runs by entering the EXP command followed
by various arguments. To specify parameters, you use keywords:

     Format:  EXP KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
     Example: EXP SCOTT/TIGER GRANTS=Y TABLES=(EMP,DEPT,MGR)
               or TABLES=(T1:P1,T1:P2), if T1 is partitioned table

USERID must be the first parameter on the command line.

Keyword    Description (Default)      Keyword      Description (Default)
--------------------------------------------------------------------------
USERID     username/password          FULL         export entire file (N)
BUFFER     size of data buffer        OWNER        list of owner usernames
FILE       output files (EXPDAT.DMP)  TABLES       list of table names
COMPRESS   import into one extent (Y) RECORDLENGTH length of IO record
GRANTS     export grants (Y)          INCTYPE      incremental export type
INDEXES    export indexes (Y)         RECORD       track incr. export (Y)
DIRECT     direct path (N)            TRIGGERS     export triggers (Y)
LOG        log file of screen output  STATISTICS   analyze objects (ESTIMATE)
ROWS       export data rows (Y)       PARFILE      parameter filename
CONSISTENT cross-table consistency(N) CONSTRAINTS  export constraints (Y)

OBJECT_CONSISTENT    transaction set to read only during object export (N)
FEEDBACK             display progress every x rows (0)
FILESIZE             maximum size of each dump file
FLASHBACK_SCN        SCN used to set session snapshot back to
FLASHBACK_TIME       time used to get the SCN closest to the specified time
QUERY                select clause used to export a subset of a table
RESUMABLE            suspend when a space related error is encountered(N)
RESUMABLE_NAME       text string used to identify resumable statement
RESUMABLE_TIMEOUT    wait time for RESUMABLE 
TTS_FULL_CHECK       perform full or partial dependency check for TTS
VOLSIZE              number of bytes to write to each tape volume
TABLESPACES          list of tablespaces to export
TRANSPORT_TABLESPACE export transportable tablespace metadata (N)
TEMPLATE             template name which invokes iAS mode export

Export terminated successfully without warnings.
$

EXPORT/IMPORT CHARACTER SET
1) EXPORT
• CONVENTIONAL PATH 쿡 USER SESSION CHARACTER SET .
• DIRECT PATH 쿡 DATABASE CHARACTER SET . , USER SESSION DATABASE CHARACTER SET ٸ 쿡 DIRECT PATH ϸ EXPORT۾ message Բ ȴ.

2) IMPORT
• IMPORTǴ SESSION DATABASE CHARACTER SET ٸ USER SESSION CHARACTER SET Ű ٽ DATABASE CHARACTER SET Ѵ.
̴ ϴµ ð ɸ, ġϴ ڰ 쿡 DATA ִ.


ųʸ ȸ

v$instance ͺ̽ ǿ
v$database ͺ̽ üũƮ, ī̺
v$datafile_header ġ ̸ Ȯ
v$log α ȣ ī̺ Ȯ
v$tablespaceͺ̽ ̺̽ ġ ̸ Ȯ
v$recover_file ¶ Ȯ
v$backup ȣ, , ý ü ȣ, °
v$datafile_header ȣ, , , ̺̽, ġ ̸