Oracle Export Import Oracle Export Mode Table Mode
Oracle Export 및 Import 유틸리 티
Oracle Export Mode Table Mode Exp hr/hr tables=employees, departments rows=y file=exp 1. dmp User Mode Exp system/manager owner=hr direct=y file=expdat. dmp Tablespace Mode Exp ₩’username/password as sysdba₩’ transport_tablespace=y tablespaces=ts_emp Full Database Mode Exp system/manager file=expdat. dmp log=expdat. log full=y
Oracle Import Mode Table Mode imp hr/hr tables=employees, departments rows=y file=exp 1. dmp User Mode imp system/manager owner=hr direct=y file=expdat. dmp Tablespace Mode imp ₩’username/password as sysdba₩’ transport_tablespace=y tablespaces=ts_emp Full Database Mode imp system/manager file=expdat. dmp log=expdat. log full=y
Export 시 query option 사용하기 select 문장에서의 where절을 사용하는 것처럼 export 시에 부분적으로 table data 를 받아 낼 수 있는 기능 1. 테이블 레벨의 export 명령어에서만 가능하다. 2. Direct 옵션과 함께 사용될 수 없다. 3. Nested 테이블을 갖는 테이블에는 적용할 수 없다. 4. Partition 테이블에 대한 export에도 적용 가능하다. 5. Import 명령에는 적용되지 않는다. Example: 1. scott. emp table의 ename 이 JAME과 비슷한 이름의 data 를 export exp scott/tiger query=₩"where ename like ₩'JAME%₩'₩" tables=emp file=exp. dmp log=exp. log 2. employee와 cust table에서 new york 주의 data 만 export exp scott/tiger query=₩"where st=₩'NY₩'₩" tables=(employee, cust) file=exp. dmp log=exp. log
(V 9. X) 8 I -> 9. X EXPORT/IMPORT 수행 시 ORA-25150 에러 해결방법 Oracle 8 i 버젼에서 export를 수행하였는데, 8 i의 tablespace는 DICTIONARY managed tablespace이다. 이 8 i export dump file을 9 i 데이타베이스로 import를 하게 되면 다음과 같은 에러 메시지가 발생할 수 있다. Example: importing table "WWA_MODULE_CALL_STACK$" 186 rows imported. . importing table "WWA_MODULE_EVENTS$" 588 rows imported. . importing table "WWA_MODULE_LOV_BINDINGS$" 1 rows imported. . importing table "WWA_MODULE_SCRIPTS$" 0 rows imported IMP-00017: following statement failed with ORACLE error 25150: "ALTER TABLE "WWA_MODULE_SESSION_ELEMENTS$" PCTFREE 10 PCTUSED 40 INITRANS" "1 MAXTRANS 255 LOGGING STORAGE( NEXT 10485760 MINEXTENTS 1 MAXEXTENTS 1000" "PCTINCREASE 0 BUFFER_POOL DEFAULT)" IMP-00003: ORACLE error 25150 encountered ORA-25150: ALTERING of extent parameters not permitted
(V 9. X) 8 I -> 9. X EXPORT/IMPORT 수행 시 ORA-25150 에러 해결방법 Solution Description : Oracle 9 i에서는 생성되는 tablespace가 모두 default로 Locally-managed tablespace 이다. ORA-25150 에러를 해결하기 위해서는 dbms_space_admin. tablespace_migrate_from_local 프로시져를 이용하여 Locallymanaged tablespace를 Dictionary-managed tablespace로 migrate 해야 한다. SQL> connect / as sysdba Connected. SQL> execute dbms_space_admin. tablespace_migrate_from_local(‘users'); PL/SQL procedure successfully completed. Procedure : dbms_space_admin. tablespace_migrate_from_local Locally-Managed tablespace -> Dictionary-managed tablespace dbms_space_admin. tablespace_migrate_to_local Dictionary-managed tablespace- > Locally-Managed tablespace
- Slides: 10