RAC 主库配置单实例ADG(2)

LOG_ARCHIVE_CONFIG enables or disables the sending of redo logs to remote destinations and the receipt of remote redo logs, and specifies the unique database names (DB_UNIQUE_NAME) for each database in the Data Guard configuration.

log_archive_dest_3(这里的日志传输链路选择log_archive_dest_3,根据需求规范可改选其他的)
查看相关日志传输链路是否存在错误信息:
select dest_id, dest_name, error from v$archive_dest where dest_id=3;

例如:
在主库上对部分参数做适当的修改调整。

alter system set FAL_SERVER='jyzhao_s'; alter system set log_archive_config= 'DG_CONFIG=(jyzhao,jyzhao_s)'; alter system set log_archive_dest_3='SERVICE=jyzhao_s LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=jyzhao_s';

在11.2官档中,提到其中LGWR参数已过时,Specify SYNC or ASYNC. ASYNC is the default if neither attribute is specified.

--设置db_unique_name, log_archive_config(这里主库的db_unique_name,出于对现有的生产环境最小影响考虑没有改)

alter system set db_unique_name='jyzhao' scope=spfile; alter system set log_archive_config= 'DG_CONFIG=(jyzhao,jyzhao_s)';

--归档日志目录

alter system set log_archive_dest_3='SERVICE=jyzhao_s LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=jyzhao_s'; select dest_id, dest_name, error from v$archive_dest where dest_id=3;

--归档日志文件命名规则
--DG的fal_server和fal_client

alter system set fal_server='jyzhao_s';

--设置standby_file_management为自动

alter system set standby_file_management=AUTO;

--设置备库日志文件组,数量一般为目标库日志文件组+1(当原环境是RAC环境时,如何修改?)

alter database add standby logfile thread 1 group 11 size 50M; alter database add standby logfile thread 1 group 12 size 50M; alter database add standby logfile thread 1 group 13 size 50M; alter database add standby logfile thread 2 group 21 size 50M; alter database add standby logfile thread 2 group 22 size 50M; alter database add standby logfile thread 2 group 23 size 50M;

3.3 创建备库密码文件
主库密码文件拷贝到备库相应的目录下
scp $ORACLE_HOME/dbs/orapw* xxx.xxx.xxx.xxx:/.../dbs/

[oracle@jyrac2 dbs]$ scp $ORACLE_HOME/dbs/orapwjyzhao2 192.168.56.158:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwjyzhao_s

--确认 orapwjyzhao_s 确认standby database的db_name为jyzhao; 然后db_unique_name, service_names, instance_name都是jyzhao_s

3.4 创建pfile文件
从主库的spfile中导出pfile文件,传输到备库并做适当的修改调整。
create pfile='/tmp/pfile.ora' from spfile;

在备库修改如下:

--原版(去掉RAC实例12的相关设置参数): [oracle@jydg tmp]$ more pfile.ora *.audit_file_dest='/opt/app/oracle/admin/jyzhao/adump' *.audit_trail='db' *.cluster_database=true *.compatible='11.2.0.4.0' *.control_files='+DATA1/jyzhao/controlfile/current.260.919999027','+FRA1/jyzhao/controlfile/current.256.919999029' *.db_block_size=8192 *.db_create_file_dest='+DATA1' *.db_domain='' *.db_name='jyzhao' *.db_recovery_file_dest='+FRA1' *.db_recovery_file_dest_size=4621074432 *.diagnostic_dest='/opt/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=jyzhaoXDB)' *.fal_server='jyzhao_s' *.log_archive_config='DG_CONFIG=(jyzhao,jyzhao_s)' *.log_archive_dest_3='SERVICE=jyzhao_s LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=jyzhao_s' *.log_archive_dest_state_3='enable' *.memory_max_target=314572800 *.memory_target=314572800 *.open_cursors=300 *.processes=150 *.remote_listener='jyrac-scan:1521' *.remote_login_passwordfile='exclusive' *.standby_file_management='AUTO' --修正后(主要确认路径是否都存在): [oracle@jydg tmp]$ more pfile.ora *.audit_file_dest='/u01/app/oracle/admin/jyzhao/adump' *.audit_trail='db' *.compatible='11.2.0.4.0' *.control_files='/u01/app/oracle/oradata/control01.ctl','/u01/app/oracle/fra/control02.ctl' db_unique_name='jyzhao_s' DB_FILE_NAME_CONVERT='+DATA1/jyzhao/datafile','/u01/app/oracle/oradata','+DATA1/jyzhao/tempfile/','/u01/app/oracle/oradata/' LOG_FILE_NAME_CONVERT='+DATA1/jyzhao/onlinelog','/u01/app/oracle/oradata','+FRA1/jyzhao/onlinelog','/u01/app/oracle/oradata' *.db_block_size=8192 *.db_create_file_dest='/u01/app/oracle/fra' *.db_domain='' *.db_name='jyzhao' *.db_recovery_file_dest='/u01/app/oracle/fra' *.db_recovery_file_dest_size=4621074432 *.diagnostic_dest='/u01/app/oracle' *.fal_server='jyzhao' *.log_archive_config='DG_CONFIG=(jyzhao_s,jyzhao)' *.log_archive_dest_3='SERVICE=jyzhao LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=jyzhao' *.log_archive_dest_state_3='enable' *.memory_max_target=314572800 *.memory_target=314572800 *.open_cursors=300 *.processes=150 *.remote_login_passwordfile='exclusive' *.standby_file_management='AUTO'

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/3dd2b77e1cf5e8caac5a4b3286f1e85c.html