标签云
asm恢复 bbed bootstrap$ dul kcbzib_kcrsds_1 kccpb_sanity_check_2 kcratr_nab_less_than_odr kgegpa MySQL恢复 ORA-00312 ORA-00704 ORA-00742 ORA-01110 ORA-01200 ORA-01555 ORA-01578 ORA-01595 ORA-600 2662 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-600 kdsgrp1 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (109)
- 数据库 (1,819)
- DB2 (22)
- MySQL (80)
- Oracle (1,650)
- Data Guard (53)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (168)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (69)
- Oracle Bug (8)
- Oracle RAC (54)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (29)
- Oracle备份恢复 (619)
- Oracle安装升级 (102)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (86)
- PostgreSQL (35)
- pdu工具 (7)
- PostgreSQL恢复 (12)
- SQL Server (34)
- SQL Server恢复 (14)
- TimesTen (7)
- 达梦数据库 (3)
- 达梦恢复 (1)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (45)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (28)
-
最近发表
- 在生产环境错误执行dd命令破坏asm磁盘故障恢复
- obet实现对数据文件坏块检测功能
- oracle linux 8.10注意pmlogger导致空间被大量占用
- obet快速修改scn/resetlogs恢复数据库(缺少归档,ORA-00308)
- 使用DBMS_PDB.RECOVER抢救单个pdb
- aix环境写入大文件设置combehin提高效率
- 数据库启动报 maximum number of processes () exceeded分析
- ORA-600 [ksunfy : too few sessions]
- 由于数据块scn大于数据库scn导致ORA-600 kcbzib_kcrsds_1错误
- ORA-600 ktbair2: illegal inheritance恢复
- 一键恢复ORA-00704 ORA-00702故障—202512
- PostgreSQL查询一个表相关的所有oid
- PostgreSQL oid文件替换实现数据访问
- 模拟sql server故障备份完成恢复实现数据0丢失
- sql server 事务日志备份异常恢复案例
- win平台挂起Oracle数据库启动进程
- linux异常磁盘lvm恢复操作演示
- open数据库报ora-600 kdsgrp1故障处理
- expdp dmp 导出不完整导入ORA-39059 ORA-39246 故障抢救数据
- mysql drop database 恢复思路
分类目录归档:DB2
DB2 runstats和reorg操作
db2收集统计信息(runstats)
[db2inst1@xifenfei ~]$ db2 connect to xff
Database Connection Information
Database server = DB2/LINUX 9.5.9
SQL authorization ID = DB2INST1
Local database alias = XFF
[db2inst1@xifenfei ~]$ db2 list tables
Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
T_01XFF DB2INST1 T 2012-04-11-18.23.05.723478
T_02XFF DB2INST1 T 2012-04-11-18.30.26.639326
T_03XFF DB2INST1 T 2012-04-11-21.33.12.479480
3 record(s) selected.
[db2inst1@xifenfei ~]$ db2 "select STATS_TIME from syscat.tables where tabname in('T_01XFF','T_02XFF','T_03XFF')"
STATS_TIME
--------------------------
2012-04-12-04.35.07.539790
2012-04-11-19.55.12.023748
2012-04-11-22.20.07.016905
3 record(s) selected.
--收集表和索引统计信息,包括数据分布
[db2inst1@xifenfei ~]$ db2 "runstats on table db2inst1.t_01xff on all columns
with distribution and detailed indexes all"
DB20000I The RUNSTATS command completed successfully.
[db2inst1@xifenfei ~]$ db2 "select STATS_TIME from syscat.tables where tabname in('T_01XFF')"
STATS_TIME
--------------------------
2012-04-28-23.43.23.904759
1 record(s) selected.
--收集索引统计信息,如果表没有被收集,也会同时对表收集统计信息,对不会收集数据分布信息
[db2inst1@xifenfei ~]$ db2 "runstats on table db2inst1.t_02xff for indexes all"
DB20000I The RUNSTATS command completed successfully.
[db2inst1@xifenfei ~]$ db2 "select STATS_TIME from syscat.tables where tabname in('T_01XFF','T_02XFF')"
STATS_TIME
--------------------------
2012-04-28-23.43.23.904759
2012-04-28-23.44.39.762858
2 record(s) selected.
db2 reorg操作
--删除部分表数据
[db2inst1@xifenfei ~]$ db2 "delete from t_01xff"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 "delete from t_03xff"
DB20000I The SQL command completed successfully.
--reorgchk检查是否需要进行reorg
[db2inst1@xifenfei ~]$ db2 reorgchk on schema db2inst1
Doing RUNSTATS ....
Table statistics:
F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80
SCHEMA.NAME CARD OV NP FP ACTBLK TSIZE F1 F2 F3 REORG
----------------------------------------------------------------------------------------
Table: DB2INST1.T_01XFF
0 0 0 42 - 0 0 0 0 -**
Table: DB2INST1.T_02XFF
371 0 42 42 - 152110 0 100 100 ---
Table: DB2INST1.T_03XFF
0 0 0 83 - 0 0 0 0 -**
----------------------------------------------------------------------------------------
Index statistics:
F4: CLUSTERRATIO or normalized CLUSTERFACTOR > 80
F5: 100 * (Space used on leaf pages / Space available on non-empty leaf pages) > MIN(50, (100 - PCTFREE))
F6: (100 - PCTFREE) * (Amount of space available in an index with one less level / Amount of space required for all keys) < 100
F7: 100 * (Number of pseudo-deleted RIDs / Total number of RIDs) < 20
F8: 100 * (Number of pseudo-empty leaf pages / Total number of leaf pages) < 20
SCHEMA.NAME INDCARD LEAF ELEAF LVLS NDEL KEYS LEAF_RECSIZE NLEAF_RECSIZE LEAF_PAGE_OVERHEAD NLEAF_PAGE_OVERHEAD F4 F5 F6 F7 F8 REORG
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Table: DB2INST1.T_01XFF
Index: DB2INST1.I_T_01XFF
0 3 3 2 0 0 2 2 822 822 100 0 - 0 100 ----*
--------------------------------------------------------------------------------------------------------------------------------------------------------------
CLUSTERRATIO or normalized CLUSTERFACTOR (F4) will indicate REORG is necessary
for indexes that are not in the same sequence as the base table. When multiple
indexes are defined on a table, one or more indexes may be flagged as needing
REORG. Specify the most important index for REORG sequencing.
Tables defined using the ORGANIZE BY clause and the corresponding dimension
indexes have a '*' suffix to their names. The cardinality of a dimension index
is equal to the Active blocks statistic of the table.
--离线reorg index
[db2inst1@xifenfei ~]$ db2 reorg table db2inst1.t_01xff index DB2INST1.I_T_01XFF allow read access
DB20000I The REORG command completed successfully.
--在线reorg table
[db2inst1@xifenfei ~]$ db2 reorg table db2inst1.t_01xff inplace allow write access
DB20000I The REORG command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
[db2inst1@xifenfei ~]$ db2 reorg table db2inst1.t_03xff inplace allow write access
DB20000I The REORG command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
--证明异步操作完成
[db2inst1@xifenfei ~]$ ps -ef|grep db2reo
db2inst1 1496 1311 0 00:24 pts/1 00:00:00 grep db2reo
--检查reorg操作结果
[db2inst1@xifenfei ~]$ db2 reorgchk on schema db2inst1
Doing RUNSTATS ....
Table statistics:
F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80
SCHEMA.NAME CARD OV NP FP ACTBLK TSIZE F1 F2 F3 REORG
----------------------------------------------------------------------------------------
Table: DB2INST1.T_01XFF
0 0 0 1 - 0 0 - 0 ---
Table: DB2INST1.T_02XFF
371 0 42 42 - 152110 0 100 100 ---
Table: DB2INST1.T_03XFF
0 0 0 1 - 0 0 - 0 ---
----------------------------------------------------------------------------------------
Index statistics:
F4: CLUSTERRATIO or normalized CLUSTERFACTOR > 80
F5: 100 * (Space used on leaf pages / Space available on non-empty leaf pages) > MIN(50, (100 - PCTFREE))
F6: (100 - PCTFREE) * (Amount of space available in an index with one less level / Amount of space required for all keys) < 100
F7: 100 * (Number of pseudo-deleted RIDs / Total number of RIDs) < 20
F8: 100 * (Number of pseudo-empty leaf pages / Total number of leaf pages) < 20
SCHEMA.NAME INDCARD LEAF ELEAF LVLS NDEL KEYS LEAF_RECSIZE NLEAF_RECSIZE LEAF_PAGE_OVERHEAD NLEAF_PAGE_OVERHEAD F4 F5 F6 F7 F8 REORG
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Table: DB2INST1.T_01XFF
Index: DB2INST1.I_T_01XFF
0 1 0 1 0 0 2 2 822 822 100 - - 0 0 -----
--------------------------------------------------------------------------------------------------------------------------------------------------------------
CLUSTERRATIO or normalized CLUSTERFACTOR (F4) will indicate REORG is necessary
for indexes that are not in the same sequence as the base table. When multiple
indexes are defined on a table, one or more indexes may be flagged as needing
REORG. Specify the most important index for REORG sequencing.
Tables defined using the ORGANIZE BY clause and the corresponding dimension
indexes have a '*' suffix to their names. The cardinality of a dimension index
is equal to the Active blocks statistic of the table.
发表在 DB2
评论关闭
DB2备份恢复(不完全恢复)
全备数据库
[db2inst1@xifenfei ~]$ db2 backup db xff online to /tmp include logs
Backup successful. The timestamp for this backup image is : 20120411213218
[db2inst1@xifenfei ~]$ db2 list history backup all for xff
List History File for xff
Number of matching file entries = 1
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20120411213218001 N D S0000021.LOG S0000021.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP XFF ONLINE
Start Time: 20120411213218
End Time: 20120411213229
Status: A
----------------------------------------------------------------------------
EID: 42 Location: /tmp
数据操作(包括误操作)
[db2inst1@xifenfei ~]$ db2 connect to xff
Database Connection Information
Database server = DB2/LINUX 9.5.9
SQL authorization ID = DB2INST1
Local database alias = XFF
[db2inst1@xifenfei ~]$ db2 list tables
Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
T_01XFF DB2INST1 T 2012-04-11-18.23.05.723478
T_02XFF DB2INST1 T 2012-04-11-18.30.26.639326
2 record(s) selected.
[db2inst1@xifenfei ~]$ db2 "create table t_03xff like t_01xff"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 "insert into t_03xff select * from t_01xff"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ date
Wed Apr 11 21:33:42 CST 2012
[db2inst1@xifenfei ~]$ db2 "select count(*) from t_03xff"
1
-----------
370
1 record(s) selected.
--以下是错误操作,需要回滚
[db2inst1@xifenfei ~]$ date
Wed Apr 11 21:36:38 CST 2012
[db2inst1@xifenfei ~]$ db2 "insert into t_03xff select * from t_01xff"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 "select count(*) from t_03xff"
1
-----------
740
1 record(s) selected.
还原数据库
db2inst1@xifenfei ~]$ db2 restore db xff from /tmp taken at 20120411213218 SQL2539W Warning! Restoring to an existing database that is the same as the backup image database. The database files will be deleted. Do you want to continue ? (y/n) y DB20000I The RESTORE DATABASE command completed successfully.
恢复数据库
[db2inst1@xifenfei ~]$ db2 rollforward db xff to 2012-04-11-21.36.00.00000 using local time
Rollforward Status
Input database alias = xff
Number of nodes have returned status = 1
Node number = 0
Rollforward status = DB working
Next log file to be read = S0000023.LOG
Log files processed = S0000021.LOG - S0000021.LOG
Last committed transaction = 2012-04-11-21.33.27.000000 Local
DB20000I The ROLLFORWARD command completed successfully.
[db2inst1@xifenfei ~]$ db2 connect to xff
SQL1117N A connection to or activation of database "XIFENFEI" cannot be made
because of ROLL-FORWARD PENDING. SQLSTATE=57019
--停止前滚
[db2inst1@xifenfei ~]$ db2 rollforward db xff stop
Rollforward Status
Input database alias = xff
Number of nodes have returned status = 1
Node number = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000021.LOG - S0000022.LOG
Last committed transaction = 2012-04-11-21.33.27.000000 Local
DB20000I The ROLLFORWARD command completed successfully.
验证数据
[db2inst1@xifenfei ~]$ db2 connect to xff
Database Connection Information
Database server = DB2/LINUX 9.5.9
SQL authorization ID = DB2INST1
Local database alias = XFF
[db2inst1@xifenfei ~]$ db2 "select count(*) from t_03xff"
1
-----------
370
1 record(s) selected.
发表在 DB2
评论关闭
DB2备份恢复(增量备份与恢复)
全备数据库
[db2inst1@xifenfei ~]$ db2 backup db xff online to /tmp include logs
Backup successful. The timestamp for this backup image is : 20120411181918
[db2inst1@xifenfei ~]$ db2 list history backup all for xff
List History File for xff
Number of matching file entries = 1
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20120411181918001 N D S0000015.LOG S0000015.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP XFF ONLINE
Start Time: 20120411181918
End Time: 20120411181925
Status: A
----------------------------------------------------------------------------
EID: 27 Location: /tmp
修改数据
[db2inst1@xifenfei ~]$ db2 list tables
Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
T_XFF DB2INST1 T 2012-04-05-09.45.29.148434
T_XIFENFEI DB2INST1 T 2012-04-06-05.50.11.111469
T_XIFENFEI01 DB2INST1 T 2012-04-11-16.55.51.853649
3 record(s) selected.
[db2inst1@xifenfei ~]$ db2 "drop table t_xff"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 "drop table t_xifenfei"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 "drop table t_xifenfei01"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 "create table t_01xff like syscat.tables"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 "insert into t_01xff select * from syscat.tables"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 "select count(*) from t_01xff"
1
-----------
370
1 record(s) selected.
[db2inst1@xifenfei ~]$ db2 list tables
Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
T_01XFF DB2INST1 T 2012-04-11-18.23.05.723478
1 record(s) selected.
增量备份SQL2426N解决
[db2inst1@xifenfei ~]$ db2 backup db xff online incremental to /tmp
SQL2426N The database has not been configured to allow the incremental backup
operation. Reason code = "1".
[db2inst1@xifenfei ~]$ db2 ? SQL2426N
SQL2426N The database has not been configured to allow the incremental
backup operation. Reason code = "<reason-code>".
Explanation:
Incremental backups are not enabled for a table space until after
modification tracking has been activated for the database and a
non-incremental backup has been performed on the table space.
Possible reason codes:
1. The configuration parameter TRACKMOD has not been set for the
database.
2. The TRACKMOD configuration parameter has been set but at least one
table space has not had a non-incremental backup taken since the
TRACKMOD parameter was set.
User response:
The action is based on the reason code as follows:
1. Activate modification tracking for the database by setting the
TRACKMOD database configuration parameter to on, then perform a full
database backup.
2. Consult the db2diag.log file to determine the name of the table
space, then perform a full backup of that table space.
[db2inst1@xifenfei ~]$ db2 get db cfg for xff|grep TRACKMOD
Track modified pages (TRACKMOD) = NO
[db2inst1@xifenfei ~]$ db2 update db cfg for xff using TRACKMOD ON
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, the database
must be shutdown and reactivated before the configuration parameter changes
become effective.
[db2inst1@xifenfei ~]$ db2stop force
04/11/2012 17:49:59 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
[db2inst1@xifenfei ~]$ db2start
04/11/2012 17:50:09 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
累积增量备份
[db2inst1@xifenfei ~]$ db2 backup db xff online incremental to /tmp
Backup successful. The timestamp for this backup image is : 20120411182708
[db2inst1@xifenfei ~]$ db2 list history backup all for xff
List History File for xff
Number of matching file entries = 2
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20120411181918001 N D S0000015.LOG S0000015.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP XFF ONLINE
Start Time: 20120411181918
End Time: 20120411181925
Status: A
----------------------------------------------------------------------------
EID: 27 Location: /tmp
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20120411182708001 O D S0000017.LOG S0000017.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP XFF ONLINE
Start Time: 20120411182708
End Time: 20120411182712
Status: A
----------------------------------------------------------------------------
EID: 33 Location: /tmp
再次修改数据
[db2inst1@xifenfei ~]$ db2 "create table t_02xff like syscat.tables"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 "insert into t_02xff select * from syscat.tables"
DB20000I The SQL command completed successfully.
[db2inst1@xifenfei ~]$ db2 list tables
Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
T_01XFF DB2INST1 T 2012-04-11-18.23.05.723478
T_02XFF DB2INST1 T 2012-04-11-18.30.26.639326
2 record(s) selected.
[db2inst1@xifenfei ~]$ db2 "select count(*) from t_02xff"
1
-----------
371
1 record(s) selected.
迭代备份
[db2inst1@xifenfei ~]$ db2 backup db xff online incremental delta to /tmp
Backup successful. The timestamp for this backup image is : 20120411183129
[db2inst1@xifenfei ~]$ ll /tmp/XFF*
-rw------- 1 db2inst1 db2iadm1 122044416 Apr 11 18:19 /tmp/XFF.0.db2inst1.NODE0000.CATN0000.20120411181918.001
-rw------- 1 db2inst1 db2iadm1 55128064 Apr 11 18:27 /tmp/XFF.0.db2inst1.NODE0000.CATN0000.20120411182708.001
-rw------- 1 db2inst1 db2iadm1 55128064 Apr 11 18:31 /tmp/XFF.0.db2inst1.NODE0000.CATN0000.20120411183129.001
--这里可以看出最近一次的增量备份和迭代备份备份文件大小相同,说明迭代备份是在最近一次增量备份基础之上进行
[db2inst1@xifenfei ~]$ db2 list history backup all for xff
List History File for xff
Number of matching file entries = 3
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20120411181918001 N D S0000015.LOG S0000015.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP XFF ONLINE
Start Time: 20120411181918
End Time: 20120411181925
Status: A
----------------------------------------------------------------------------
EID: 27 Location: /tmp
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20120411182708001 O D S0000017.LOG S0000017.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP XFF ONLINE
Start Time: 20120411182708
End Time: 20120411182712
Status: A
----------------------------------------------------------------------------
EID: 33 Location: /tmp
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20120411183129001 E D S0000019.LOG S0000019.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP XFF ONLINE
Start Time: 20120411183129
End Time: 20120411183133
Status: A
----------------------------------------------------------------------------
EID: 36 Location: /tmp
还原数据库
[db2inst1@xifenfei ~]$ db2 restore db xff incremental automatic from /tmp taken at 20120411183129 SQL2539W Warning! Restoring to an existing database that is the same as the backup image database. The database files will be deleted. Do you want to continue ? (y/n) y DB20000I The RESTORE DATABASE command completed successfully.
尝试登陆数据库
[db2inst1@xifenfei ~]$ db2 connect to xff SQL1117N A connection to or activation of database "XIFENFEI" cannot be made because of ROLL-FORWARD PENDING. SQLSTATE=57019 --数据库需要前滚,因为是在线备份
恢复数据库
[db2inst1@xifenfei ~]$ db2 "rollforward db xff to end of logs and stop"
Rollforward Status
Input database alias = xff
Number of nodes have returned status = 1
Node number = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000019.LOG - S0000019.LOG
Last committed transaction = 2012-04-11-10.31.30.000000 UTC
DB20000I The ROLLFORWARD command completed successfully.
验证恢复过程
[db2inst1@xifenfei ~]$ db2 connect to xff
Database Connection Information
Database server = DB2/LINUX 9.5.9
SQL authorization ID = DB2INST1
Local database alias = XFF
[db2inst1@xifenfei ~]$ db2 list tables
Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
T_01XFF DB2INST1 T 2012-04-11-18.23.05.723478
T_02XFF DB2INST1 T 2012-04-11-18.30.26.639326
2 record(s) selected.
[db2inst1@xifenfei ~]$ db2 "select count(*) from t_01xff"
1
-----------
370
1 record(s) selected.
[db2inst1@xifenfei ~]$ db2 "select count(*) from t_02xff"
1
-----------
371
1 record(s) selected.
本篇主要测试了增量备份和数据库恢复,在下篇中将对不完全恢复进行测试,坚持逐步学习db2数据库相关知识
发表在 DB2
评论关闭

加我微信(17813235971)
加我QQ(107644445)

