10g duplicate .快速的恢复与创建备份数据库

测试环境: 2 台 linux (192.168.1.4,192.168.1.5) ,

oracle 10.2.0.3

1.备份主库.

swithc logfile

backup full database;

2. 创建一个空的备库.

dbca

3.配置tnanames.ora

使得主库可以rman到从库.

4. 将主库的备份文件传到备库相同目录.

5.启动备库到 nomount状态下.

6.通过主库复制备库.

7.打开备库.有条件的使用resetlogs

.以下是整个操作的日志.

[@more@]

backup full database;

dbca.

/-----------------------------------------------------------------------------------------------------------------------------/

RMAN> duplicate target database to orcl5 nofilenamecheck;

Starting Duplicate Db at 20090328054815
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=155 devtype=DISK

contents of Memory Script:
{
set until scn 472272998;
set newname for datafile 1 to
"/dbHome/orcl/system01.dbf";
set newname for datafile 2 to
"/dbHome/orcl/undotbs01.dbf";
set newname for datafile 3 to
"/dbHome/orcl/sysaux01.dbf";
set newname for datafile 4 to
"/dbHome/orcl/users01.dbf";
set newname for datafile 5 to
"/dbHome/orcl/testtbs01.dbf";
restore
check readonly
clone database
;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 20090328054816
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /dbHome/orcl/system01.dbf
restoring datafile 00002 to /dbHome/orcl/undotbs01.dbf
restoring datafile 00003 to /dbHome/orcl/sysaux01.dbf
restoring datafile 00004 to /dbHome/orcl/users01.dbf
restoring datafile 00005 to /dbHome/orcl/testtbs01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /dbHome/05karmo0682482432.bak
ORA-19870: error reading backup piece /dbHome/05karmo0682482432.bak
ORA-19505: failed to identify file "/dbHome/05karmo0682482432.bak"
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
failover to previous backup

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 03/28/2009 17:48:18
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 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore

/-----------------------------------------------------------------------------------------------------------------------------/
RMAN> duplicate target database to orcl5 nofilenamecheck;

Starting Duplicate Db at 20090328055337
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK

contents of Memory Script:
{
set until scn 472272998;
set newname for datafile 1 to
"/dbHome/orcl/system01.dbf";
set newname for datafile 2 to
"/dbHome/orcl/undotbs01.dbf";
set newname for datafile 3 to
"/dbHome/orcl/sysaux01.dbf";
set newname for datafile 4 to
"/dbHome/orcl/users01.dbf";
set newname for datafile 5 to
"/dbHome/orcl/testtbs01.dbf";
restore
check readonly
clone database
;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 20090328055338
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /dbHome/orcl/system01.dbf
restoring datafile 00002 to /dbHome/orcl/undotbs01.dbf
restoring datafile 00003 to /dbHome/orcl/sysaux01.dbf
restoring datafile 00004 to /dbHome/orcl/users01.dbf
restoring datafile 00005 to /dbHome/orcl/testtbs01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /dbHome/05karmo0682482432.bak
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/dbHome/05karmo0682482432.bak tag=TAG20090326T022712
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:17
Finished restore at 20090328055535
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL5" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/dbHome/orcl/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/dbHome/orcl/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/dbHome/orcl/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/dbHome/orcl/system01.dbf'
CHARACTER SET ZHS16GBK


contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script

released channel: ORA_AUX_DISK_1
datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=682710869 filename=/dbHome/orcl/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=682710869 filename=/dbHome/orcl/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=682710869 filename=/dbHome/orcl/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=682710869 filename=/dbHome/orcl/testtbs01.dbf

contents of Memory Script:
{
set until scn 472272998;
recover
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 20090328055540
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK

starting media recovery

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 03/28/2009 17:55:42
RMAN-03015: error occurred in stored script Memory Script
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 82 lowscn 472250467 found to restore
RMAN-06025: no backup of log thread 1 seq 81 lowscn 472230041 found to restore
RMAN-06025: no backup of log thread 1 seq 80 lowscn 472224080 found to restore

/-----------------------------------------------------------------------------------------------------------------------------/
[oracle@oradb dbHome]$ sqlplus "sys/sysdba as sysdba"

SQL*Plus: Release 10.2.0.3.0 - Production on ÐÇÆÚÁù 3ÔÂ 28 17:55:37 2009

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;

Database altered.

SQL>

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

转载于:http://blog.itpub.net/197458/viewspace-1019575/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值