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.