【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 level 0 datafile backupset
channel ch00: specifying datafile(s) in backupset
including current control file in backupset
channel ch00: starting piece 1 at 13-JUN-11
 
--ch01关于system01.dbf和tbs_1.dbf的备份结束。备份集是bk_10_1_753725520 ,耗时4分01秒。
channel ch01: finished piece 1 at 13-JUN-11
piece handle=bk_10_1_753725520 tag=HOT_DB_BK_LEVEL0 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch01: backup set complete, elapsed time: 00:04:01
 
--ch01开始关于spfile的备份,注意这里,这里是我们需要的spfile所在备份集的信息。
channel ch01: starting incremental level 0 datafile backupset
channel ch01: specifying datafile(s) in backupset
including current SPFILE in backupset
channel ch01: starting piece 1 at 13-JUN-11
 
 
--ch00关于控制文件备份结束。备份集是bk_11_1_753725696 ,耗时1分41秒。
channel ch00: finished piece 1 at 13-JUN-11
piece handle=bk_11_1_753725696 tag=HOT_DB_BK_LEVEL0 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch00: backup set complete, elapsed time: 00:01:41
 
--ch00关于spfile备份结束。备份集是bk_12_1_753725761 ,耗时1分21秒。这里是我们spfile备份所处的备份集。
channel ch01: finished piece 1 at 13-JUN-11
piece handle=bk_12_1_753725761 tag=HOT_DB_BK_LEVEL0 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch01: backup set complete, elapsed time: 00:01:21
Finished backup at 13-JUN-11

因此,利用上述信息进行spfile的还原:

RMAN> run
2> {
allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=sg2ts001, NB_ORA_CLIENT=sg2as059';
restore spfile from 'bk_12_1_753725761';
release channel ch00; 
}3> 4> 5> 6> 7> 
 
allocated channel: ch00
channel ch00: sid=39 devtype=SBT_TAPE
channel ch00: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
sent command to channel: ch00
 
Starting restore at 14-JUN-11
 
channel ch00: autobackup found: bk_12_1_753725761
channel ch00: SPFILE restore from autobackup complete
Finished restore at 14-JUN-11
 
released channel: ch00
 
RMAN>

注,关于上述的client和server的信息,可以根据bp.conf 文件来确定:

sg2as059:/usr/openv/netbackup>cat bp.conf 
SERVER = sg2ts001
CLIENT_NAME = sg2as059
CLIENT_READ_TIMEOUT = 1800

在此过程中,可以在nbu的控制台看是否已经restore操作。
也可以另开窗口,看到该rman的等待事件是sbtrestore。
另外,也可以看nbu的log,如果没有新log产生,说明备份还停留在rman部分,没传递给NBU。

Restore started Sat Jun 18 21:51:36 2011
 
 
21:51:53 (342183.xxx) Restore job id 342183 will require 1 image.
--可以看到是条码为SG2097的磁带用于恢复。
21:51:53 (342183.xxx) Media id SG2097 is needed for the restore.
 
21:51:58 (342183.001) Restoring from image created 06/13/11 16:38:23
21:52:03 (342183.001) INF - Data socket = sg2as041.sg2.michelin.com.IPC:/tmp/vnet-51486308405120999841000000000-pYqfUa;447c375effa3496638d871ada708993a;4;300
21:52:03 (342183.001) INF - Name socket = sg2as041.sg2.michelin.com.IPC:/tmp/vnet-62398308405121400308000000000-q5uhUa;68faa96764e5b101e55fcebbe7e82816;4;300
21:52:03 (342183.001) INF - Job id = 342183
21:52:03 (342183.001) INF - Backup id = sg2as059_1307954303
21:52:04 (342183.001) INF - Backup time = 1307954303
--等待mount磁带
21:52:04 (342183.001) INF - Waiting for mount of media id SG2097 on server sg2ts001 for reading.
21:52:04 (342183.001) INF - Policy name = sg2as059_oracle_nbutest_backup
21:52:04 (342183.001) INF - Snapshot = 0
21:52:04 (342183.001) INF - Frozen image = 0
21:52:04 (342183.001) INF - Backup copy = 0
21:52:05 (342183.001) INF - Master server = sg2ts001
21:52:05 (342183.001) INF - Media server = sg2ts001
21:52:05 (342183.001) INF - New data socket = sg2as041.sg2.michelin.com.IPC:/tmp/vnet-18016308405119598273000000000-nUIgaa;17e13638af10f48600d99cc9777b3919;4;300
21:52:05 (342183.001) INF - Encrypt = 0
21:52:05 (342183.001) INF - Use shared memory = 0
21:52:06 (342183.001) INF - Restore id = 342183.001
21:52:06 (342183.001) INF - Encrypt = 0
21:52:06 (342183.001) INF - Client read timeout = 300
21:52:06 (342183.001) INF - Media mount timeout = 600
21:52:06 (342183.001) INF - client = sg2as059
21:52:07 (342183.001) INF - requesting_client = sg2as059
21:52:07 (342183.001) INF - browse_client = sg2as059
--在定位SG2097磁带上的备份集。
21:52:54 (342183.001) INF - Waiting for positioning of media id SG2097 on server sg2ts001 for reading.
--从磁带上还原。
21:53:33 (342183.001) INF - Beginning restore from server sg2ts001 to client sg2as059.
21:53:40 /bk_12_1_753725761
21:53:40 /bk_12_1_753725761
21:53:43 (342183.001) Status of restore from image created 06/13/11 16:38:23 = the requested operation was successfully completed
--注意上面这条log结束后,rman端才会返回本次restore成功或者失败的结果。
 
