I have installed the Oracle 19c server on Oracle Linux 8.4 on a VM.I am able to connect on the oracle server directly.However, my requirement is to be able to connect from oracle client on another VM.Iam able to ping the server from the client VM as well.
Iam able to ping my service using tns ping from oracle client to server
[oracle@cshost ~]$ tnsping mydb
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 09-JAN-2022 18:34:54
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0/client_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST=orahost.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = MYDB.LOCALDOMAIN)))
OK (0 msec)
but when i connect using the below i get login error
[oracle@cshost ~]$ sqlplus vijgarud@mydb/vijgarud;
SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jan 9 18:50:11 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
However iam able to connect using the same account directly on server after the below
[oracle@orahost ~]sqlplus / as sysdba$ sqlplus / as sysdba;
SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jan 9 18:55:52 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> connect vijgarud@mydb /vijgarud;
Connected.
SQL>
MY Tnsnames.ora on my client VM looks like the below
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.3/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
MYDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST=orahost.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = MYDB.LOCALDOMAIN)
)
)