Netbackup恢复步骤-02
下面我们开始设计一些场景来进行数据库的还原:
场景一:丢失spfile:
如果我们丢失了spfile,我们可以以下方式还原:
1. 用rman连接数据库,注意由于没有spfile,数据库无法启动,需要现在rman下启动一个dummy数据库。另外,由于数据库还未启动都mount状态,因此无法用rman sys/change_on_install@tnsname的方式连接数据库。只能用os鉴权的方式登录。
oracle@sg2as059:/u01/app/oracle/OraHome1/dbs> rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jun 16 17:15:57 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN>
RMAN>
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/OraHome1/dbs/inittest.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2071296 bytes
Variable Size 67110144 bytes
Database Buffers 83886080 bytes
Redo Buffers 6316032 bytes
RMAN>
2.因为要恢复spfile,我要set dbid,由于没有用catalog,我们无法list incarnation,我们只能从备份的log去找dbid,注意log中的以下信息:
connected to target database: TEST (DBID=2051517555)
using target database control file instead of recovery catalog
因此我们获得dbid是2051517555。
RMAN> set dbid 2051517555
executing command: SET DBID
RMAN>
3.restore spfile,注意我们由于是同机恢复,因此写与不写环境变量都没关系;如果是异机恢复,就必须在rman中写上环境变量。在这个例子中,我们写上环境变量来进行恢复。
另外这里注意需要指明是从那个backupset中恢复。我们需要去查备份的log,确定spfile的备份是在哪个备份集中:
--开始分配2个通道,ch00和ch01
allocated channel: ch00
channel ch00: sid=28 devtype=SBT_TAPE
channel ch00: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
allocated channel: ch01
channel ch01: sid=32 devtype=SBT_TAPE
channel ch01: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
--ch00备份sysaux01.dbf和undotbs01.dbf
Starting backup at 13-JUN-11
channel ch00: starting incremental level 0 datafile backupset
channel ch00: specifying datafile(s) in backupset
input datafile fno=00003 name=/u07/test/oradata/sysaux01.dbf
input datafile fno=00002 name=/u07/test/oradata/undotbs01.dbf
----ch00备份开始备份
channel ch00: starting piece 1 at 13-JUN-11
--ch01备份system01.dbf和tbs_1.dbf
channel ch01: starting incremental level 0 datafile backupset
channel ch01: specifying datafile(s) in backupset
input datafile fno=00001 name=/u07/test/oradata/system01.dbf
input datafile fno=00004 name=/u07/test/oradata/tbs_1.dbf
----ch01备份开始备份
channel ch01: starting piece 1 at 13-JUN-11
--ch00关于sysaux01.dbf和undotbs01.dbf的备份结束。备份集是bk_9_1_753725520,耗时2分56秒。
channel ch00: finished piece 1 at 13-JUN-11
piece handle=bk_9_1_753725520 tag=HOT_DB_BK_LEVEL0 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch00: backup set complete, elapsed time: 00:02:56
--ch00开始关于控制文件的备份
channel ch00: starting incremental
相关新闻>>
- 发表评论
-
- 最新评论 更多>>