Friday, February 1, 2008

ย้ายข้อมูลไปมาระหว่าง Using DB2 utilities to clone databases across different platforms

จะดึงข้อมูลมา Test บนเครื่องเราซะหน่อย แต่ดันข้าม platform
อ่ะๆ วิธีนี้ใช้ได้ทั้ง Windows<->Unix นะ


Linux -> Windows

ฝั่ง Linux นะ
1. db2look -d dbname -a -e -l -x -c -o dbname.log
หรือถ้าจะเอาเฉพาะ Table ก็ได้
db2look -d dbname -t tablename -a -e -l -x -c -o dbname.log

1.1 edit this file *.log change DB name in Script
2. db2move dbname export -aw
หรือระบุ Schema หรือ Table
db2move dbname export -aw -tn ชื่อtable -sn ชื่อschema

ฝั่ง Windows นะ
3. db2 -tvf path of file in 1.
4. db2move newdbname load > dbname.log

*Remark
When you transfer file FTP use ASCIIafter import Set Integrity TOO!

No comments: