使用NBU恢复informix数据库

在对数据库恢复之前,需要保证数据库的安装程序、环境变量,原数据库的所有数据文件以及日志空间的名字、容量、权限与恢复之前相同。

onbar -r -p dbspace_name
恢复全部数据文件,但不做逻辑日志的恢复和应用,也可以只恢复某表空间

onbar -r –l
在前一个命令的基础上,做逻辑日志恢复

onbar -r [dbspace_name]
恢复全部数据文件,包括逻辑日志的恢复和应用,也可以只恢复某表空间

onbar -r -t time -w –p
整体数据库的时间点的恢复。

如果数据库全部损坏,则需要恢复如下文件:
根据您的备份规划,您可以执行如下通过管理页面执行:
进入恢复页面:/usr/openv/netbackup/bin/jbpSA &
选择你要恢复的数据库备份文件 $INFORMIXDIR/etc/ 等
如果恢复时有未曾备份的逻辑日志,则需要拯救当前的日志文件:
onbar -l -s
然后执行:
onbar -r
恢复过程中,都可以查看恢复日志 bar_act.log

如主机宕机,在环境一样的备机上进行全库的实例恢复:
确认informix处于关闭状态
$ onstat -
shared memory not initialized for INFORMIXSERVER 'xxx_tcp'
设置请求恢复的数据源为xxx主机的备份集
$ export INFXBSA_CLIENT=xxx
进行onbar恢复,根据需要使用onbar参数
$ onbar -r -w -p

开始恢复后在NBU Admin Console(jnbSA&)可以看到恢复任务
同时查看日志

cd db/informix/tmp

tail -f bar_act.log

-c  Use compression dictionary to expand compressed data
-q  Do not display program header
-b  Display information about logged BLOB pages
-u  Display the specified user(s)
-t  Display the specified TBLspace(s)
-x  Display the specified transaction(s)