21:53:45 INF - Server status = 0
21:53:45 (342183.xxx) INF - Status = the requested operation was successfully completed.

还原spfile后,关闭原来的dummy数据库,正常启动数据库。

场景二:丢失控制文件。
丢失控制文件的场景和丢失spfile类似,而且步骤根据简单一些,不需要启动dummy数据库,根据log选择控制文件。

数据库需要启动到nomount状态:

oracle@sg2as059:/u01/app/oracle/OraHome1/dbs> rman target /
 
Recovery Manager: Release 10.2.0.3.0 - Production on Sat Jun 18 22:23:27 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
connected to target database: test (not mounted)
 
RMAN> 
 
RMAN> run
2> {
allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=sg2ts001, NB_ORA_CLIENT=sg2as059';
restore controlfile from 'cntrl_15_1_753725973' ;
release channel ch00; 
}3> 4> 5> 6> 7> 
 
using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: sid=46 devtype=SBT_TAPE
channel ch00: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
sent command to channel: ch00
 
Starting restore at 18-JUN-11
 
channel ch00: restoring control file
channel ch00: restore complete, elapsed time: 00:02:38
output filename=/u01/test/control01.ctl
Finished restore at 18-JUN-11
 
released channel: ch00
 
RMAN>

还原控制文件之后,resetlogs启动数据库。

SQL> alter database mount;
 
Database altered.
 
 
SQL> 
SQL> recover database using BACKUP CONTROLFILE  until cancel;
ORA-00279: change 346227 generated at 06/13/2011 16:17:36 needed for thread 1
ORA-00289: suggestion : /u07/test/arch/1_13_753371123.dbf
ORA-00280: change 346227 for thread 1 is in sequence #13
 
 
Specify log: {
< RET > =suggested | filename | AUTO | CANCEL}
/u07/test/oradata/redo01.log
Log applied.
Media recovery complete.
 
SQL> 
SQL> alter database open resetlogs;
 
Database altered.
 
SQL>

场景三:丢失数据文件

SQL> startup mount; 
ORACLE instance started.
 
Total System Global Area  314572800 bytes
Fixed Size                  2072552 bytes
Variable Size             150994968 bytes
Database Buffers          155189248 bytes
Redo Buffers                6316032 bytes
Database mounted.
SQL> 
SQL> 
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/u07/test/oradata/tbs_1.dbf'
 
 
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
oracle@sg2as059:/u07/test/oradata> 
oracle@sg2as059:/u07/test/oradata> rman target /
 
Recovery Manager: Release 10.2.0.3.0 - Production on Sat Jun 18 22:51:43 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
connected to target database: TEST (DBID=2051517555, not open)
 
RMAN> 
 
RMAN> 
 
RMAN> 
 
RMAN> run
2> {
allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=sg2ts001, NB_ORA_CLIENT=sg2as059';
restore datafile 4;
release channel ch00; 
}3> 4> 5> 6> 7> 
 
allocated channel: ch00
channel ch00: sid=46 devtype=SBT_TAPE
channel ch00: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
sent command to channel: ch00
 
Starting restore at 18-JUN-11
 
channel ch00: starting datafile backupset restore
channel ch00: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /u07/test/oradata/tbs_1.dbf
channel ch00: reading from backup piece bk_10_1_753725520
channel ch00: restored backup piece 1
piece handle=bk_10_1_753725520 tag=HOT_DB_BK_LEVEL0
channel ch00: restore complete, elapsed time: 00:02:15
Finished restore at 18-JUN-11
 
released channel: ch00
 
RMAN> 
 
RMAN> 
 
RMAN> run
2> {
allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=sg2ts001, NB_ORA_CLIENT=sg2as059';
recover datafile 4;
release channel ch00; 
}3> 4> 5> 6> 7> 
 
