本文详细介绍了DB2数据库的备份和还原过程。首先,需要在关闭数据库连接后进行完整脱机备份,验证备份文件无误。然后,在需要还原时,同样要先断开所有连接,再执行数据库的复原操作。遇到SQL1035N错误时,可使用'db2 force application all'命令断开所有应用连接。
摘要由CSDN通过智能技术生成
备份还原
备份
终止连接并取消激活数据库。
db2 terminate
DB20000I The TERMINATE command completed successfully.
db2 deactivate db cmsdb
SQL1495W Deactivate database is successful, however, there is still a
connection to the database.
db2 list application
db2 force application all
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
创建完整脱机备份。整个数据库会复制到指定位置中的备份文件
db2 backup database cmsdb to /home/db2inst1/20200612
Backup successful. The timestamp for this backup image is : 20200612115026