expdp/impdp ¸í·É¾î
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2016-02-16 16:14:21
 

*. Data Pump
-------------------------
Oracle 10gÀÇ ±â´ÉÀÎ Data Pump´Â Oracle Database data¿Í metadataÀÇ À̵¿À» À§ÇÑ
DBMS_DATAPUMP ÆÐÅ°Áö¸¦ ÅëÇÏ¿© »ó´çÈ÷ ºü¸¥ Data Pump infrastructure¸¦ Á¦°øÇÏ°í ÀÖ´Ù.

±âÁ¸ Oracle 9i±îÁö »ç¿ëµÇ´ø exp, imp À¯Æ¿¸®Æ¼º¸´Ù ´õ¿í´õ Çâ»óµÈ ¼º´ÉÀ» ¸ñÀûÀ¸·Î ¸¸µé¾îÁø À¯Æ¿¸®Æ¼´Ù.

Data Pump´Â exp/impº¸´Ù ÈξÀ ¸¹Àº ±â´ÉÀÌ ÀÖÀ¸¸ç, ´ë·®ÀÇ µ¥ÀÌÅ͸¦ ÀÛ¾÷ÇÒ ¶§

¹«Ã´À̳ª ºü¸£°Ô ÀÛ¾÷ÇÒ ¼ö ÀÖ´Ù. ´ÙÀ½Àº °£´ÜÇÑ »ç¿ë¹æ¹ý ¹× »ùÇÃÀÌ´Ù.

---------------
*. expdp
---------------

1. µð·ºÅ丮 Á¶È¸
  SQL> SELECT * FROM dba_directories; 

2. µð·ºÅ丮 Ãß°¡
  SQL> DROP DIRECTORY dpump_dir2;                      -- ±âÁ¸ µð·ºÅ丮 dpump_dir2 drop
  SQL> CREATE DIRECTORY dpump_dir2 as '/backup/dpump';  -- /backup/dpump ¿¡ ´ëÇÑ µð·ºÅ丮 dpump_dir2 »ý¼º

3. µð·ºÅ丮¿¡ ´ëÇÑ ±ÇÇÑ ¼³Á¤
  SQL> GRANT READ, WRITE ON DIRECTORY dpump_dir2 to »ç¿ëÀÚ;

4. expdp
  # expdp system/1239 DIRECTORY=dpump_dir2 schemas=MESS_ADM  DUMPFILE=MESS_ADM_20081223.dmp logfile=MESS_ADM_20081223.log

  # expdp SYSTEM/1239 DIRECTORY=DPUMP_DIR2 DUMPFILE=expdp_alldata_0106.dmp \
          LOGFILE=expdp_alldata_0106.log PARFILE=expdp.par CONTENT=DATA_ONLY

  # expdp system/1239 DIRECTORY=dpump_dir2 tables=MESS_ADM.TB_ABC110      \
          DUMPFILE=tb_ABC110_20100601.dmp logfile=tb_ABC110_20100601.log CONTENT=DATA_ONLY

* expdp(¶Ç´Â impdp) ÀÛ¾÷ ÁøÇà Áß Control+C¸¦ ´©¸£¸é export> ÇÁ·ÒÇÁÆ®(¶Ç´Â import> ÇÁ·ÒÇÁÆ®) »óÅ°¡ µÊ.
  Control+C Çß´Ù°í Çؼ­ ÀÛ¾÷ÀÌ ÁߴܵÇÁö´Â ¾Ê°í, interactive mode·Î º¯°æµÇ¾î expdp(¶Ç´Â impdp) ÀÛ¾÷À» ¸ð´ÏÅ͸µÇÏ°í Á¦¾î °¡´É

  [interactive mode¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖ´Â ¸í·É¾î]
  - STATUS          : ÇöÀç ÀÛ¾÷ÁøÇàÁ¤µµ È®ÀÎ °¡´É
  - CONTINUE_CLIENT : ´Ù½Ã ¿ø·¡ ¸ðµå·Î µ¹¾Æ°¨
  - KILL_JOB
  - STOP_JOB
  - ³ª¸ÓÁö ¸í·É¾î´Â HELP Âü°í