allocated channel: ch00
channel ch00: sid=46 devtype=SBT_TAPE
channel ch00: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
sent command to channel: ch00
 
Starting recover at 18-JUN-11
 
starting media recovery
media recovery complete, elapsed time: 00:00:02
 
Finished recover at 18-JUN-11
 
released channel: ch00
 
RMAN> exit
 
 
Recovery Manager complete.
oracle@sg2as059:/u07/test/oradata> 
oracle@sg2as059:/u07/test/oradata> 
oracle@sg2as059:/u07/test/oradata> sqlplus "/ as sysdba"
 
SQL*Plus: Release 10.2.0.3.0 - Production on Sat Jun 18 22:57:07 2011
 
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
 
SQL> select status from v$instance;
 
STATUS
------------
MOUNTED
 
SQL> alter database open;
 
Database altered.
 
SQL>

场景四:丢失redo log.
由于redolog不在rman备份范围之内,因此在做恢复的过程不需要nbu的参与,只是常规恢复。
如果丢失的redolog不含active或者current的redo,用recover database until cancel+resetlogs打开;
如果丢失的是active或者current的redo,就需要用_allow_resetlogs_corruption的隐含参数+resetlogs打开。
这里不展开叙述。

场景五:丢失全部文件(控制文件数据文件和日志文件)。
注意会自动restore arch,需要留心arch目录的大小。

oracle@sg2as059:/u01/app/oracle> export ORACLE_SID=test
oracle@sg2as059:/u01/app/oracle> 
oracle@sg2as059:/u01/app/oracle> 
oracle@sg2as059:/u01/app/oracle> rman target /
 
Recovery Manager: Release 10.2.0.3.0 - Production on Sat Jun 18 23:48:54 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
connected to target database (not started)
 
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> run
2> {
allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=sg2ts001, NB_ORA_CLIENT=sg2as059';
restore spfile from 'bk_12_1_753725761';
release channel ch00; 
}3> 4> 5> 6> 7> 
 
using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: sid=36 devtype=SBT_TAPE
channel ch00: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
sent command to channel: ch00
 
Starting restore at 18-JUN-11
 
channel ch00: autobackup found: bk_12_1_753725761
channel ch00: SPFILE restore from autobackup complete
Finished restore at 18-JUN-11
 
released channel: ch00
 
RMAN> exit
 
 
Recovery Manager complete.
oracle@sg2as059:/u01/app/oracle> export ORACLE_SID=test
oracle@sg2as059:/u01/app/oracle> sqlplus "/ as sysdba"
 
SQL*Plus: Release 10.2.0.3.0 - Production on Sat Jun 18 23:52:07 2011
 
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
 
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
 
Total System Global Area  314572800 bytes
Fixed Size                  2072552 bytes
Variable Size             130023448 bytes
Database Buffers          176160768 bytes
Redo Buffers                6316032 bytes
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
oracle@sg2as059:/u01/app/oracle> 
oracle@sg2as059:/u01/app/oracle> rman target /
 
Recovery Manager: Release 10.2.0.3.0 - Production on Sat Jun 18 23:52:27 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
connected to target database: test (not mounted)
 
RMAN> run
2> {
allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=sg2ts001, NB_ORA_CLIENT=sg2as059';
restore controlfile from 'cntrl_15_1_753725973' ;
release channel ch00; 
}3> 4> 5> 6> 7> 
 
using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: sid=46 devtype=SBT_TAPE
channel ch00: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
sent command to channel: ch00
 
Starting restore at 18-JUN-11
 
channel ch00: restoring control file
channel ch00: restore complete, elapsed time: 00:01:08
output filename=/u01/test/control01.ctl
Finished restore at 18-JUN-11
 
released channel: ch00
 
RMAN> 
 
RMAN> run
2> {
allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=sg2ts001, NB_ORA_CLIENT=sg2as059';
restore database;
recover database;
release channel ch00; 
}3> 4> 5> 6> 7> 8> 
 
allocated channel: ch00
channel ch00: sid=46 devtype=SBT_TAPE
channel ch00: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
sent command to channel: ch00
 
Starting restore at 18-JUN-11
released channel: ch00
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/18/2011 23:58:07
ORA-01507: database not mounted
 
RMAN> sql'alter database mount';
 
sql statement: alter database mount
 
RMAN> run
2> {
allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=sg2ts001, NB_ORA_CLIENT=sg2as059';
restore database;
recover database;
release channel ch00; 
}3> 4> 5> 6> 7> 8> 
 
allocated channel: ch00
channel ch00: sid=46 devtype=SBT_TAPE
channel ch00: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
sent command to channel: ch00
 
Starting restore at 18-JUN-11
 
