[oracle]Pro*c鏈接oracle數據庫
一程序鏈接oracle數據庫
EXEC
SQL
CONNECT
:DbUser IDENTIFIED
BY
:DbPasswd USING :DbServer;
其中DbServer為UCRC
查文件未發現一IP地址的定義
tnsnames
OID LOCALDOMAIN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost localdomain)(PORT =
))
)
(CONNECT_DATA =
(SERVICE_NAME = oid)
)
)
CAMS LOCALDOMAIN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost localdomain)(PORT =
))
)
(CONNECT_DATA =
(SERVICE_NAME = cams)
)
)
INST _HTTP LOCALDOMAIN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost localdomain)(PORT =
))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(divSENTATION =//admin)
)
)
EXTPROC_CONNECTION_DATA LOCALDOMAIN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(
KEY
= EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc )
(divSENTATION = RO)
)
)
說明
tnsnames
CAMS LOCALDOMAIN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = localhost localdomain)
(PORT = ))
)
(CONNECT_DATA =
(SERVICE_NAME = cams)
)
)
注意 這裡 ADDRESS項包含三個子參數
PROTOCOL
HOST :ip地址
PORT
CAMS
要確保在監聽文件中也有對應的一個 ADDRESS 項也包含同樣的三個子參
數 並且子參數的值對應都相等 另外 這裡 SERVICE_NAME 的值必需確
保與監聽文件中某 SID_DESC項下的 SID_NAME參數的值相等
From:http://tw.wingwit.com/Article/program/Oracle/201311/17479.html