Oracle SQLCL 18.2:
The TNSPING utility in the SQLCL 18.2 tool determines if the listener of service in an Oracle network can be successfully reached.
If the connection between a client and a server (or between servers) can be successfully established with the TNSPING utility, the full time (in milliseconds) it is expected to take to access the Oracle web service will appear.
If it cannot, a message will appear where you can see the reason for the error. This way, you can see the network error that has occurred without having to be connected to a database.
Use the following command to verify connectivity:
Where the address is a TNS entry or a JDBC connection string.
TNSPING localhost: 1521 / test
SQL> tnsping 10.10.4.2:1521/test ping: 18ms
SQL> tnsping 10.10.4.2:1521:test1 ORA-12505, TNS: listener does not currently know of SID given in connect descriptor ping: -1ms SQL>
It means if you are using exact and perfect code then you can not get any issue during establishing the connection.
Consider Reading to these articles: