oracle客戶端連線server 端, tnsnames的三種設定方式

likaiabc發表於2007-10-03

一、CONNECT_DATA設定為oracle的全域性資料庫名

TOS =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = soho-ivgcrcy9al)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = tos.lee.com)

)

)

假定資料庫init.ora的引數設定為
db_name = tos

db_domain = lee.com

也可以直接指定service_names = tos.lee.com

注意,service_names是個動態引數,pmon程式在動態的註冊到listener 時有延遲(大概幾分鐘)

二、設定SERVICE_NAME listener.ora裡的GLOBAL_DBNAME

tnsnames.ora

TOS =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = soho-ivgcrcy9al)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = tos)

)

)

listener.ora

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(

GLOBAL_DBNAME = tos)

(ORACLE_HOME = D:oracleora92)

(SID_NAME = oracledb)

)

)

三、設定sidlistener.ora裡的sid_name

tnsnames.ora

TOS =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = soho-ivgcrcy9al)(PORT = 1521))

)

(CONNECT_DATA =

(sid = oracledb)

)

)

listener.ora

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(ORACLE_HOME = D:oracleora92)

(SID_NAME = oracledb)

)

)

其中後兩種設定方式,listener.ora中的 sid_name必須和 instance_name 一致.

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8193225/viewspace-974667/,如需轉載,請註明出處,否則將追究法律責任。

相關文章