Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

2931143Oct 29 2015 — edited Oct 29 2015

Hi,

I am not able to connect to database using sqlplus, while using following command :

          sqlplus activites@OCA010

I am getting the error "ORA-12154: TNS:could not resolve the connect identifier specified".

I tried connecting by providing complete connection string as :"sqlplus activities/act@192.168.10.3:1521/compix" and it was successful.

I also tried connecting using sql developer by providing TNS Network alias "OCA010" an this is also successful.

Could someone please help here and let me know how can i connect using sqlplus using TNS network alias.

tnsnames.ora file content is as follows

# tnsnames.ora Network Configuration File: D:\Oracle\product\11.2.0\dbhome_1\network\admin\tnsnames.ora

# Generated by Oracle configuration tools.

COMPIX =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = LUCKY-HP)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = compix)

    )

  )

OCA =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = LUCKY-HP)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = oca)

    )

  )

ORACLR_CONNECTION_DATA =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

    (CONNECT_DATA =

      (SID = CLRExtProc)

      (PRESENTATION = RO)

    )

  )

OCA01 =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = LUCKY-HP)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = OCA01)

    )

  )

 

  OCA010 =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.3)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = compix)

    )

  )

Thanks in advance.

This post has been answered by EdStevens on Oct 29 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2015
Added on Oct 29 2015
8 comments
3,638 views