ORACLE/Migration2007. 2. 12. 20:32
반응형
2G 넘는 파일의 export/import(Unix)

대부분의 오라클 버전에서 파일을 export할 때 default file open API를 사용하므로 2G가 넘는 파일에 대해서는 export가 불가능 하게 되며 다음과 같은 오류를 보실 것입니다.


. . exporting table                   BIGEXPORT
          EXP-00015: error on row 10660 of table BIGEXPORT, 
                  column MYCOL, datatype 96
          EXP-00002: error in writing to export file
          EXP-00002: error in writing to export file
          EXP-00000: Export terminated unsuccessfully


환경에서 export시 2G의 한계를 극복하기 위한 여러 옵션이 있는데 다음과 같습니다.

-        raw device인 경우 2G의 한계를 극복할 수 있습니다. 물론 raw device는 그안에 export가 가능하도록 충분히 크게 구성되어야 합니다. (raw device에 관해서는 Oracle Tip에 구현 방법이 나와 있습니다.)
-        named pipe를 통해 export, DBA는 compress, zip, split를 이용하여 export/import가 가능 합니다.
-        Tape 장치에 export 합니다.
-        Oracle 8i에서는 multi export file을 지원 합니다. (큰것 하나 보다는 잘게 쪼갠 여러 파일)

아래에 unix 환경에서는 split, compress, named pipe등을 이용하여 2G의 export/import한 예가 있으니 참고 바랍니다.

=====================================================

Example Export/Import using Compress and Split Export
#!/bin/ksh

# +---------------------------------------+
# | Change directory to the EXPORT_DIR.   |
# +---------------------------------------+
cd /u03/app/oradata/RCVCATDB/export
pwd

# +---------------------------------------+
# | Remove previous pipes (if any)        |
# +---------------------------------------+
rm -f compress_pipe
rm -f export_pipe

# +---------------------------------------+
# | Make two new pipes (Compress / Split) |
# +---------------------------------------+
mknod compress_pipe p
mknod export_pipe p
chmod 666 export_pipe compress_pipe

# +---------------------------------------+
# | Start both the Split and Compress     |
# | backgroud processes.                  |
# +---------------------------------------+
nohup split -b 1024m < export_pipe &
nohup compress < compress_pipe > export_pipe &

# +---------------------------------------+
# | Finally, start the export to both     |
# | pipes.                                |
# +---------------------------------------+
exp userid=/ file=compress_pipe full=yes log=exportRCVCATDB.log

# +---------------------------------------+
# | Remove the pipes.                     |
# +---------------------------------------+
rm -f compress_pipe
rm -f export_pipe
Import
#!/bin/ksh
# +---------------------------------------+
# | Change directory to the EXPORT_DIR.   |
# +---------------------------------------+
cd /u03/app/oradata/RCVCATDB/export
pwd

# +---------------------------------------+
# | Remove previous pipe (if any)         |
# +---------------------------------------+
rm -f import_pipe

# +---------------------------------------+
# | Make two new pipes (Compress / Split) |
# +---------------------------------------+
mknod import_pipe p
chmod 666 import_pipe

# +---------------------------------------+
# | Start both the Uncompress             |
# | backgroud processes.                  |
# | This example assumes the export script|
# | (above) created three dump files xaa, |
# | xab and xac.                          |
# +---------------------------------------+
nohup cat xaa xab xac | uncompress - > import_pipe &

imp userid=/ file=import_pipe full=yes ignore=yes log=importRCVCATDB.log

# +---------------------------------------+
# | Remove the pipe.                      |
# +---------------------------------------+
rm -f import_pipe
Example Export/Import using only Split
Export
#!/bin/ksh

# +---------------------------------------+
# | Change directory to the EXPORT_DIR.   |
# +---------------------------------------+
cd /u03/app/oradata/RCVCATDB/export
pwd

# +---------------------------------------+
# | Remove previous pipes (if any)        |
# +---------------------------------------+
rm -f export_pipe

# +---------------------------------------+
# | Make new pipe (Split)                 |
# +---------------------------------------+
mknod export_pipe p
chmod 666 export_pipe

# +---------------------------------------+
# | Start the Split backgroud process.    |
# +---------------------------------------+
nohup split -b 1024m < export_pipe &

# +---------------------------------------+
# | Finally, start the export to both     |
# | pipes.                                |
# +---------------------------------------+
exp userid=/ file=export_pipe full=yes log=exportRCVCATDB.log

# +---------------------------------------+
# | Remove the pipe.                      |
# +---------------------------------------+
rm -f export_pipe
Import
#!/bin/ksh
# +---------------------------------------+
# | Change directory to the EXPORT_DIR.   |
# +---------------------------------------+
cd /u03/app/oradata/RCVCATDB/export
pwd

# +---------------------------------------+
# | Remove previous pipe (if any)         |
# +---------------------------------------+
rm -f import_pipe

# +---------------------------------------+
# | Make new pipe (Split)                 |
# +---------------------------------------+
mknod import_pipe p
chmod 666 import_pipe

# +---------------------------------------+
# | Start the Split backgroud processes.  |
# | This example assumes the export script|
# | (above) created three dump files xaa, |
# | xab and xac.                          |
# +---------------------------------------+
nohup cat xaa xab xac > import_pipe &

imp userid=/ file=import_pipe full=yes ignore=yes log=importRCVCATDB.log

# +---------------------------------------+
# | Remove the pipe.                      |
# +---------------------------------------+
rm -f import_pipe

출처 : Tong - 泫盛님의 Oracle통

반응형
Posted by [PineTree]