Wednesday, August 2, 2017

▷ Oracle exp, imp, sqlldr 사용법 (오라클 exp imp sqlldr)

[ Oracle exp, imp, sqlldr ]


(1) Export (파일이름은 ScottTest+현재날짜.dmp)
(*) 전체 테이블 경우 'tables' 옵션 제거
exp scott/tiger file=/tmp/"ScottTest"`date '+%Y%m%d'`"_1.dmp" tables=emp,dept compress=y grants=y rows=y

(2) Import (파일이름은 ScottTest+현재날짜.dmp)
imp system/manager file=/tmp/"ScottTest"`date '+%Y%m%d'`"_1.dmp" fromuser=scott touser=test commit=y
or
imp system/manager file=/tmp/"ScottTest"`date '+%Y%m%d'`"_1.dmp" full=y commit=y

(3) sqlldr 사용:  SQL*Loader (파일이름은 Test+현재날짜_1.txt)
(*) log -- Log file name, bad -- Bad file name : 미지정시 디폴트로 CTL 파일과 동일한 이름으로 만들어지고 접미사는 .log 및 .bad
sqlldr test/test control=/tmp/test.ctl data="/tmp/test"`date '+%Y%m%d'`"_1.txt" log=/tmp/test.log

(*) [test.ctl]
load data
append into table TEST_TB
fields terminated by '|'
(
        kpi_id                  char(20)    "to_number(:kpi_id)",
        description             char(64),
        grade                   char(10),
        date_time               char(20)
)

(*) [test.txt]
100|DES 100|A|2009-08-28 10:22|
200|DES 200|B|2009-08-28 10:23|
300|DES 300|C|2009-08-28 10:24|
400|DES 400|D|2009-08-28 10:25|

No comments:

Post a Comment

◈ Recent Post

▷ UITest demo with TestOne (Mobile, Keypad and Drag until found tip)

[ UITest Demo Environment ] 1. UITest Solution: TestOne 2. Description 데모 설명    How to use keypad, and to drag until found.     키패드를...

◈ Popular Posts