Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > 利用rman创建standby(二)
【标  题】:利用rman创建standby(二)
【关键字】:rman,standby
【来  源】:http://blog.csdn.net/NinGoo/archive/2006/11/21/1401902.aspx

利用rman创建standby(二)

Your Ad Here

第1步到第6步和前一个试验一致,这里不再重复。

7.利用rman备份主库

注意同时备库控制文件

C:>rman target /

Recovery Manager: Release 9.2.0.1.0 - Production

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

connected to target database: NING (DBID=1192138470)

RMAN> backup full format='d:backup.ora' database include current controlfile for standby;

Starting backup at 21-NOV-06
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=17 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current SPFILE in backupset
including standby controlfile in backupset
input datafile fno=00001 name=D:ORACLEORADATANINGSYSTEM01.DBF
input datafile fno=00002 name=D:ORACLEORADATANINGUNDOTBS01.DBF
input datafile fno=00004 name=D:ORACLEORADATANINGEXAMPLE01.DBF
input datafile fno=00005 name=D:ORACLEORADATANINGINDX01.DBF
input datafile fno=00007 name=D:ORACLEORADATANINGUSERS01.DBF
input datafile fno=00003 name=D:ORACLEORADATANINGCWMLITE01.DBF
input datafile fno=00006 name=D:ORACLEORADATANINGTOOLS01.DBF
input datafile fno=00008 name=D:ORACLEORADATANINGTEST01.DBF
channel ORA_DISK_1: starting piece 1 at 21-NOV-06
channel ORA_DISK_1: finished piece 1 at 21-NOV-06
piece handle=D:BACKUP.ORA comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:17
Finished backup at 21-NOV-06

8.归档主库当前日志
SQL> alter system archive log current;

System altered.

9.启动备库到nomount
SQL> conn
/@test as sysdba
Connected to an idle instance.

SQL> startup nomount pfile='d:/oracle/ora92/database/inittest.ora'
ORACLE instance started.

Total System Global Area 135338868 bytes
Fixed Size 453492 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes

10.利用rman恢复备库C:>rman target / auxiliary /@test

Recovery Manager: Release 9.2.0.1.0 - Production

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

connected to target database: NING (DBID=1192138470)
connected to auxiliary database: ning (not mounted)

RMAN> duplicate target database for standby;

Starting Duplicate Db at 21-NOV-06
using target database controlfile instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=13 devtype=DISK

printing stored script: Memory Script
{
restore clone standby controlfile to clone_cf;
replicate clone controlfile from clone_cf;
sql clone 'alter database mount standby database';
}
executing script: Memory Script

Starting restore at 21-NOV-06

using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring controlfile
output filename=D:ORACLEORADATATESTCONTROLSTANDBY.CTL
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=D:BACKUP.ORA tag=TAG20061121T163118 params=NULL
channel ORA_AUX_DISK_1: restore complete
Finished restore at 21-NOV-06

replicating controlfile
input filename=D:ORACLEORADATATESTCONTROLSTANDBY.CTL

sql statement: alter database mount standby database

printing stored script: Memory Script
{
set until scn 710788;
set newname for datafile 1 to
"D:ORACLEORADATATESTSYSTEM01.DBF";
set newname for datafile 2 to
"D:ORACLEORADATATESTUNDOTBS01.DBF";
set newname for datafile 3 to
"D:ORACLEORADATATESTCWMLITE01.DBF";
set newname for datafile 4 to
"D:ORACLEORADATATESTEXAMPLE01.DBF";
set newname for datafile 5 to
"D:ORACLEORADATATESTINDX01.DBF";
set newname for datafile 6 to
"D:ORACLEORADATATESTTOOLS01.DBF";
set newname for datafile 7 to
"D:ORACLEORADATATESTUSERS01.DBF";
set newname for datafile 8 to
"D:ORACLEORADATATESTTEST01.DBF";
restore
check readonly
clone database
;
}
executing script: 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

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 21-NOV-06

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 D:ORACLEORADATATESTSYSTEM01.DBF
restoring datafile 00002 to D:ORACLEORADATATESTUNDOTBS01.DBF
restoring datafile 00003 to D:ORACLEORADATATESTCWMLITE01.DBF
restoring datafile 00004 to D:ORACLEORADATATESTEXAMPLE01.DBF
restoring datafile 00005 to D:ORACLEORADATATESTINDX01.DBF
restoring datafile 00006 to D:ORACLEORADATATESTTOOLS01.DBF
restoring datafile 00007 to D:ORACLEORADATATESTUSERS01.DBF
restoring datafile 00008 to D:ORACLEORADATATESTTEST01.DBF
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=D:BACKUP.ORA tag=TAG20061121T163118 params=NULL
channel ORA_AUX_DISK_1: restore complete
Finished restore at 21-NOV-06

printing stored script: Memory Script
{
switch clone datafile all;
}
executing script: Memory Script

datafile 2 switched to datafile copy
input datafilecopy recid=9 stamp=607106726 filename=D:ORACLEORADATATESTUNDOT
BS01.DBF
datafile 3 switched to datafile copy
input datafilecopy recid=10 stamp=607106726 filename=D:ORACLEORADATATESTCWML
ITE01.DBF
datafile 4 switched to datafile copy
input datafilecopy recid=11 stamp=607106726 filename=D:ORACLEORADATATESTEXAM
PLE01.DBF
datafile 5 switched to datafile copy
input datafilecopy recid=12 stamp=607106726 filename=D:ORACLEORADATATESTINDX
01.DBF
datafile 6 switched to datafile copy
input datafilecopy recid=13 stamp=607106726 filename=D:ORACLEORADATATESTTOOL
S01.DBF
datafile 7 switched to datafile copy
input datafilecopy recid=14 stamp=607106726 filename=D:ORACLEORADATATESTUSER
S01.DBF
datafile 8 switched to datafile copy
input datafilecopy recid=15 stamp=607106726 filename=D:ORACLEORADATATESTTEST
01.DBF
Finished Duplicate Db at 21-NOV-06

如果第8步没有归档当前日志,duplicate时可能出现错误:
RMAN-05507: standby controlfile checkpoint (710256) is more recent than duplicat
ion point in time (709530)

至此,备库创建成功,后续步骤可以参照前一个试验

可以看到,使用rman的duplicate来创建备库,过程简洁了不少,无需在手动创建备库控制文件。 

如何设置MySQL同步(Replication):【上一篇】
利用rman创建standby(一):【下一篇】
【相关文章】
  • 丢失某个归档日志后如何使RMAN恢复正常的测试
  • rman备份恢复总结
  • XML HTTP Performance and Caching
  • ORACLE10G RMAN中run代码块中自动释放通道
  • Spiderman’s workout (dynamic programming)
  • RMAN快速入门指南
  • Tomcat5.5启动时提示“The Apache Tomcat Native library which allows optimal performance in production...
  • 为ToolBarManager添加自定义控件
  • 创建RMAN CATAGORY
  • RMAN backupset renaming or relocation
  • 【随机文章】
  • Eclipse使用StrutsIDE开发struts
  • [收藏]春天来了,燕子回来了,异乡漂泊的人们也可以回家了^^
  • 解读ASP.NET Portal Starter Kit(2)——用户配置文件篇
  • 用Photoshop制作八音盒
  • BSD下IPFilter.txt
  • Spring的持久层封装
  • 用C++的高级模版特性实现一个不需要IDL的RPC
  • 获取计算机的名称和IP地址
  • 用JAVA编写HTML在线编辑器
  • 电磁干扰与电磁兼容浅谈之一:电磁干扰无处不在
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.