------------------------
*. impdp
------------------------
1. µð·ºÅ丮 Á¶È¸
  SQL> SELECT * FROM dba_directories; 

2. µð·ºÅ丮 Ãß°¡
  SQL> DROP DIRECTORY dpump_dir2;                      -- ±âÁ¸ µð·ºÅ丮 dpump_dir2 drop
  SQL> CREATE DIRECTORY dpump_dir2 as '/backup/dpump';  -- /backup/dpump ¿¡ ´ëÇÑ µð·ºÅ丮 dpump_dir2 »ý¼º

3. µð·ºÅ丮¿¡ ´ëÇÑ ±ÇÇÑ ¼³Á¤
  SQL> GRANT READ, WRITE ON DIRECTORY dpump_dir2 to »ç¿ëÀÚ;

4. impdp
  # impdp system/1239 dumpfile=PT_ABC110_02.dmp directory=dpump_dir2 \
      job_name=job_impdp2 logfile=impdp_PT_ABC110_02.log TABLES=MESS_ADM.TB_ABC110 \
      parallel=4 TABLE_EXISTS_ACTION=APPEND

  [TABLE_EXISTS_ACTION ¿É¼Ç]
    °°Àº À̸§ÀÇ Å×À̺íÀÌ Á¸ÀçÇÒ ¶§ SKIP / APPEND / TRUNCATE / REPLACE

[»ùÇÃ]

*. expdp(ÆÄƼ¼Ç Å×À̺í)
------------------------
  # expdp system/1239 DIRECTORY=dpump_dir2 tables=MESS_ADM.TB_ABC110:PT_ABC110_01 \

          DUMPFILE=PT_ABC110_01.dmp logfile=PT_ABC110_01.log CONTENT=DATA_ONLY
  # expdp system/1239 DIRECTORY=dpump_dir2 tables=MESS_ADM.TB_ABC110:PT_ABC110_02 \

          DUMPFILE=PT_ABC110_02.dmp logfile=PT_ABC110_02.log CONTENT=DATA_ONLY
  # expdp system/1239 DIRECTORY=dpump_dir2 tables=MESS_ADM.TB_ABC110:PT_ABC110_03 \

          DUMPFILE=PT_ABC110_03.dmp logfile=PT_ABC110_03.log CONTENT=DATA_ONLY
           

*. impdp(ÆÄƼ¼Ç Å×À̺í)

------------------------
  # impdp system/1239 dumpfile=PT_ABC110_02.dmp directory=dpump_dir2 \
      job_name=job_impdp2 logfile=impdp_PT_ABC110_02.log TABLES=MESS_ADM.TB_ABC110 \
      parallel=4 TABLE_EXISTS_ACTION=APPEND

    Import: Release 10.2.0.2.0 - 64bit Production on Wednesday, 02 June, 2010 0:31:37

    Copyright (c) 2003, 2005, Oracle.  All rights reserved.

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning and Data Mining options
    Master table "SYSTEM"."JOB_IMPDP2" successfully loaded/unloaded
    Starting "SYSTEM"."JOB_IMPDP2":  system/******** dumpfile=PT_ABC110_02.dmp directory=dpump_dir2 job_name=job_impdp2

    logfile=impdp_PT_ABC110_02.log TABLES=MESS_ADM.TB_ABC110 parallel=4 TABLE_EXISTS_ACTION=APPEND
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    . . imported "MESS_ADM"."TB_ABC110":"PT_ABC110_02"      746.4 MB 18653423 rows
    Job "SYSTEM"."JOB_IMPDP2" successfully completed at 00:32:53

[Ãâó] ÀÌ°ü - expdp/impdp ¸í·É¾î|ÀÛ¼ºÀÚ smileDBA


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