본사에서 샘플 데이터베이스를 받아서 import를 시킬려고 하는데 계속

IMP-00010: not a valid export file, header failed verification
IMP-00000: Import terminated unsuccessfully

오류가 발생한다.
FTP로 파일 다운 받을 때 ASCII TYPE으로 받아서 그런가 했더니

알고 보니 expdp tool을 이용해서 받은 파일이다.

인터넷으로 뒤져 보니 10g 부터 기존 exp/imp tool의 단점을 보안하기 위해 나온 tool이다.

기존 exp/imp는 client 중심의 tool이었는데 expdp/impdp는 server 중심의 tool이다.

뭐.. exp/imp 단점을 보안 했다고 하는데 솔직히 어떤 단점을 말하는 건지 모르겠다.
하긴 oracle에서 단점이라고 얘기하는 걸 보면 뭔가 문제가 있었나.^^

예제를 보면 exp/imp를 GUI 환경에서 사용할 수 있도록 해 주기 위해 새로 만들어낸 tool이 아닌가 싶다.

server 중심이다 보니 사용하는 방법이 조금 복잡하다.

exp/imp는 일단 command 한번으로 모든 작업을 처리 했으나

expdp/impdp는 일단 working 디렉토리를 db에 등록한 후 expdp/impdp를 사용해야 한다.

1. working directory를 database에 등록한다.
sqlplus>create directory datadir1 as '/home/oracle/wkdir';
2. expdp/impdp를 사용할 사용자 계정에 working directory에 대한 read, write 권한을 추가한다.
sqlplus>grant read,write on directory datadir1 to sh;
3. expdp를 실행한다.
shell>> expdp 계정/패스워드 directory=datadir1 schema=계정 dumpfile=XXX.dmp logfile=YYY.log
해당 계정의  데이터를 XXX.dmp 파일로 dump 수행한다.

imp 시...
1. working directory를 database에 등록한다.
   ( 위와 동일한 방법으로 working directory를 등록한다. )
2. working directory에 대한 read, write 권한을 추가한다.
3. impdp를 실행한다.
shell>> impdp 계정/패스워드 directory=datadir1 dumpfile=XXX.dmp logfile=CCC.log


참고 자료 : http://www.oracle.com/technology/obe/obe10gdb/storage/datapump/datapump.htm
Posted by headiron
,