Linux AS3.0+Oracle9.2.0.7 RAC Listener.ora, tnsnames.ora,spfileSID.ora檔案設定

tolywang發表於2007-08-04

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 = " target="_blank">)
)
)

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 = " target="_blank">)
)
)

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/35489/viewspace-84845/,如需轉載,請註明出處,否則將追究法律責任。

相關文章