db2恢复数据库

db2licm -l检查下license

IBM Support: Fix Central - Please wait, Select fixes

db2 force application all

db2ckbkp -H JYC.0.DB2.NODE0000.CATN0000.20240603223001.001

db2 "restore db jyc logtarget x:\db2\log"

db2 "rollforward db jyc to end of logs and complete overflow log path (x:\db2\log)"

报错:

归档日志路径

参考:https://www.cnblogs.com/vipsoft/archive/2012/08/08/2628291.html

其它参考:https://www.talkwithtrend.com/Question/262263?order=asc

关于错误:SQL1265N的错误处理

步骤一、恢复数据库

db2inst1@db2server:~> db2 "restore db patchdb logs taken at 20140124061304

LOGTARGET /home/db2inst1/dblog/"

DB20000I The RESTORE DATABASE command completed successfully.

步骤二、前滚数据库

db2inst1@db2server:~/dblog> db2 "ROLLFORWARD DATABASE patchdb TO END OF LOGS AND COMPLETE

OVERFLOW LOG PATH ('/home/db2inst1/dblog/')"

SQL1265N The archive log file "S0000017.LOG" is not associated with the

current log sequence for database "PATCHDB" on node "0".

步骤三、拷贝需要前滚的最小日志文件

db2inst1@db2server:~> cd /home/db2inst1/dblog/

db2inst1@db2server:~/dblog> ls -rtl

total 16

drwxr-x--- 4 db2inst1 db2iadm1 4096 Jan 24 06:21 db2inst1

-rw------- 1 db2inst1 db2iadm1 12288 Jan 24 06:35 S0000017.LOG

db2inst1@db2server:~/dblog> cp S0000017.LOG /home/db2inst1/db2inst1/NODE0000/SQL00003/SQLOGDIR/

db2inst1@db2server:~/dblog> db2 "ROLLFORWARD DATABASE patchdb TO END OF LOGS AND COMPLETE "

SQL1271W Database "PATCHDB" is recovered but one or more table spaces are

off-line on node(s) "0".

步骤四、查询前滚状态

db2inst1@db2server:~/dblog> db2 "rollforward db patchdb query status"

Rollforward Status

Input database alias = patchdb

Number of nodes have returned status = 1

Node number = 0

Rollforward status = not pending

Next log file to be read =

Log files processed = S0000017.LOG - S0000017.LOG

Last committed transaction = 2014-01-24-11.13.22.000000 UTC

相关推荐
恒辉信达2 分钟前
hhdb客户端介绍(53)
数据库·mysql·hhdb·数据库可视化界面客户端
指尖上跳动的旋律2 小时前
shell脚本定义特殊字符导致执行mysql文件错误的问题
数据库·mysql
一勺菠萝丶2 小时前
MongoDB 常用操作指南(Docker 环境下)
数据库·mongodb·docker
m0_748244833 小时前
StarRocks 排查单副本表
大数据·数据库·python
C++忠实粉丝3 小时前
Redis 介绍和安装
数据库·redis·缓存
wmd131643067123 小时前
将微信配置信息存到数据库并进行调用
数据库·微信
是阿建吖!3 小时前
【Linux】基础IO(磁盘文件)
linux·服务器·数据库
凡人的AI工具箱4 小时前
每天40分玩转Django:Django国际化
数据库·人工智能·后端·python·django·sqlite
ClouGence4 小时前
Redis 到 Redis 数据迁移同步
数据库·redis·缓存
m0_748236584 小时前
《Web 应用项目开发:从构思到上线的全过程》
服务器·前端·数据库