TNSNAMES.ORA is a SQL*Net configuration file that defines databases addresses for establishing connections to them. This file normally resides in the ORACLE HOME\NETWORK\ADMIN directory.
Example how connection define :
(ADDRESS = (PROTOCOL = TCP)(HOST = my-server )(PORT = 1521))
(SERVICE_NAME = orcl1)
Sometimes you can Bypass the tnsnames.ora and connect to sqlplus without even Create new connection, all you have to do is put all of the connectivity information in your connection string this type of connection called “EZCONNECT”.
and to enable EZCONNECT you should add the below line in sqlnet.ora which is located in the same directory $ORACLE_HOME/network/admin
check the below examples :
The Below using the default listener port 1521 :
1- sqlplus scott/tiger@myservername/orcl1
Different Listener port will be like the below :
2- sqlplus scott/tiger@myservername:1522/orcl1
3- sqlplus USER/PASSWORD@//myservername:1521/orcl1
and if you want to disable EZCONNECT For Secuirty Reasons add the below line in :
One thought on “Connect to Oracle without Tnsnames.ora”
Thanks for sharing the informationFor more info : Oracle Certification Courses