我用myeclipse創建了web應用並且用jdbc驅動創建數據庫連接,兵配置好監聽器和tnsname,當我在doc界界面啟動數據庫和監聽器後一切正常,tnsping 服務名也可以通過,但是登陸plsql出現登陸超時錯誤,sqlplus 登錄名/密碼@服務名出現TNS:監聽程序無法分發客戶機連接。在myeclipse上想測試連接
Connection conn=DButils.getInstance().getconn();
System.out.println(conn);
控制台輸出錯誤java.sql.SQLException:Listener refused the connection with the following error:ORA-12518,TNS:litener could not hand off client connection
。。。。null.
下面是我的監聽器和tnsname配置:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = F:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:F:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = F:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = orcl)
(ENVS = "EXTPROC_DLLS=ONLY:F:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 27.151.20.130)(PORT = 1521))
)
)
ADR_BASE_LISTENER = F:\app\Administrator
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))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 27.151.20.130)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
我查看session值session——cached_cuesors50,sesssion_max_open_files 10,sessions 248,
parameter值sga_max_size 1600M,
不知道是什麼原因,想做一個小項目在數據庫這邊卡住了心碎,希望大家能幫忙看看。
這個首先你要看服務器本機能不能登錄上數據庫,沒問題就把本機的TNS配置復制到客戶機的PL/SQL去試下,不行重新配置一下客戶機的監聽,還不行PING一下服務器的1521端口,這個要看具體報什麼錯才能給你解決