服務(wù)端配置
如果不想自己寫,可以通過(guò) Net Manager 來(lái)配置.
以下配置文件中的 localhost 改為 ip 地址,否則,遠(yuǎn)程不能訪問(wèn).
1.網(wǎng)絡(luò)監(jiān)聽配置
# 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_homeTNSListener
OracleService*
客戶端配置
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>)
)
)
說(shuō)明:
db-host> : 數(shù)據(jù)庫(kù)電腦的IP或者是計(jì)算機(jī)名
db-name> : 數(shù)據(jù)庫(kù)TNS配置的名稱
總結(jié)
以上所述是小編給大家介紹的Oracle 配置遠(yuǎn)程訪問(wèn)教程,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
您可能感興趣的文章:- oracle不能使用EM怎么辦 oracle11g如何正確安裝配置EM
- Oracle 11g 客戶端的安裝和配置的圖文教程
- Windows Sever 2012下Oracle 12c安裝配置方法圖文教程
- 詳解Docker中安裝配置Oracle數(shù)據(jù)庫(kù)
- 在Docker上安裝配置Oracle教程