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 小时前
SQL实战训练之,力扣:2020. 无流量的帐户数(递归)
数据库·sql·leetcode
Channing Lewis3 小时前
salesforce case可以新建一个roll up 字段,统计出这个case下的email数量吗
数据库·salesforce
毕业设计制作和分享4 小时前
ssm《数据库系统原理》课程平台的设计与实现+vue
前端·数据库·vue.js·oracle·mybatis
ketil274 小时前
Redis - String 字符串
数据库·redis·缓存
Hsu_kk5 小时前
MySQL 批量删除海量数据的几种方法
数据库·mysql
编程学无止境5 小时前
第02章 MySQL环境搭建
数据库·mysql
knight-n5 小时前
MYSQL库的操作
数据库·mysql
包饭厅咸鱼6 小时前
QML----复制指定下标的ListModel数据
开发语言·数据库
生命几十年3万天6 小时前
redis时间优化
数据库·redis·缓存
Elastic 中国社区官方博客6 小时前
释放专利力量:Patently 如何利用向量搜索和 NLP 简化协作
大数据·数据库·人工智能·elasticsearch·搜索引擎·自然语言处理