RAC 的hosts 设置 :
rac1 , rac2
代码:--------------------------------------------------------------------------------
DELL-RAC02$cat hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1 localhost.localdomain localhost DELL-RAC02
10.1.1.101 DELL-PRI01
10.161.8.101 DELL-RAC01
172.17.8.81 DELL-RAC01
10.1.1.102 DELL-PRI02
10.161.8.102 DELL-RAC02
172.17.8.82 DELL-RAC02
---------------------------------------------------------------------------------
------------------------------------------------------------------------------------
spfile 设置 , rac1, rac2
代码:--------------------------------------------------------------------------------
.......
orcl1.instance_name='orcl1'
orcl2.instance_name='orcl2'
orcl1.instance_number=1
orcl2.instance_number=2
orcl1.local_listener='listener_orcl1'
orcl2.local_listener='listener_orcl2'
*.remote_listener='listeners_orcl'
.....--------------------------------------------------------------------------------
------------------------------------------------------------------------------------
Listener.ora 设置 , rac1, rac2
代码:--------------------------------------------------------------------------------
rac1 :
DELL-RAC01$cat listener.ora
# LISTENER.ORA Network Configuration File: /u01/product/oracle/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.81)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.101)(PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/product/oracle)
(PROGRAM = extproc)
)
(SID_DESC =
(ORACLE_HOME = /u01/product/oracle)
(SID_NAME = orcl1)
)
)
rac2 -----
DELL-RAC01$cat listener.ora
# LISTENER.ORA Network Configuration File: /u01/product/oracle/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.82)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.102)(PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/product/oracle)
(PROGRAM = extproc)
)
(SID_DESC =
(ORACLE_HOME = /u01/product/oracle)
(SID_NAME = orcl2)
)
)--------------------------------------------------------------------------------
------------------------
tnsnames.ora 设置
代码:--------------------------------------------------------------------------------
rac1 :
---------------
DELL-RAC01$cat tnsnames.ora
# TNSNAMES.ORA Network Configuration File: /u01/product/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENERS_ORCL =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.101)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.81)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.102)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.82)(PORT = 1521))
)
LISTENER_ORCL1 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.101)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.81)(PORT = 1521))
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.101)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.81)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.102)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.82)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = DELL-RAC01)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService" target="_blank">http://HRService)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORCL1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.101)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.81)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
(INSTANCE_NAME = orcl1)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.102)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.82)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
(INSTANCE_NAME = orcl2)
)
)
-------------------------------
rac2 :
DELL-RAC02$cat tnsnames.ora
# TNSNAMES.ORA Network Configuration File: /u01/product/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENERS_ORCL =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.101)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.81)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.102)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.82)(PORT = 1521))
)
LISTENER_ORCL2 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.102)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.82)(PORT = 1521))
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.101)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.81)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.102)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.82)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = DELL-RAC01)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService" target="_blank">http://HRService)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORCL1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.101)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.81)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
(INSTANCE_NAME = orcl1)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.102)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.8.82)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
(INSTANCE_NAME = orcl2)
)
)
--------------------------------------------------------------------------------
客户端连接:
RAC_NEW_TEST=
(DESCRIPTION=
(LOAD_BALANCE = yes)
(FAILOVER=on)
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=10.161.8.101)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=10.161.8.102)(PORT=1521))
)
(LOAD_BALANCE=yes)
(CONNECT_DATA=
(SERVICE_NAME=orcl)
(FAILOVER_MODE=
(TYPE=select)
(DELAY=5)
(METHOD=basic)
)
)
)
或者
RAC_NEW_TEST=
(DESCRIPTION=
(LOAD_BALANCE = yes)
(FAILOVER=on)
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=172.17.8.81)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=172.17.8.82)(PORT=1521))
)
(LOAD_BALANCE=yes)
(CONNECT_DATA=
(SERVICE_NAME=orcl)
(FAILOVER_MODE=
(TYPE=select)
(DELAY=5)
(METHOD=basic)
)
)
)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/87010/viewspace-399581/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/87010/viewspace-399581/