0

I'm facing an error when I try to connect to ORACLE server.

I download instant client 12c, which contains basic, sdk, tool, and sqlplus. Now I have the following directories and files. enter image description here

And my envrionment variables are like

## ORACLE Environment
export ORACLE_SID=TEST01
export ORACLE_HOME=${HOME}/instantclient_12_1
export TNS_ADMIN=${HOME}/instantclient_12_1
export PATH=${ORACLE_HOME}:${PATH}
export LD_LIBRARY_PATH=${ORACLE_HOME}:${LD_LIBRARY_PATH}

When I downloaded the client, there was no "tnsnames.ora" file. So, I created it by myself in the "TNS_ADMIN" path. The configuration is such as following.

TEST01 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.xxx.xxx)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test01)
    )
  )

I checked the HOST value is the server IP address, and port as well. However, when I boot and try to connect to server via sqlplus, it shows like following.

ERROR:
ORA-12545: Connect failed because target host or object does not exist

In the server, it connects very well.. I've tried several solutions from Google, but it won't work..

Thank you.

  • Is this a RAC database? 99% of the ORA-12545 errors I have seen were caused by the lack of name resolution of the VIP addresses on the client. – Balazs Papp May 18 '18 at 6:15
  • No, it's not RAC. The thing I can't figure out is another account is using full client and it can connect to the server. – owcred601 May 18 '18 at 6:28
0

I solved this problem, but I don't understand the reason.

When I connect to the server from the machine the server is installed on, I can use both following commands:

1. sqlplus server01/server01
2. sqlplus server01/server01@SID

However, from the machine the client is installed on, I can't use the command without @SID. Both envrionments have the same ORACLE_SID environment variable and I specify the SID in "tnsnames.ora".

Could you explain why it works only with @SID?

Thank you.

  • 1
    sqlplus server01/server01 initiates a local connection to a database running on the local machine (unless TWO_TASK is set), but you tried to connect from another machine. – Balazs Papp May 18 '18 at 13:25
  • It sounds like Server side connections are going through memory (IPC I think is the name). This would indicate that your Listener may not be listening for connections on the external ports. – Michael Kutz May 19 '18 at 11:49
  • I tested the case that Balazs let me know in both environments and you are right. Thank you. – owcred601 May 21 '18 at 0:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.