概述
高级创建DG方法:
1.编辑实例参数文件
vi init$SID.ora
DB_NAME=ORCL
2.启动数据库到nomount
startup nomount;
3.通过Rman复制数据库
rman>connect target sys/oracle@orcl
rman>connect auxiliary sys/oracle@orcldg
run{
allocate channel primy1 type disk;
allocate channel primy2 type disk;
allocate channel primy3 type disk;
allocate channel primy4 type disk;
allocate auxiliary channel sty1 type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'orcl','orcldg'
set 'db_unique_name=orcldg'
set controlfile='+data/orcldg/control01.ctl'
set db_create_file_dest='+DATA'
set db_create_online_log_dest_1='+FLASH'
set db_create_online_log_dest_2='+DATA'
set db_recovery_file_dest_+='+FLASH'
set db_recovery_file_dest_size='10G'
set log_archive_max_processes='5'
set fal_client='orcldg'
set fal_server='orcl'
set standby_file_management='AUTO'
set log_archive_config='dg_config=(orcl,orcldg)'
set log_archive_dest_2='service=orcldg LGWR ASYNC valid_for=(ONLINE_LOGIFLES,PRIMARY_ROLE) db_unique_name=orcl'
sql channel prmy1 "alter system set log_archive_config=''dg_config=(orcl,orcldg)''";
sql channel prmy1 "alter system set log_archive_dest_2=''service=orcldg LGWR ASYNC valid_for=(ONLINE_LOGIFLES,PRIMARY_ROLE) db_unique_name=orcldg''";
sql channel prmy1 "alter system set log_archive_max_processes=5";
sql channel prmy1 "alter system set fal_client=orcl";
sql channel prmy1 "alter system set fal_server=orcldg";
sql channel prmy1 "alter system set standby_file_management=AUTO";
sql channel prmy1 "alter system archive log current";
allocate auxiliary channel stby type disk;
sql channel stby "alter database recover managed standby database using current logfile disconnect";
nofilenamecheck;
}
4.检查备库
1.v$managed_standby;
select process,client_process,thread#,sequence#,status from v$managed_standby;
2.v$dataguard_stats;
这个视图直观显示主数据库当前时间点奔溃,会丢失多少重做数据。
select * from v$dataguard_stats;
3.v$standby_apply_snapshot;
该视图显示当前应用重做数据的速率。
select to_char(snapshot_time,'yyy-mm-dd hh24:mi:ss') snapshot_time,thread#,sequence#,applied_scn,
apply_rate from v$standby_apply_snapshot;
4.v$recovery_progress;
该视图可以监控高校恢复操作,并评估完成当前正在执行的操作需要的时间。
select to_char(start_time,'yyyy-mm-dd hh24:mi:ss') start_time,item,round(sofar/1024,2) "M/s"
from v$recovery_progress where item='Active Apply Rate' or item='Average Apply Rate';
select recovery_mode from v$archive_dest_status;
最后
以上就是追寻摩托为你收集整理的6.高级方法创建DataGuard的全部内容,希望文章能够帮你解决6.高级方法创建DataGuard所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复