Oracle TNS: net service name is incorrecly specified

后端 未结 7 1160
别跟我提以往
别跟我提以往 2021-02-12 14:50

Help! I\'m a newbie to Oracle who\'s trying to access a database on an old server we inherited for a client.

I\'m confident I have the oracle database and listener start

相关标签:
7条回答
  • 2021-02-12 14:58

    In my case, the problem was that the DSN and the ServiceName was configured as the same in the odbc.ini file.This should not be a problem, but only after changing the DSN name, I was able to connect to the database through isql.

    0 讨论(0)
  • 2021-02-12 14:59

    Are you trying a local connection (e.g. "sqlplus u/p") or a network connection (e.g. "sqlplus u/p@pnews10s.world")? Are they both giving you the same error?

    The TNSPING by definition is using a network connection. I see some references that indicate you can get the 12612 error when using a local connection. So that is a possible explanation why you are seeing the error from SQLPlus but not TNSPING. If so, try doing a network connection instead.

    The local connection not working is probably due to ORACLE_SID not being set correctly as John suggested, but his syntax may not be the right method for whatever shell you are using. Make sure you are using the correct method for the given shell, such as "export ORACLE_SID=name" or "setenv ORACLE_SID name".

    0 讨论(0)
  • 2021-02-12 15:08

    export ORACLE_SID=bvteng worked for me, where bvteng was the service name.

    0 讨论(0)
  • 2021-02-12 15:10

    Dave Costa has presented you with 2 important question. Are you trying to connect via net8 or locally via extproc? Is the listener on the local machine(127.0.0.1 -- loop back device) setup for extproc connection?

    To use the net8 or tcp connection protocol, you need to specify user/pw@tns_alias. To connect locally via extproc you should specify the oracle_sid parameter and then connect via name/pw.

    I also notice the tnsalias has the .world domain appended to it, but the sqlnet.ora file does not contain a reference to NAMES.DEFAULT_DOMAIN as being "world".

    Also what is the env parameter for TNS_ADMIN? Make sure your tools are looking at the correct tnsnames.ora file. Too many time people modify one tnsnames.ora and the programs/software is looking at another.

    0 讨论(0)
  • I have edited the tnsnames.ora file to change the host to 127.0.0.1 rather than an external url and am able to successfully tnsping my connection, but am not getting much further.

    The last time that happened to me (tnsping works but sqlplus does not, same error message you got), the issue was that someone had copied the tnsnames.ora file from a Windows machine, and left the wrong line feed codes in.

    If that is the case, you need to do some dos2unix.

    These files are very sensitive to "correct" white-space and tabbing.

    Someone should complain to Oracle about that.

    0 讨论(0)
  • 2021-02-12 15:15

    Check the tnsnames.ora file, in my case, took me days to find out there were either tab characters in the connection string or other invisible special characters that were causing it to fail.

    0 讨论(0)
提交回复
热议问题