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

相关推荐
·薯条大王26 分钟前
MySQL联合查询
数据库·mysql
morris1312 小时前
【redis】redis实现分布式锁
数据库·redis·缓存·分布式锁
hycccccch3 小时前
Canal+RabbitMQ实现MySQL数据增量同步
java·数据库·后端·rabbitmq
这个懒人3 小时前
深入解析Translog机制:Elasticsearch的数据守护者
数据库·elasticsearch·nosql·translog
Yan-英杰4 小时前
【百日精通JAVA | SQL篇 | 第二篇】数据库操作
服务器·数据库·sql
NineData4 小时前
NineData云原生智能数据管理平台新功能发布|2025年3月版
数据库
百代繁华一朝都-绮罗生5 小时前
检查是否存在占用内存过大的SQL
数据库·sql
吾日三省吾码5 小时前
Python 脚本:自动化你的日常任务
数据库·python·自动化
CZIDC6 小时前
win11 系统环境下 新安装 WSL ubuntu + ssh + gnome 桌面环境
数据库·ubuntu·ssh
直裾6 小时前
Mapreduce的使用
大数据·数据库·mapreduce