DB2各种命令

--SQL1047N 应用程序已经与另一个数据库相连
db2 connect reset


https://www.cnblogs.com/simon6623/p/8663719.html


--创建数据库
db2 CREATE DATABASE qhysjh AUTOMATIC STORAGE YES  ON 'C:\work\database\db2_data' DBPATH ON 'C:' USING CODESET GBK TERRITORY CN COLLATE USING SYSTEM PAGESIZE 4096

--备份数据库

CONNECT TO QHYSJH;
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
CONNECT RESET;
BACKUP DATABASE QHYSJH TO "C:\" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING;
CONNECT TO QHYSJH;
UNQUIESCE DATABASE;
CONNECT RESET;

 

--还原数据库

db2 RESTORE DATABASE qhysjh FROM C:\QHYSJH.0.DB2.NODE0000.CATN0000.20220208084148.001 TAKEN AT 20220208084148 TO C: INTO QHYSJH WITH 2 BUFFERS BUFFER 1024 WITHOUT PROMPTING




 

posted @ 2022-02-16 14:20  _万古如长夜  阅读(83)  评论(0编辑  收藏  举报