服務(wù)端配置 如果不想自己寫(xiě),可以通過(guò) Net Manager 來(lái)配置. 以下配置文件中的 localhost 改為 ip 地址,否則,遠(yuǎn)程不能訪問(wèn). 1.網(wǎng)絡(luò)監(jiān)聽(tīng)配置 # listener.ora Network Configuration File: C:/app/Administrator/product/11.2.0/dbhome_1/network/admin/listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = C:/app/Administrator/product/11.2.0/dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:C:/app/Administrator/product/11.2.0/dbhome_1/bin/oraclr11.dll") ) )LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) )ADR_BASE_LISTENER = C:/app/Administrator 多個(gè)IP時(shí),如下: LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.24.226.2)(PORT = 1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.24.226.3)(PORT = 1521)) ) ) 2.TNS 配置 # tnsnames.ora Network Configuration File: C:/app/Administrator/product/11.2.0/dbhome_1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.ORCL= (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (CONNECT_DATA = (SID = CLRExtProc) (PRESENTATION = RO) ) )LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) 多個(gè)IP時(shí),如下: ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.24.226.2)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 172.24.226.3)(PORT = 1521)) ) (SOURCE_ROUTE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) 3.停止和啟動(dòng)服務(wù) 先停止以下服務(wù),然后再啟動(dòng). OracleOraDb11g_homeTNSListenerOracleService* 客戶(hù)端配置 1.下載 ODAC 壓縮包. 2.解壓下載的 ODAC 壓縮包. 3.執(zhí)行安裝命令 示例: install.bat all D:/Program/ODAC/12040x64 OracleHome true 4.添加環(huán)境變量 ORACLE_HOME : 是 ODAC 安裝的目錄. TNS_ADMIN : 是文件 tnsnames.ora 所在的目錄,一般為 ODAC 安裝目錄下的 network/admin 中. 注: TNS_ADMIN 可以不用添加,直接將 tnsnames.ora 文件復(fù)制到 ODAC 安裝目錄下即可 將 %ORACLE_HOME% 添加到 PATH 環(huán)境變量中. 5.配置 TNS 在配置文件 tnsnames.ora 中加入 DBORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = <db-host>)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = <db-name>) ) ) |
免責(zé)聲明:本站部分文章和圖片均來(lái)自用戶(hù)投稿和網(wǎng)絡(luò)收集,旨在傳播知識(shí),文章和圖片版權(quán)歸原作者及原出處所有,僅供學(xué)習(xí)與參考,請(qǐng)勿用于商業(yè)用途,如果損害了您的權(quán)利,請(qǐng)聯(lián)系我們及時(shí)修正或刪除。謝謝!
始終以前瞻性的眼光聚焦站長(zhǎng)、創(chuàng)業(yè)、互聯(lián)網(wǎng)等領(lǐng)域,為您提供最新最全的互聯(lián)網(wǎng)資訊,幫助站長(zhǎng)轉(zhuǎn)型升級(jí),為互聯(lián)網(wǎng)創(chuàng)業(yè)者提供更加優(yōu)質(zhì)的創(chuàng)業(yè)信息和品牌營(yíng)銷(xiāo)服務(wù),與站長(zhǎng)一起進(jìn)步!讓互聯(lián)網(wǎng)創(chuàng)業(yè)者不再孤獨(dú)!
掃一掃,關(guān)注站長(zhǎng)網(wǎng)微信