阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

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

190次阅读
没有评论

共计 3671 个字符,预计需要花费 10 分钟才能阅读完成。

由于环境限制,现在需要把 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 复制

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计3671字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中