TEST | |
---|---|
h4. a. directory 객체 생성 {code:sql} create or replace directory tmp as '/tmp' / {code} | |
h4. b.간단한 select문을 사용해서 디렉토리에 데이터를 언로드 {code:sql} create table all_objects_unload organization external ( type oracle_datapump default directory TMP location( 'allobjects.dat') ) as select * from all_objects / {code} | h4. c. 테이블 재생성하기위한 DDL추출 {code:sql} sys@BWD> select dbms_metadata.get_ddl('TABLE','ALL_OBJECTS_UNLOAD') 2 from dual; |
DBMS_METADATA.GET_DDL('TABLE','ALL_OBJECTS_UNLOAD')
CREATE TABLE "SYS"."ALL_OBJECTS_UNLOAD"
( "OWNER" VARCHAR2(30),
"OBJECT_NAME" VARCHAR2(30),
"SUBOBJECT_NAME" VARCHAR2(30),
"OBJECT_ID" NUMBER,
"DATA_OBJECT_ID" NUMBER,
"OBJECT_TYPE" VARCHAR2(19),
"CREATED" DATE,
"LAST_DDL_TIME" DATE,
"TIMESTAMP" VARCHAR2(19),
"STATUS" VARCHAR2(7),
"TEMPORARY" VARCHAR2(1),
"GENERATED" VARCHAR2(1),
"SECONDARY" VARCHAR2(1)
)
ORGANIZATION EXTERNAL
( TYPE ORACLE_DATAPUMP
DEFAULT DIRECTORY "TMP"
LOCATION
( 'allobjects.dat'
)
)
|
|h4. d. 데이터 로드완료
{code:sql}
insert /*+append*/ into some_table select * from all_objects_unload;
|