离线备份/还原数据库的步骤如下:
db2 list applications
db2 force applications all(或应用号)
db2 backup db 数据库名 to 路径或(db2 backup db 数据库名)
nohup db2 restore db testdb without rolling forward &
在线备份/还原数据库的步骤如下:
db2 backup db 数据库名 online to 路径
db2 restore db 数据库名 taken at 时间点
db2 rollforward db testdb query status
db2 rollforward db testdb to 2009-05-03-10.28.43.000000 using utc time and complete
脱机重定向备份恢复
db2 backup db testdb
db2 "restore db testdb on /testdb redirect without rolling forward"
db2 "set tablespace containers for 3 using (Device '/dev/rcontainer01lv' 7864320)"
db2 "set tablespace containers for 4 using (Device '/dev/rcontainer02lv' 4587488)"
db2 "set tablespace containers for 5 using (path '/testdb/temp01' )"
db2 "set tablespace containers for 6 using (path '/testdb/temp02')"
db2 restore db testdb continue
联机重定向回复
db2 backup db testdb online
db2 "restore db testdb on /testdb redirect "
db2 "set tablespace containers for 3 using (Device '/dev/rcontainer01lv' 7864320)"
db2 "set tablespace containers for 4 using (Device '/dev/rcontainer02lv' 4587488)"
db2 "set tablespace containers for 5 using (path '/testdb/temp01' )"
db2 "set tablespace containers for 6 using (path '/testdb/temp02')"
db2 restore db testdb continue
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载