开发者

TNS:listener does not currently know of service requested in connect descriptor

开发者 https://www.devze.com 2023-04-11 16:10 出处:网络
I get ORA-12514:TNS:listener does not currently know of service requested in connect descriptor when running my application yet I can connect to the database via server explorer in visual studio. Wher

I get ORA-12514:TNS:listener does not currently know of service requested in connect descriptor when running my application yet I can connect to the database via server explorer in visual studio. Where does the application look (when published) to get the information required to conne开发者_StackOverflow社区ct to the database? The connection string used by our application is correct.


It can change as the following and it is working in my environment. Drive:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN

listener.ora

  1. Before

    LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) )

  2. After

    LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.50.90)(PORT = 1521)) ) )

tnsnames.ora

  1. Before

    LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

    ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )

  2. After

    LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.50.90)(PORT = 1521))

    ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.50.90)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )

After that, restart the OracleOraDb11g_home1TNSListener service and OracleServiceORCL service.


look for tnsnames.ora

http://www.orafaq.com/wiki/Tnsnames.ora

and keep in mind service name vs. server name.


I faced the same exception when using sqldeveloper client. This may happen if the tnsnames.ora is not present in your machine or sqldeveloper is not properly installed.

To resolve this error, change the connection type to advanced and provide the JDBC connection URL in the format "jdbc:oracle:thin:@hostname:port:sid" as shown in the image below

TNS:listener does not currently know of service requested in connect descriptor

0

精彩评论

暂无评论...
验证码 换一张
取 消