免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: 老邱
打印 上一主题 下一主题

[VTL与磁带系统] 关于如何在rman没有catalog的情况下恢复用Rman 备份到磁带上的controlfile [复制链接]

论坛徽章:
0
11 [报告]
发表于 2008-03-03 12:35 |只看该作者
原帖由 fly1928 于 2008-3-3 10:32 发表
好文,如果早几年,我的客户就有福了.



这个办法以版主早写过的呀.

论坛徽章:
0
12 [报告]
发表于 2008-05-05 15:27 |只看该作者
正好遇到这样的问题,环境为tsm+oracle10g,测试结果如下

SQL> declare
  2  devtype varchar2(256);
  3  done boolean;
  4  begin
  5  devtype:=dbms_backup_restore.deviceallocate('sbt_tape',params=>'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpodbac.opt)');
  6  dbms_backup_restore.restoresetdatafile;
  7  dbms_backup_restore.restorecontrolfileto('/tmp/abc.cf');
  8  dbms_backup_restore.restorebackuppiece('df_652960629_409_1',done=>done);
  9  end;
10  /

PL/SQL procedure successfully completed.
$ cp abc.cf /xxx/xxxx/xxxx/data/xxxprd1_control01.ctl
$ cp xxxprd1_control01.ctl xxxxprd1_control02.ctl
$ rman target / catalog rman/rman@rman

Recovery Manager: Release 10.2.0.3.0 - Production on Mon May 5 07:12:18 2008

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

connected to target database: accaprd1 (not mounted)
connected to recovery catalog database
RMAN> alter database mount;

database mounted

论坛徽章:
0
13 [报告]
发表于 2008-05-05 16:09 |只看该作者
很奇怪的问题,使用catalog+tsm+rman备份数据库,测试我把所有controlfile全部删除,数据库down,在nomount下无法恢复通过rman备份到磁带的controlfile
RMAN>startup nomount;
RMAN> run{
2> allocate channel t1 type 'sbt_tape' parms
3> 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpodbac.opt)';
4> restore controlfile to '/opt/tivoli/ctl.bak';
5> }

allocated channel: t1
channel t1: sid=559 devtype=SBT_TAPE
channel t1: Data Protection for Oracle: version 5.4.1.0

Starting restore at 05-MAY-08

released channel: t1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 05/05/2008 06:50:31
RMAN-06026: some targets not found - aborting restore
RMAN-06024: no backup or copy of the control file found to restore
但是通过命令可以看到controlfile在磁带中有很多份备份

RMAN> list backup of controlfile;


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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
------- ---- -- ---------- ----------- ------------ -------------------
190553  Incr 1  7.50M      SBT_TAPE    00:00:00     2008-03-07 02:23:51
        BP Key: 190560   Status: AVAILABLE  Compressed: NO  Tag: TAG20080306T181846
        Handle: df_648699831_272_1   Media: 221
  Control File Included: Ckp SCN: 11868796108   Ckp time: 2008-03-07 02:23:51

BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
------- ---- -- ---------- ----------- ------------ -------------------
191816  Incr 1  7.50M      SBT_TAPE    00:00:00     2008-03-08 02:25:02
        BP Key: 191823   Status: AVAILABLE  Compressed: NO  Tag: TAG20080307T181956
        Handle: df_648786302_276_1   Media: 221
  Control File Included: Ckp SCN: 11868884271   Ckp time: 2008-03-08 02:25:02

BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
------- ---- -- ---------- ----------- ------------ -------------------
193070  Incr 0  7.50M      SBT_TAPE    00:00:00     2008-03-09 02:25:52
        BP Key: 193077   Status: AVAILABLE  Compressed: NO  Tag: TAG20080308T181936
        Handle: df_648872752_280_1   Media: 221
  Control File Included: Ckp SCN: 11868975130   Ckp time: 2008-03-09 02:25:52


后来通过楼上的方法恢复了controlfile,后来recover时有问题,再测试,
出现RMAN-06004: ORACLE error from recovery catalog database: RMAN-20011: target database incarnation is not current in recovery catalog
于是我reset database到一个incarnation后,在nomount下也可以恢复controlfile和数据文件,这是何解?

RMAN> startup nomount;  

connected to target database (not started)
Oracle instance started

Total System Global Area     633339904 bytes

Fixed Size                     2275384 bytes
Variable Size                293357512 bytes
Database Buffers             335544320 bytes
Redo Buffers                   2162688 bytes

RMAN> reset database to incarnation 99362;

database reset to incarnation 99362
RMAN> run{
2> allocate channel t1 type 'sbt_tape' parms
3> 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpodbac.opt)';
4> restore controlfile;
5> }

allocated channel: t1
channel t1: sid=559 devtype=SBT_TAPE
channel t1: Data Protection for Oracle: version 5.4.1.0

Starting restore at 2008-05-05 07:56:11

channel t1: starting datafile backupset restore
channel t1: restoring control file
channel t1: reading from backup piece df_652960629_409_1
channel t1: restored backup piece 1
piece handle=df_652960629_409_1 tag=TAG20080425T015104
channel t1: restore complete, elapsed time: 00:00:03
output filename=/xxx/xxxx/accaprd1/data/accaprd1_control01.ctl
output filename=/xxx/xxxx/accaprd1/data/accaprd1_control02.ctl
Finished restore at 2008-05-05 07:56:16
released channel: t1

[ 本帖最后由 星海夜航 于 2008-5-5 16:22 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP