Oracle RAC和SCAN同时对外提供服务的配制方法
短信预约 -IT技能 免费直播动态提醒
1, tnsnames.ora on two nodes:
RACTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = racscan.test.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RACTEST.test.com)
)
)
RAC1_LOCAL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1vip.test.com)(PORT = 1529))
)
RAC2_LOCAL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2vip.test.com)(PORT = 1529))
)
RAC_REMOTE =
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=rac1vip.test.com)(PORT=1529))
(ADDRESS=(PROTOCOL=tcp)(HOST=rac2vip.test.com)(PORT=1529))
)
)
RAC_BALANCE=
(DESCRIPTION=
(ADDRESS_LIST=
(LOAD_BALANCE=YES)
(FAILOVER=YES)
(ADDRESS=(PROTOCOL=tcp)(HOST=rac1vip.test.com)(PORT=1529))
(ADDRESS=(PROTOCOL=tcp)(HOST=rac2vip.test.com)(PORT=1529))
)
(CONNECT_DATA=
(SERVICE_NAME=RACTEST.test.com)
)
)
2,listener.ora on two nodes:
node1:RAC=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1vip.test.com)(PORT = 1529))
)
SID_LIST_RAC=
(SID_LIST=
(SID_DESC = (ORACLE_HOME =/dbfs/app/oracle/product/11.2.0/dbhome_1)(SID_NAME=RACTEST1))
)
node2:RAC=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2vip.test.com)(PORT = 1529))
)
SID_LIST_RAC=
(SID_LIST=
(SID_DESC = (ORACLE_HOME =/dbfs/app/oracle/product/11.2.0/dbhome_1)(SID_NAME=RACTEST2))
)
3, 参数:
node1:
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string RAC1_LOCAL
SQL> show parameter remote_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_listener string racscan.test.com:1521
------------------------------------ ----------- --------------------------------------------------------------------------------------------------------------------------------------------------------------
node2:
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string RAC2_LOCAL
SQL> show parameter remote_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_listener string racscan.test.com:1521
4,参数文件:
pfile:
[oratest@rac1 dbs]$ cat initRACTEST1.ora
spfile='+DATA/RACTEST/spfileractest.ora'
[oratest@rac2 dbs]$ cat initRACTEST2.ora
spfile='+DATA/RACTEST/spfileractest.ora'
根据pfile创建spfile:
create spfile='+DATA/RACTEST/spfileractest.ora' from pfile;
5, 参数修改命令:
alter system set local_listener='RAC1_LOCAL' sid='RACTEST1' scope=both;
alter system set local_listener='RAC2_LOCAL' sid='RACTEST2' scope=both;
RACTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = racscan.test.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RACTEST.test.com)
)
)
RAC1_LOCAL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1vip.test.com)(PORT = 1529))
)
RAC2_LOCAL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2vip.test.com)(PORT = 1529))
)
RAC_REMOTE =
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=rac1vip.test.com)(PORT=1529))
(ADDRESS=(PROTOCOL=tcp)(HOST=rac2vip.test.com)(PORT=1529))
)
)
RAC_BALANCE=
(DESCRIPTION=
(ADDRESS_LIST=
(LOAD_BALANCE=YES)
(FAILOVER=YES)
(ADDRESS=(PROTOCOL=tcp)(HOST=rac1vip.test.com)(PORT=1529))
(ADDRESS=(PROTOCOL=tcp)(HOST=rac2vip.test.com)(PORT=1529))
)
(CONNECT_DATA=
(SERVICE_NAME=RACTEST.test.com)
)
)
2,listener.ora on two nodes:
node1:RAC=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1vip.test.com)(PORT = 1529))
)
SID_LIST_RAC=
(SID_LIST=
(SID_DESC = (ORACLE_HOME =/dbfs/app/oracle/product/11.2.0/dbhome_1)(SID_NAME=RACTEST1))
)
node2:RAC=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2vip.test.com)(PORT = 1529))
)
SID_LIST_RAC=
(SID_LIST=
(SID_DESC = (ORACLE_HOME =/dbfs/app/oracle/product/11.2.0/dbhome_1)(SID_NAME=RACTEST2))
)
3, 参数:
node1:
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string RAC1_LOCAL
SQL> show parameter remote_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_listener string racscan.test.com:1521
------------------------------------ ----------- --------------------------------------------------------------------------------------------------------------------------------------------------------------
node2:
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string RAC2_LOCAL
SQL> show parameter remote_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_listener string racscan.test.com:1521
4,参数文件:
pfile:
[oratest@rac1 dbs]$ cat initRACTEST1.ora
spfile='+DATA/RACTEST/spfileractest.ora'
[oratest@rac2 dbs]$ cat initRACTEST2.ora
spfile='+DATA/RACTEST/spfileractest.ora'
根据pfile创建spfile:
create spfile='+DATA/RACTEST/spfileractest.ora' from pfile;
5, 参数修改命令:
alter system set local_listener='RAC1_LOCAL' sid='RACTEST1' scope=both;
alter system set local_listener='RAC2_LOCAL' sid='RACTEST2' scope=both;
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341