channel ch00: starting datafile backupset restore
channel ch00: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /u07/test/oradata/undotbs01.dbf
restoring datafile 00003 to /u07/test/oradata/sysaux01.dbf
channel ch00: reading from backup piece bk_9_1_753725520
channel ch00: restored backup piece 1
piece handle=bk_9_1_753725520 tag=HOT_DB_BK_LEVEL0
channel ch00: restore complete, elapsed time: 00:02:35
channel ch00: starting datafile backupset restore
channel ch00: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u07/test/oradata/system01.dbf
restoring datafile 00004 to /u07/test/oradata/tbs_1.dbf
channel ch00: reading from backup piece bk_10_1_753725520
channel ch00: restored backup piece 1
piece handle=bk_10_1_753725520 tag=HOT_DB_BK_LEVEL0
channel ch00: restore complete, elapsed time: 00:01:05
Finished restore at 19-JUN-11
 
Starting recover at 19-JUN-11
 
starting media recovery
 
channel ch00: starting archive log restore to default destination
channel ch00: restoring archive log
archive log thread=1 sequence=12
channel ch00: reading from backup piece al_14_1_753725861
channel ch00: restored backup piece 1
piece handle=al_14_1_753725861 tag=TAG20110613T161737
channel ch00: restore complete, elapsed time: 00:01:06
channel ch00: starting archive log restore to default destination
channel ch00: restoring archive log
archive log thread=1 sequence=11
channel ch00: reading from backup piece al_13_1_753725861
channel ch00: restored backup piece 1
piece handle=al_13_1_753725861 tag=TAG20110613T161737
channel ch00: restore complete, elapsed time: 00:01:05
archive log filename=/u07/test/arch/1_11_753371123.dbf thread=1 sequence=11
archive log filename=/u07/test/arch/1_12_753371123.dbf thread=1 sequence=12
archive log filename=/u07/test/arch/1_13_753371123.dbf thread=1 sequence=13
media recovery complete, elapsed time: 00:00:05
Finished recover at 19-JUN-11
 
released channel: ch00
 
RMAN> exit
 
 
Recovery Manager complete.
oracle@sg2as059:/u01/app/oracle> sqlplus "/ as sysdba"
 
SQL*Plus: Release 10.2.0.3.0 - Production on Sun Jun 19 00:07:11 2011
 
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
 
SQL> select status from v$instance;
 
STATUS
------------
MOUNTED
 
SQL> alter database open noresetlogs;
alter database open noresetlogs
*
ERROR at line 1:
ORA-01588: must use RESETLOGS option for database open
 
 
SQL> alter database open resetlogs;
 
Database altered.
 
SQL> 
SQL> exit

【Trouble shooting】
一、恢复时,如果用parms来传递环境变量时会报错sbtinfo2,解决方法是用send,而不是parms:

RMAN> run 
2> {
allocate channel t1 type 'SBT_TAPE' 
parms="ENV=(NB_ORA_SERV= sg2ts001)";
restore spfile from 'bk_12_1_753725761';
release channel ch00;
}3> 4> 5> 6> 7> 
 
allocated channel: t1
channel t1: sid=36 devtype=SBT_TAPE
channel t1: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
Starting restore at 16-JUN-11
 
released channel: t1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/16/2011 17:47:30
ORA-27191: sbtinfo2 returned error
Additional information: 2
 
RMAN>

二、恢复spfile时,如果用from autobackup,会挂死,NBU找磁带会非常慢。该rman的等待事件是sbtinfo2。解决方法是指明from某个备份集文件,这就要到备份的log中去找了。

RMAN> run
2> {
allocate channel t1 type 'SBT_TAPE';
restore spfile from autobackup;
release channel t1;
}3> 4> 5> 6> 
 
allocated channel: t1
channel t1: sid=36 devtype=SBT_TAPE
channel t1: VERITAS NetBackup for Oracle - Release 6.0 (2006031019)
 
Starting restore at 14-JUN-11
 
channel t1: looking for autobackup on day: 20110614
 
 
 
 
 
^C
user interrupt received
 
released channel: t1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/14/2011 17:44:19
ORA-03111: break received on communication channel
 
RMAN>

此时去看等待事件:

1* select event,status,program from v$session where program like '%rman%'
SQL> /
 
EVENT                                                            STATUS
---------------------------------------------------------------- --------
PROGRAM
------------------------------------------------
Backup: sbtinfo2                                                 ACTIVE
rman@sg2as059 (TNS V1-V3)
 
SQL*Net message from client                                      INACTIVE
rman@sg2as059 (TNS V1-V3)
 
SQL*Net message from client                                      INACTIVE
rman@sg2as059 (TNS V1-V3)
 
 
SQL> 
SQL>

你可能感兴趣的:(oracle,职场,备份恢复,休闲,NetBackup)