2015-01-31 01:16:30 23285 23283 /home/db/informix/bin/onbar_d complete, returning 149
(0x95)
2015-01-31 01:32:40 6762 6760 /home/db/informix/bin/onbar_d -r -w -p
2015-01-31 01:32:40 6762 6760 Working with veritas-netbackup as generic storage
manager.
2015-01-31 01:32:41 6762 6760 Successfully connected to Storage Manager.
2015-01-31 01:36:28 6762 6760 Begin reserved pages restore (level 0 of rootdbs, Storage
Manager copy ID: 1 1422538816).
2015-01-31 01:36:38 6762 6760 Completed reserved pages restore (level 0 of rootdbs).
2015-01-31 01:36:40 6762 6760 (-43341) Logical log 28621 is needed by this restore but
cannot be found in OnBar ixbar file.
2015-01-31 01:36:40 6762 6760 Successfully connected to Storage Manager.
2015-01-31 01:40:50 6762 6760 Begin cold level 0 restore rootdbs (Storage Manager copy
ID: 1 1422538816).
2015-01-31 01:41:11 6762 6760 Completed cold level 0 restore rootdbs.
2015-01-31 01:43:42 6762 6760 Begin cold level 0 restore blobdbs (Storage Manager copy
ID: 1 1422539009).
2015-01-31 01:43:52 6762 6760 Completed cold level 0 restore blobdbs.
2015-01-31 01:46:37 6762 6760 Begin cold level 0 restore ywdattbs02 (Storage Manager
copy ID: 1 1422539175).
2015-01-31 01:49:07 6762 6760 Completed cold level 0 restore ywdattbs02.
2015-01-31 01:51:33 6762 6760 Begin cold level 0 restore ywdattbs08 (Storage Manager
copy ID: 1 1422540977).
2015-01-31 01:53:51 6762 6760 Completed cold level 0 restore ywdattbs08.
2015-01-31 01:56:27 6762 6760 Begin cold level 0 restore ywdattbs04 (Storage Manager
copy ID: 1 1422542465).
2015-01-31 01:58:44 6762 6760 Completed cold level 0 restore ywdattbs04.
2015-01-31 02:01:25 6762 6760 Begin cold level 0 restore ywdattbs07 (Storage Manager
copy ID: 1 1422543766).
2015-01-31 02:03:31 6762 6760 Completed cold level 0 restore ywdattbs07.
2015-01-31 02:05:56 6762 6760 Begin cold level 0 restore ywdattbs01 (Storage Manager
copy ID: 1 1422545053).
2015-01-31 02:08:01 6762 6760 Completed cold level 0 restore ywdattbs01.
2015-01-31 02:10:27 6762 6760 Begin cold level 0 restore ywdattbs03 (Storage Manager
copy ID: 1 1422546320).
2015-01-31 02:12:31 6762 6760 Completed cold level 0 restore ywdattbs03.
2015-01-31 02:14:41 6762 6760 Begin cold level 0 restore data0tbs01 (Storage Manager
copy ID: 1 1422547639).
2015-01-31 02:16:45 6762 6760 Completed cold level 0 restore data0tbs01.
2015-01-31 02:19:16 6762 6760 Begin cold level 0 restore ywdattbs05 (Storage Manager
copy ID: 1 1422548920).
2015-01-31 02:21:14 6762 6760 Completed cold level 0 restore ywdattbs05.
2015-01-31 02:23:05 6762 6760 Begin cold level 0 restore ywdattbs06 (Storage Manager
copy ID: 1 1422550196).
2015-01-31 02:25:06 6762 6760 Completed cold level 0 restore ywdattbs06.
2015-01-31 02:27:32 6762 6760 Begin cold level 0 restore indextbs01 (Storage Manager
copy ID: 1 1422551385).
2015-01-31 02:29:12 6762 6760 Completed cold level 0 restore indextbs01.
2015-01-31 02:30:57 6762 6760 Begin cold level 0 restore logdbs (Storage Manager copy
ID: 1 1422552529).
2015-01-31 02:31:07 6762 6760 Completed cold level 0 restore logdbs.
2015-01-31 02:32:58 6762 6760 Begin cold level 0 restore phydbs (Storage Manager copy
ID: 1 1422552657).
2015-01-31 02:33:08 6762 6760 Completed cold level 0 restore phydbs.
2015-01-31 02:33:10 6762 6760 Completed whole system restore.
2015-01-31 02:33:10 6762 6760 /home/db/informix/bin/onbar_d complete, returning 0
(0x00)

恢复完成后
$ onstat -
Informix Dynamic Server Version -- Fast Recovery -- Up 01:26:21 -- 1816960 Kbytes
执行onmode -m或者进行必要的log回滚,例如onbar -r -l -t
$ onmode -m
$ onstat -
Informix Dynamic Server Version -- Fast Recovery (CKPT REQ) -- Up 01:27:27 -- 1816960 Kbytes
Blocked:CKPT
$ onstat -
Informix Dynamic Server Version -- On-Line -- Up 01:28:49 -- 1816960 Kbytes

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 背景: 阅读新闻 12C CDB模式下RMAN备份与恢复 [日期:2016-11-29] 来源:Linux社区 作...
    阳屯okyepd阅读 9,026评论 0 7
  • 文/碧鲜 众所周知,宋代官员待遇优厚,又有祖宗家法“不杀士大夫”惯例,只要做了官,不盘算着去穿黄龙袍玩,日子过得有...
    碧鲜阅读 5,566评论 0 4
  • 放假的1个月,我想清楚了,我要为自己奋斗一次,如果你不答应,反正咱们以后也不会再见了,想着晚上一定要和你说清楚...
    Waiting775阅读 1,576评论 0 0
  • 会从继续教育培训课上,我无事可做,默默在笔记本上写下简单事项。 考研失败,国考入面,义工厦门,广西师范大学出版社,...
    莫如君阅读 2,761评论 0 0

友情链接更多精彩内容