NBU5240备份系统还原数据库---Windows版

NBU5240是一个基于系统文件和多种数据库备份的灾备系统,灵活性比较高。下面具体记录如何利用该系统的备份文件进行数据库还原。(基于业务场景)

公司某业务部门突然发现前台系统数据有异常,已经是几天前的跑出来的数据了,要求IT部门后台核实。FP系统前台数据利用测试机返回到13号中午跑完的时间。

数据库也要相应的返回到13号下午的数据。系统对于FP数据库是周六全备,周日不做备份策略,其他时间均为差异备份。客户端做的一系列还原操作都要安装NBU客户端工具读取主服务器上的备份文件,因为惯例用主机名称,所以要做好的HOSTS文件的识别(IP-HOSTNAME)。

C:\Users\Administrator>bplist -C zhnsdfp -s 2017-6-13 -e 2017-6-15 -k oracle_zhn
sdfp_0_97_seinescm_arch -t 4 -R -b -l  / |findstr "cnt"
-rw------- SYSTEM    SYSTEM       16252928 Jun 15 02:21 cntrl_1214_1_946693032:\

-rw------- SYSTEM    SYSTEM       16252928 Jun 14 02:49 cntrl_1202_1_946608342:\

-rw------- SYSTEM    SYSTEM       16252928 Jun 13 02:40 cntrl_1182_1_946521390:\

因为要求的是返回中午14-15点的数据库,所以控制文件的备份时间要晚于这个点,即取14号凌晨2点备份的控制文件

基于Windows平台,要先创建一个实例,实例名可以根据你自己命名,Liunx平台可以直接创建一个pfile文件启动到nomount状态

Windows平台下创建好实例后,调整归档模式及目录,关闭数据库后可以将除了参数文件的其他数据库文件通通删掉。

接着将数据库启动到NOMOUNT状态,利用RMAN脚本还原控制文件

还原好控制文件后,将数据库启动到mount状态,进行数据库还原到13号restore要加具体的时间点,下面漏了具体的时分秒,基于具体时间点的恢复,还原数据文件也要指定上(YYYY/MM/DD HH24:MI:SS)

 还原好数据库之后,根据时间带出归档日志序列还原归档文件

alter session set nls_date_format='YYYYMMDD HH24:MI:SS';
set linesize 160;
set pagesize;

select THREAD#,SEQUENCE#,FIRST_TIME,COMPLETION_TIME from v$archived_log
where  COMPLETION_TIME>to_date('20170613 14:00:00','yyyymmdd hh24:mi:ss')
and    COMPLETION_TIME<to_date('20170613 15:00:00','yyyymmdd hh24:mi:ss') order by SEQUENCE#;

恢复归档文件

还原完归档日志文件后利用控制文件进行数据库恢复,将数据库恢复到13号下午14:20分

这里报找不到归档日志序列109672的错误信息,在困惑了好久之后突然想起该数据库的备份策略,周六全备,其他皆差异备份,所以需要还原全备以来的归档日志文件,

从日志序列109672到110181;

 还原完后,再次进行数据库恢复

恢复过程将回检索全备以来的归档日志到指定恢复时间的日志序列号,完成介质恢复后,用resetlogs模式打开数据库。

 

SYS@seinescm>alter database open resetlogs;

数据库已更改。

SYS@seinescm>select status from v$instance;

STATUS
------------------------
OPEN

SYS@seinescm>archive log list
数据库日志模式            存档模式
自动存档             启用
存档终点            M:\test
最早的联机日志序列     1
下一个存档日志序列   2
当前日志序列           2
SYS@seinescm>

转载于:https://www.cnblogs.com/guipeng/p/7095623.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Legal Notice Copyright © 2017 Veritas Technologies LLC. All rights reserved. Veritas and the Veritas Logo are trademarks or registered trademarks of Veritas Technologies LLC or its affiliates in the U.S. and other countries. Other names may be trademarks of their respective owners. This product may contain third party software for which Veritas is required to provide attribution to the third party (“Third Party Programs”). Some of the Third Party Programs are available under open source or free software licenses. The License Agreement accompanying the Software does not alter any rights or obligations you may have under those open source or free software licenses. Please see the Third Party Legal Notice Appendix to this Documentation or TPIP ReadMe File accompanying this product for more information on the Third Party Programs. The product described in this document is distributed under licenses restricting its use, copying, distribution, and decompilation/reverse engineering. No part of this document may be reproduced in any form by any means without prior written authorization of Veritas Technologies LLC and its licensors, if any. THE DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. VERITAS TECHNOLOGIES LLC SHALL NOT BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION CONTAINED IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE. The Licensed Software and Documentation are deemed to be commercial computer software as defined in FAR 12.212 and subject to restricted rights as defined in FAR Section 52.227-19 "Commercial Computer Software - Restricted Rights" and DFARS 227.7202, et seq. "Commercial Computer Software and Commercial Computer Software Documentation," as applicable, and any successor regulations, whether delivered by Veritas as on premises or hosted services. Any use, modification, reproduction release, performance, display or disclosure of the Licensed Software and Documentation by the U.S. Government shall be solely in accordance with the terms of this Agreement.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值