Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2796631
  • 博文数量: 389
  • 博客积分: 4177
  • 博客等级: 上校
  • 技术积分: 4773
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-16 23:29
文章分类

全部博文(389)

分类: Oracle

2011-09-20 02:24:53

                ORACLE 11G使用RMAN在线创建DATAGUARD STANDBY
1,改主库为归档模式,并且加好TNSNAMES条目;
 
2,在备库上创建相同的目录结构,也增加相应的TNSNAMES条目,使用任意参数文件,这个参数文件只包含DB_NAME就可以了,把INSTANCE启动到NOMOUNT状态,并使用NETMGR建好LISTENER.

3,在主库上,建一个文件,比如名字为A.ORA,内容如下.发布rman nocatalog cmdfile=a.ora
connect target / ;
connect auxiliary ;
run
{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate auxiliary channel a1 device type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'st2','st1'
set db_unique_name='st1'
set log_archive_config='dg_config=(st2,st1)'
set log_archive_dest_1='location=/u01/app/backup valid_for=(all_logfiles,all_roles)db_unique_name=st1'
set log_archive_dest_2='service=st2 valid_for=(online_logfiles,primary_role) db_unique_name=st2'
set fal_server='st2'
set fal_client='st1'
set standby_file_management='AUTO'
nofilenamecheck;
sql channel c2 "alter system set log_archive_config=''dg_config=(st2,st1)''";
sql channel c2 "alter system set log_archive_dest_1=''location=/u01/app/backup valid_for=(all_logfiles,all_roles) db_unique_name=st2''";
sql channel c2 "alter system set log_archive_dest_2=''service=st1 valid_for=(online_logfiles,primary_role) db_unique_name=st1''";
sql channel c2 "alter system set fal_server=st1";
sql channel c2 "alter system set fal_client=st2";
sql channel c2 "alter system set standby_file_management=AUTO";
}
注:通过active database特性,可以在线创建DATAGUARD,特别是迁移到新服务器上,然后SWITCH过去就可以了.只需几分钟停机的时候就搞定了.
 
阅读(4767) | 评论(0) | 转发(0) |
0

上一篇:OPTIMIZER备注

下一篇:MD5SUM的妙用

给主人留下些什么吧!~~