0

I installed oracle 12c pn windows following the defaults settings... I end up with ORCL and ORCLPDB...

I can connect to ORCLPDB using EZCONNECT via CONN system/password@//localhost:1521/ORCLPDB . Then I added a service name in my tnsnames.ora like this :

ORCLPDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orclpdb)
    )
  )

But when I try connect system/password@ORCLPDB I get the following error :

ORA-12154: TNS:could not resolve the connect identifier specified

This is strange because lsnrctl services has the following entry :

Service "orclpdb" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVER

What should I do ?

  • What is the output of tnsping orclpdb? You may not be hitting the tnsnames file you have the tns entry in or your sqlnet file may not be set up properly. When you tnsping, you should get a line that looks like: Used parameter files: /path/to/sqlnet.ora – Nick S Dec 19 '17 at 13:58
  • @NickS Yup. I got that error... TNS-03505: Failed to resolve name plus path to sqlnet.ora.... As I said EZCONNECT works fine and TNSNAMES is added like that NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) in sqlnet.ora... WHat is even stranger is that tnsping orcl gives TNS-12533: TNS:illegal ADDRESS parameters... OOPS... I just noticed that even for connecting to the CDB orcl, connect system/password@ORCL also isnt working... ORA-12154: TNS:could not resolve the connect identifier specified – Kurt Miller Dec 19 '17 at 21:26
  • @JSapkota Please see the comment above...It's not only a problem with my CDB – Kurt Miller Dec 19 '17 at 21:26
  • 1
    Is there white space in front of the tnsname? For example [ ]ORCLPDB. – JSapkota Dec 19 '17 at 23:43
  • @JSapkota You are a genius.... There was actually white space in front of it... Problem solved.... Thank you very much... Wow how did you think about that ? Thank you JSapkota. Add this as an answer and I'll accept it if you want – Kurt Miller Dec 20 '17 at 5:46
1

The problem is the TNS name which contains a leading whitespace.

For example:

[Whitespace]ORCLPDB = (DESCRIPTION = ...

As we know, the @ in connection string should immediately followed by the TNS name we can't have whitespace in front of a TNS name.

  • I don't know if it's the issue. I just checkd and it is properly set as you've written above NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) It was like that by default I suppose – Kurt Miller Dec 18 '17 at 20:46

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.