ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 用rman作tspitr一定要用catalog吗?

用rman作tspitr一定要用catalog吗?

原创 Linux操作系统 作者:anchen211 时间:2007-01-24 16:37:46 0 删除 编辑
闲来无事做个tspitr测试.
我的环境:windows xp
oracle9201
rman备份用的是nocatalog.
在作恢复的时候出现问题,报错如下:
C:\Documents and Settings\jsssb>rman

恢复管理器: 版本9.2.0.1.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

RMAN> connect target /@test

连接到目标数据库: TEST (DBID=1909038011)

RMAN> connect auxiliary /

已连接到备用数据库: test (未安装)

RMAN> run {
2> ALLOCATE AUXILIARY CHANNEL A1 TYPE DISK;
3> ALLOCATE CHANNEL c1 TYPE DISK;
4> recover tablespace users until scn 763766;
5> }

正在使用目标数据库控制文件替代恢复目录
分配的通道: A1
通道 A1: sid=11 devtype=DISK

分配的通道: c1
通道 c1: sid=17 devtype=DISK

启动 recover 于 24-1月 -07

正在打印存储的脚本: Memory Script
{
# set the until clause
set until  scn 763766;
# restore the controlfile
restore clone controlfile to clone_cf;
# replicate the controlfile
replicate clone controlfile from clone_cf;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log for tspitr to a resent until time
sql 'alter system archive log current';
# avoid unnecessary autobackups for structural changes during TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
}
正在执行脚本: Memory Script

正在执行命令: SET until clause

启动 restore 于 24-1月 -07

通道 A1: 正在开始恢复数据文件备份集
通道 A1: 正在恢复控制文件
输出文件名=D:\ORACLE\ORADATA\AUX1\CONTROL01.CTL
通道 A1: 已恢复备份段 1
段 handle=D:\ORACLE\ORADATA\TEST\BACKUP\C_C-1909038011-20070124-07 tag=null params=NULL
通道 A1: 恢复完成
完成 restore 于 24-1月 -07

正在复制控制文件
输出文件名=D:\ORACLE\ORADATA\AUX1\CONTROL01.CTL

sql 语句: alter database mount clone database

sql 语句: alter system archive log current

sql 语句: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;

正在打印存储的脚本: Memory Script
{
# generated tablespace point-in-time recovery script
# set the until clause
set until  scn 763766;
plsql <<<-- tspitr_2
declare
  sqlstatement       varchar2(512);
  offline_not_needed exception;
  pragma exception_init(offline_not_needed, -01539);
begin
  sqlstatement := 'alter tablespace '||  'USERS' ||' offline for recover';
  krmicd.writeMsg(6162, sqlstatement);
  krmicd.execSql(sqlstatement);
exception
  when offline_not_needed then
    null;
end; >>>;
# set a destination filename for restore
set newname for datafile  1 to
"D:\ORACLE\ORADATA\AUX1\SYSTEM01.DBF";
# set a destination filename for restore
set newname for datafile  2 to
"D:\ORACLE\ORADATA\AUX1\UNDOTBS01.DBF";
# set a destination filename for restore
set newname for datafile  9 to
"D:\ORACLE\ORADATA\TEST\USER01.DBF";
# restore the tablespaces in the recovery set plus the auxilliary tablespaces
restore clone datafile  1, 2, 9;
switch clone datafile all;
#online the datafiles restored or flipped
sql clone "alter database datafile  1 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  2 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  9 online";
# make the controlfile point at the restored datafiles, then recover them
recover clone database tablespace  "USERS", "SYSTEM", "UNDOTBS1";
alter clone database open resetlogs;
# PLUG HERE the creation of a temporary tablespace if export fails due to lack
# of temporary space.
# For example in Unix these two lines would do that:
#sql clone "create tablespace aux_tspitr_tmp
#           datafile ''/tmp/aux_tspitr_tmp.dbf'' size 500K";
}
正在执行脚本: Memory Script

正在执行命令: SET until clause

sql 语句: alter tablespace USERS offline for recover

正在执行命令: SET NEWNAME

正在执行命令: SET NEWNAME

正在执行命令: SET NEWNAME

启动 restore 于 24-1月 -07

释放的通道: c1
释放的通道: A1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/24/2007 16:26:14
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 9 found to restore

然后,手工进行恢复,
RMAN> recover datafile 9;

启动 recover 于 24-1月 -07
使用通道 ORA_DISK_1

正在开始介质的恢复
完成介质的恢复

完成 recover 于 24-1月 -07

RMAN>

然后在目标库
alter tablespace users online;

查询发现没有进行了完全恢复,而不是不完全恢复.

有人知道原因何在吗?

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9375/viewspace-555109/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-11-04

  • 博文量
    129
  • 访问量
    175859