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

相关推荐
指尖下的技术8 分钟前
Mysql面试题----为什么B+树比B树更适合实现数据库索引
数据结构·数据库·b树·mysql
数据馅13 分钟前
python自动生成pg数据库表对应的es索引
数据库·python·elasticsearch
峰子201231 分钟前
B站评论系统的多级存储架构
开发语言·数据库·分布式·后端·golang·tidb
浏览器爱好者2 小时前
如何使用MongoDB进行数据存储?
数据库·mongodb
yuanpan2 小时前
MongoDB中的横向扩容数据分片
数据库·mongodb
草明2 小时前
Mongodb 慢查询日志分析 - 1
数据库·python·mongodb
yuanpan2 小时前
MongoDB的事务机制
数据库·mongodb
SelectDB3 小时前
Apache Doris 2.1.8 版本正式发布
大数据·数据库·数据分析
云和恩墨4 小时前
云计算、AI与国产化浪潮下DBA职业之路风云变幻,如何谋破局启新途?
数据库·人工智能·云计算·dba
明月看潮生5 小时前
青少年编程与数学 02-007 PostgreSQL数据库应用 11课题、视图的操作
数据库·青少年编程·postgresql·编程与数学