RMAN恢复简单实验

一、恢复初始化参数文件:

1、自动备份还原

1)关闭数据库并启动到nomount阶段

SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  939495424 bytes
Fixed Size            2258840 bytes
Variable Size          599787624 bytes
Database Buffers      331350016 bytes
Redo Buffers            6098944 bytes

2)指定DBID

RMAN> set dbid=4033362200;
executing command: SET DBID

3)在数据库是使用spfile启动时,使用如下语句会报错,必须使用to来指定另外一个路径(使用pfile启动可解决如下错误)

RMAN> restore spfile from autobackup;

Starting restore at 09-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/09/2016 19:34:28
RMAN-06564: must use the TO clause when the instance is started with SPFILE

4)使用to关键词来指定恢复spfile路径

RMAN> restore spfile to '/u01/spfileneal.ora' from autobackup;

Starting restore at 09-MAR-16
using channel ORA_DISK_1

recovery area destination: /u01/oracle/fast_recovery_area
database name (or database unique name) used for search: NEAL
channel ORA_DISK_1: AUTOBACKUP /u01/oracle/fast_recovery_area/NEAL/autobackup/2016_03_09/o1_mf_s_906041673_cfzht9tn_.bkp found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160309
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/oracle/fast_recovery_area/NEAL/autobackup/2016_03_09/o1_mf_s_906041673_cfzht9tn_.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 09-MAR-16

5)发现还原成功

[oracle@cancer u01]$ ll

-rw-r-----  1 oracle oinstall  3584 Mar  9 19:39 spfileneal.ora

2、手动还原

1)数据库启动到mount阶段

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

2)列出含有spfile的备份集

RMAN> list backup o
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值