你好,游客 登录 注册 搜索
背景:
阅读新闻

探索Oracle之RMAN_04非一致性备份

[日期:2012-05-26] 来源:Linux社区  作者:吴伟龙 [字体:大 中 小]

3、因为数据库没有参数文件,起不来,只能能启动到nomount状态

[Oracle@wwldb dbs]$ rman target /

RecoveryManager: Release 10.2.0.1.0 - Production on Wed May 23 17:06:32 2012

Copyright (c)1982, 2005, Oracle.  All rights reserved.

connected totarget database (not started)

 

RMAN> startup force nomount;

startup failed:ORA-01078: failure in processing system parameters

LRM-00109: couldnot open parameter file '/DBSoft/product/10.2.0/db_1/dbs/initWWL.ora'

starting Oracleinstance without parameter file for retrival of spfile

Oracle instancestarted

 

Total System GlobalArea     159383552 bytes

Fixed Size                     1218244 bytes

VariableSize                 58722620 bytes

DatabaseBuffers              92274688 bytes

RedoBuffers                   7168000 bytes

 

RMAN>

 

4、开始恢复参数文件,只有恢复了参数文件和控制文件数据库才能到mount状态来恢复数据文件:

 

RMAN> restorespfile from autobackup;

 

Starting restoreat 23-MAY-12

using targetdatabase control file instead of recovery catalog

allocatedchannel: ORA_DISK_1

channelORA_DISK_1: sid=36 devtype=DISK

 

RMAN-00571:===========================================================

RMAN-00569:=============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571:===========================================================

RMAN-03002:failure of restore command at 05/23/2012 17:08:42

RMAN-06495: mustexplicitly specify DBID with SET DBID command

 

RMAN>

注意:这里有问题了,spfile无法恢复,必须指定DBID。我记得在每次登录到rman的时候都会显示一个数据库的DBID,但是为什么这里要我们指定DBID呢???原因很简单,因为我们登录RMAN的时候,数据库已经宕机了,而且参数文件,控制文件,数据文件都没有了,它到哪里去找DBID;所以需要我们手动来指定,问题是现在既然登录的时候不显示,我们也不知道在哪里呀,如下:

 

[oracle@wwldb dbs]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on WedMay 23 17:06:32 2012

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to targetdatabase (not started)

 

没关系的因为我们的控制文件做了自动备份,在自动备份的控制文件里面已经存在了DBID,我们现在去找找吧,默认就备份在如下位置:

[oracle@wwldb dbs]$ pwd

/DBSoft/product/10.2.0/db_1/dbs

[oracle@wwldb dbs]$ ls

c-5520179-20120518-01  c-5520179-20120523-01  hc_WWL.dat lkWWL

 

其中5520179就是DBID了,我们只需要通过指定这个DBID,就可以将spfile恢复并将数据库启动到mount状态。

 

RMAN> set DBID=5520179

executingcommand: SET DBID

 

RMAN> restore spfile from autobackup;

Starting restoreat 23-MAY-12

using targetdatabase control file instead of recovery catalog

allocatedchannel: ORA_DISK_1

channelORA_DISK_1: sid=39 devtype=DISK

 

channelORA_DISK_1: looking for autobackup on day: 20120523

channelORA_DISK_1: autobackup found: c-5520179-20120523-04

channelORA_DISK_1: SPFILE restore from autobackup complete

Finished restoreat 23-MAY-12

 

RMAN>

 

5、恢复控制文件

RMAN> restore controlfile from autobackup;

 

Starting restoreat 23-MAY-12

using channelORA_DISK_1

 

channelORA_DISK_1: looking for autobackup on day: 20120523

channelORA_DISK_1: autobackup found: c-5520179-20120523-04

channelORA_DISK_1: control file restore from autobackup complete

outputfilename=/DBSoft/product/10.2.0/db_1/dbs/cntrlWWL.dbf

Finished restoreat 23-MAY-12

 

RMAN>

linux
相关资讯       Oracle高级培训 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款