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) |