下面為您介紹的是Oracle服務端和客戶端之間的網絡監聽設置,如果您在Oracle服務端和客戶端之間的網絡監聽設置方面遇到過類似的問題,不妨一看。
Oracle服務端和客戶端之間的網絡監聽設置
假如我現在有兩個數據庫kkman和orcl,現在我想在服務端設立兩個監聽來處理從客戶端發過來的連接請求。
-----------------------------------------------------------------
第一種多端口監聽
1.服務端listener.ora配置
- # listener.ora Network Configuration File: C:\Oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
- # Generated by Oracle configuration tools.
- SID_LIST_LISTENERORCL =
- (SID_LIST =
- (SID_DESC =
- (GLOBAL_DBNAME = ORCL)
- (SID_NAME = ORCL)
- )
- (SID_DESC =
- (GLOBAL_DBNAME = KKMAN)
- (SID_NAME = KKMAN)
- )
- )
- LISTENER =
- (DESCRIPTION_LIST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = rac02)(PORT = 1521))
- (ADDRESS = (PROTOCOL = TCP)(HOST = rac02)(PORT = 1522))
- )
- )
2.服務端和客戶端tnsnames.ora配置
- # tnsnames.ora Network Configuration File: C:\Oracle\product\10.2.0\clIEnt_1\NETWORK\ADMIN\tnsnames.ora
- # Generated by Oracle configuration tools.
- KKMAN =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.3)(PORT = 1522))
- )
- (CONNECT_DATA =
- (SERVICE_NAME = KKMAN)
- )
- )
- ORCL =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.3)(PORT = 1521))
- )
- (CONNECT_DATA =
- (SERVICE_NAME = orcl)
- )
- )
3.重新啟動監聽
在服務端打開cmd運行:lsnrctl stop和lsnrctl start
--------------------------------------------------------------------------------
2.多監聽單端口
1.服務端listener.ora配置
- # listener.ora Network Configuration File: C:\Oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
- # Generated by Oracle configuration tools.
- SID_LIST_LISTENERORCL =
- (SID_LIST =
- (SID_DESC =
- (GLOBAL_DBNAME = ORCL)
- (SID_NAME = ORCL)
- )
- (SID_DESC =
- (GLOBAL_DBNAME = KKMAN)
- (SID_NAME = KKMAN)
- )
- )
- LISTENER =
- (DESCRIPTION_LIST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = rac02)(PORT = 1521))
- )
- )
2.服務端和客戶端tnsnames.ora配置
- # tnsnames.ora Network Configuration File: C:\Oracle\product\10.2.0\clIEnt_1\NETWORK\ADMIN\tnsnames.ora
- # Generated by Oracle configuration tools.
- KKMAN =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.3)(PORT = 1521))
- )
- (CONNECT_DATA =
- (SERVICE_NAME = KKMAN)
- )
- )
- ORCL =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.3)(PORT = 1521))
- )
- (CONNECT_DATA =
- (SERVICE_NAME = orcl)
- )
- )
3.重新啟動監聽
在服務端打開cmd運行:lsnrctl stop和lsnrctl start