1.导入数据文件
CONNECT TO QUOTET USER user USING *****;
IMPORT FROM ".del" OF DEL METHOD P (1, 2, 3, 4, 5, 6, 7, 8, 9) MESSAGES "F:\test\1.txt" INSERT INTO MGTST.QT_SRCQUOTE (SRC_ID, SQT_OFFER, SQT_BID, PRD_ID, SQT_MID, SQT_L_DATETIME, SQT_RANGE, SQT_R_FLG, SQT_STATUS);
CONNECT RESET;
2:导出数据
CONNECT TO QUOTET USER user USING *****;
EXPORT TO "C:\test.txt" OF DEL MESSAGES "aa" SELECT * FROM QUOTE;
CONNECT RESET;
3:建立数据库编目:
UNCATALOG DATABASE QUOTET
CATALOG DATABASE MGQUOTE AS QUOTET AT NODE DB2IMGT;
4:建立数据库节点编目:
UNCATALOG NODE DB2INST1
CATALOG TCPIP NODE DB2INST1 REMOTE ljzkf001 SERVER 50000 REMOTE_INSTANCE DB2 SYSTEM ljzkf001 OSTYPE AIX;
5:建立编目
UNCATALOG NODE LJZKF001
CATALOG ADMIN TCPIP NODE LJZKF001 REMOTE ljzkf001 SYSTEM ljzkf001 OSTYPE AIX;
UNCATALOG NODE DB2IMGSQ
CATALOG TCPIP NODE DB2IMGSQ REMOTE P6906_LP6 SERVER 61000 REMOTE_INSTANCE db2imgsq SYSTEM P6906_LP6 OSTYPE AIX;
UNCATALOG NODE DB2IMGSH
CATALOG TCPIP NODE DB2IMGSH REMOTE P6906_LP6 SERVER 71000 REMOTE_INSTANCE db2imgsh SYSTEM P6906_LP6 OSTYPE AIX;
6.数据表锁定解锁:
db2 => get snapshot for locks on cibp //显示所有锁定进程
db2 =>force application all //强行终止所有连接
db2 =>terminate //清除所有db2的后台进程
7.设置unicode字符集
db2set DB2CODEPAGE=1208
8.create db
CREATE DATABASE db ALIAS db USING CODESET UTF-8 TERRITORY CN;
CREATE db db ALIAS db USING CODESET UTF-8 TERRITORY CN;