温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

RAC-DG 安装总结

发布时间:2020-07-01 07:51:23 来源:网络 阅读:351 作者:llc018198 栏目:关系型数据库
  1. 配置好主库参数文件:

添加:

*.log_archive_config='DG_CONFIG=(CWFOL,CWFOLB)'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=CWFOL'
*.log_archive_dest_2='SERVICE=CWFOLB LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=CWFOLB'

重启每个节点:

2.为主库添加standby log:

alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;

3.配置静态监听,,主库和备库,各节点,,,

4.主库开启闪回和强制日志:

5.生成密码文件:

orapwd file='$ORACLE_HOME/dbs/orapwCWFOL1' password=oracle entries=5 force=y ignorecase=y;
orapwd file='$ORACLE_HOME/dbs/orapwCWFOL2' password=oracle entries=5 force=y ignorecase=y;
orapwd file='$ORACLE_HOME/dbs/orapwCWFOLB' password=oracle entries=5 force=y ignorecase=y;

或者在一个节点生成后,然后拷贝到别的节点,重新命名。

6.备库编辑一个文件,只需要db_name:

[oracle@foldg dbs]$ cat initCWFOLB.ora
db_name=CWFOLB

7.编辑duplicate.sql

[oracle@foldb1 ~]$ cat duplicate.sql
duplicate target database
for standby
from active database
DORECOVER
spfile
set service_names='CWFOLB'
set db_unique_name='CWFOLB'
set log_archive_dest_1='location=+FRA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=CWFOLB'
set log_archive_dest_2='SERVICE=COWELLORC  LGWR SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=CWFOL'
set standby_file_management='AUTO'
set fal_server='CWFOL'
set fal_client='CWFOLB'
set control_files='+DATA'
set cluster_database='false';


出现的错误:

1.

MAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/28/2016 13:03:45
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04014: startup failed: ORA-00119: invalid specification for system parameter REMOTE_LISTENER
ORA-00132: syntax error or unresolved network name 'foldb-cluster-scan:1521'

RMAN> **end-of-file**

*.remote_listener='foldb-cluster-scan:1521'

解决办法:再主库上去掉这个参数,复制完成后,修改回来。

2.主库和备库无法进行实时同步, 状态为wait_for_log.需要alter system switch logfile才行.

原因是在备库上没有针对节点2的standby log,添加:

alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;

正常结果如下:

SQL> select status from v$managed_standby;

STATUS
------------
CLOSING
CLOSING
CLOSING
CONNECTED
IDLE
IDLE
APPLYING_LOG
IDLE
IDLE
IDLE
IDLE

11 rows selected.


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI