免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2539 | 回复: 0
打印 上一主题 下一主题

nbu能恢复rman里状态为expired的备份集? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-10-25 16:19 |只看该作者 |倒序浏览
RMAN> list backup of database ;

List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10      Incr 0  624.25M    SBT_TAPE    00:01:30     25-OCT-10      
        BP Key: 10   Status: AVAILABLE  Compressed: NO  Tag: TAG20101025T153828
        Handle: df_16_1_733333108   Media:
  List of Datafiles in backup set 10
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5    0  Incr 1316688    25-OCT-10 /opt/oracle/oradata/racdb/ts2a.dbf

RMAN> CROSSCHECK backup;

crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=df_16_1_733333108 recid=10 stamp=733333109
Crosschecked 1 objects

RMAN> list backup of database ;


List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10      Incr 0  624.25M    SBT_TAPE    00:01:30     25-OCT-10      
        BP Key: 10   Status: EXPIRED  Compressed: NO  Tag: TAG20101025T153828
        Handle: df_16_1_733333108   Media:
  List of Datafiles in backup set 10
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5    0  Incr 1316688    25-OCT-10 /opt/oracle/oradata/racdb/ts2a.dbf

SQL> alter tablespace ts2 offline ;

Tablespace altered.

root@sun215a/var/tmp#more ./restore_ts2.ksh
#! /bin/ksh
RMANCMD="
/opt/oracle/bin/rman target sys/manager nocatalog msglog /var/tmp/restore_ts02.log append <<EOF
RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_POLICY=ts02, NB_ORA_SERV=rac97, NB_ORA_CLIENT=sun215vip, NB_ORA_PC_SCHED=ts02';
RESTORE TABLESPACE ts2;
RECOVER TABLESPACE ts2;
RELEASE CHANNEL ch00;
}
EOF
"

restore的log

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Oct 25 16:01:29 2010

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


connected to target database: RACDB (DBID=729837050)
using target database control file instead of recovery catalog

RMAN> 2> 3> 4> 5> 6> 7>
allocated channel: ch00
channel ch00: sid=139 devtype=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.1 (2010101203)

sent command to channel: ch00

Starting restore at 25-OCT-10

creating datafile fno=5 name=/opt/oracle/oradata/racdb/ts2a.dbf
restore not done; all files readonly, offline, or already restored
Finished restore at 25-OCT-10

Starting recover at 25-OCT-10

starting media recovery

archive log thread 1 sequence 155 is already on disk as file /opt/oracle/dbs/arch1_155_732220285.dbf
archive log thread 1 sequence 156 is already on disk as file /opt/oracle/dbs/arch1_156_732220285.dbf
archive log thread 1 sequence 157 is already on disk as file /opt/oracle/dbs/arch1_157_732220285.dbf
archive log thread 1 sequence 158 is already on disk as file /opt/oracle/dbs/arch1_158_732220285.dbf
archive log thread 1 sequence 159 is already on disk as file /opt/oracle/dbs/arch1_159_732220285.dbf
archive log thread 1 sequence 160 is already on disk as file /opt/oracle/dbs/arch1_160_732220285.dbf
archive log thread 1 sequence 161 is already on disk as file /opt/oracle/dbs/arch1_161_732220285.dbf
archive log thread 1 sequence 162 is already on disk as file /opt/oracle/dbs/arch1_162_732220285.dbf
archive log thread 1 sequence 163 is already on disk as file /opt/oracle/dbs/arch1_163_732220285.dbf
archive log thread 1 sequence 164 is already on disk as file /opt/oracle/dbs/arch1_164_732220285.dbf
archive log thread 1 sequence 165 is already on disk as file /opt/oracle/dbs/arch1_165_732220285.dbf
archive log thread 1 sequence 166 is already on disk as file /opt/oracle/dbs/arch1_166_732220285.dbf
archive log thread 1 sequence 167 is already on disk as file /opt/oracle/dbs/arch1_167_732220285.dbf
archive log thread 1 sequence 168 is already on disk as file /opt/oracle/dbs/arch1_168_732220285.dbf
archive log filename=/opt/oracle/dbs/arch1_155_732220285.dbf thread=1 sequence=155
archive log filename=/opt/oracle/dbs/arch1_156_732220285.dbf thread=1 sequence=156
archive log filename=/opt/oracle/dbs/arch1_157_732220285.dbf thread=1 sequence=157
archive log filename=/opt/oracle/dbs/arch1_158_732220285.dbf thread=1 sequence=158
archive log filename=/opt/oracle/dbs/arch1_159_732220285.dbf thread=1 sequence=159
archive log filename=/opt/oracle/dbs/arch1_160_732220285.dbf thread=1 sequence=160
archive log filename=/opt/oracle/dbs/arch1_161_732220285.dbf thread=1 sequence=161
archive log filename=/opt/oracle/dbs/arch1_162_732220285.dbf thread=1 sequence=162
archive log filename=/opt/oracle/dbs/arch1_163_732220285.dbf thread=1 sequence=163
archive log filename=/opt/oracle/dbs/arch1_164_732220285.dbf thread=1 sequence=164
archive log filename=/opt/oracle/dbs/arch1_165_732220285.dbf thread=1 sequence=165
archive log filename=/opt/oracle/dbs/arch1_166_732220285.dbf thread=1 sequence=166
media recovery complete, elapsed time: 00:01:55
Finished recover at 25-OCT-10

released channel: ch00

RMAN>

Recovery Manager complete.


rac97:/stu1 #  date ;ls -rlt ; bplist -C  sun215vip -t 4 -R /
Mon Oct 25 16:11:05 CST 2010
total 639908
-rw------- 1 root root      4096 Oct 25 15:38 sun215vip_1287992312_C1_HDR.1287992312.info
-rw------- 1 root root      4096 Oct 25 15:38 sun215vip_1287992312_C1_HDR.1287992312.img
-rw------- 1 root root      4096 Oct 25 15:39 sun215vip_1287992312_C1_F1.1287992312.info
-rw------- 1 root root 654606336 Oct 25 15:39 sun215vip_1287992312_C1_F1.1287992312.img
/df_16_1_733333108

SQL> alter tablespace ts2 online ;

Tablespace altered.

也就是说, NBU恢复,只要看nbu catalog里的备份集,如果里面的状态(用bplist来看看)是正确的, 就可以恢复, 不用管rman里的备份集信息.
如果不用nbu, 单纯的oracle环境里. 如果备份集是expiered,还能不能恢复?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP