DB2 table export/import
del 형식
- csv 형태의 텍스트 파일로 export
ixf 형식
- oracle exp와 유사, 테이블 생성과 insert 작업을 동시에 지정
del 형식
db2=> select * from test_table
db2=> export to test_table_del.dmp of del select * from test_table
db2=> !type test_table.dmp
db2=> delete from test_table
db2=> select * from test_table
db2=> import from test_table.dmp of del insert into emp
db2=> select * from test_table
ixf 형식
db2=> select * from test_table
db2=> export to test_table_ixf.dmp of ixf select * from test_table
db2=> drop table test_table
db2=> import from test_table_ixf.dmp of ixf create into test_table
db2=> select * from test_table
*** 추가
데이터 삭제 및 insert
db2=> select * from test_table
db2=> export to test_table_ixf.dmp of ixf select * from test_table
db2=> delect * from test_table
db2=> import from test_table_ixf.dmp of ixf insert into test_table
테이블 삭제
db2=> export to test_table_ixf.dmp of ixf select * from test_table
# db2look -d kbp -e -t "test_table" -nofed -x > testtable_look.out
db2=> drop table test_table
# db2 -stvf testtable_look.out
db2=> import from test_table_ixf.dmp of ixf insert into test_table
* insert into, replace, update
- csv 형태의 텍스트 파일로 export
ixf 형식
- oracle exp와 유사, 테이블 생성과 insert 작업을 동시에 지정
del 형식
db2=> select * from test_table
db2=> export to test_table_del.dmp of del select * from test_table
db2=> !type test_table.dmp
db2=> delete from test_table
db2=> select * from test_table
db2=> import from test_table.dmp of del insert into emp
db2=> select * from test_table
ixf 형식
db2=> select * from test_table
db2=> export to test_table_ixf.dmp of ixf select * from test_table
db2=> drop table test_table
db2=> import from test_table_ixf.dmp of ixf create into test_table
db2=> select * from test_table
*** 추가
데이터 삭제 및 insert
db2=> select * from test_table
db2=> export to test_table_ixf.dmp of ixf select * from test_table
db2=> delect * from test_table
db2=> import from test_table_ixf.dmp of ixf insert into test_table
테이블 삭제
db2=> export to test_table_ixf.dmp of ixf select * from test_table
# db2look -d kbp -e -t "test_table" -nofed -x > testtable_look.out
db2=> drop table test_table
# db2 -stvf testtable_look.out
db2=> import from test_table_ixf.dmp of ixf insert into test_table
* insert into, replace, update
댓글
댓글 쓰기