Oracle 2套rac集群指向单机多实例的复制搭建

时间:2022-11-04 08:40:38

Oracle 2套rac集群指向单机多实例的复制搭建

由于环境限制,现在需要把2套rac集群通过dg复制指向远端的单机多实例上面。

rac指向第一个实例的前面已经有文档

这里直接添加第二个实例的复制搭建,主要标出不同地方

单实例环境--standby
CentOS release 6.10 (Final)
hostname dg1
ip 10.*.30
Instance_name cad
DB_NAME bol --此次2个一样
db_unique_name cad

SQL*Plus: Release 11.2.0.4.0 Production

 

文件系统规划
Primary Standby
+DATA/bol/datafile/test01.dbf         /u01/app/oracle/oradata/cad/data tempfile
+data/bol/tempfile                /u01/app/oracle/oradata/cad/control01.ctl
+fra/bol/archivelog               /u01/app/oracle/fast_recovery_area/cad
+fra/bol/onlinelog            /u01/app/oracle/oradata/orcl/cad

基本步骤与上面相同,只是实例名有不同之处
1 主库rac集群,设置为归档,和force logging模式
2 主库添加 standby Redo log 文件
3 主备库修改listener.ora 和tnsnames.ora 文件
主库与之前基本相同
备库
[oracle@dg1 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = cad)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = cad)  ---在主机dg1上 ,添加2个实例
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dg1)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

ADR_BASE_LISTENER = /u01/app/oracle

[oracle@dg1 admin]$ cat tnsnames.ora
bol=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.*.15)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.*.16)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =bol)
)
)

orcl=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.*.30)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =orcl)
)
)

cad=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.*.30)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =cad)
)
)
[oracle@rac07 ~]$ tnsping cad
4 在备库创建相应的目录
mkdir -p /u01/app/oracle/fast_recovery_area/cad
mkdir -p /u01/app/oracle/oradata/cad/data
mkdir -p /u01/app/oracle/oradata/cad/tempfile
mkdir -p /u01/app/oracle/admin/cad/adump
mkdir -p /u01/app/oracle/admin/cad/data
mkdir -p /u01/app/oracle/admin/cad/redo
mkdir -p /u01/app/oracle/admin/cad/tempfile
mkdir -p /u01/app/oracle/archive/cad

5 修改主备库参数和把主库密码文件cp到备库
--备库参数文件
cad.__db_cache_size=469762048
cad.__java_pool_size=16777216
cad.__large_pool_size=33554432
cad.__pga_aggregate_target=654311424
cad.__sga_target=956301312
cad.__shared_io_pool_size=0
cad.__shared_pool_size=385875968
cad.__streams_pool_size=33554432
*.audit_file_dest='/u01/app/oracle/admin/cad/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/cad/control01.ctl','/u01/app/oracle/fast_recovery_area/cad/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_file_name_convert='+DATA/bol/datafile','/u01/app/oracle/oradata/cad/data','+DATA/bol/tempfile','/u01/app/oracle/oradata/cad/tempfile'
*.db_name='bol'
*.service_names='cad'
*.db_unique_name='cad'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area/cad'
*.db_recovery_file_dest_size=6005194752
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=bolXDB)'
*.fal_server='cad'
*.log_archive_config='dg_config=(bol,cad)'
*.log_archive_dest_1='location=/u01/app/oracle/archive/cad valid_for=(all_logfiles,all_roles) db_unique_name=cad'
*.log_archive_dest_2='service=bol valid_for=(online_logfiles,primary_role) db_unique_name=bol'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='%t_%s_%r.arch'
*.log_file_name_convert='+FRA/bol/onlinelog','/u01/app/oracle/admin/cad/redo'
*.memory_target=1606418432
*.open_cursors=300
*.processes=500
*.remote_login_passwordfile='exclusive'
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'

6 使用 spfile 将备库启动 nomount 状态并启动监听
7 备库进行duplicate
export ORACLE_SID=cad
rman target sys/****@10.*.29/bol auxiliary sys/****@cad nocatalog
8 开启dg复制