Oracle tnsnames.ora Entry Generator
Fill in a net service alias, host, port and service name (or SID) to get a correctly indented tnsnames.ora entry, together with the matching Easy Connect string, Easy Connect Plus string, JDBC thin URLs, sqlplus commands and a sqlnet.ora hint. Add extra hosts for RAC or Data Guard failover with FAILOVER and LOAD_BALANCE, pick DEDICATED, SHARED or POOLED server mode, set CONNECT_TIMEOUT and RETRY_COUNT, or switch to TCPS with SSL_SERVER_DN_MATCH. You can also paste an existing entry, comments and all, to load it back into the form. Everything runs in your browser; nothing is uploaded.
Do more than oracle tnsnames.ora entry generator — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Enter the net service alias, host, port and the SERVICE_NAME (or SID), choose TCP or TCPS, and add extra addresses for RAC or failover if needed.
- Optionally set the server mode, CONNECT_TIMEOUT, RETRY_COUNT and TLS options, or paste an existing tnsnames.ora entry and click Parse to fill the form.
- Review the warnings, then copy the tnsnames.ora entry, EZConnect string, JDBC URL or sqlplus command you need with the Copy buttons.
Frequently asked questions
Where is the tnsnames.ora file located?
Oracle clients look for tnsnames.ora in the directory named by the TNS_ADMIN environment variable first, then in $ORACLE_HOME/network/admin (for Instant Client: the network/admin folder inside the Instant Client directory). On Windows TNS_ADMIN can also be set in the registry. sqlnet.ora, which controls NAMES.DIRECTORY_PATH and the wallet location, lives in the same directory. JDBC thin clients do not read these defaults automatically: pass -Doracle.net.tns_admin=/path or append ?TNS_ADMIN=/path to a jdbc:oracle:thin:@ALIAS URL.
Should I use SERVICE_NAME or SID in tnsnames.ora?
Use SERVICE_NAME. A SID identifies a single instance, while a service name can be offered by several RAC instances, moved by Data Guard, and is the only way to reach a pluggable database (PDB) in Oracle 12c and later. Easy Connect strings and the jdbc:oracle:thin:@//host:port/service URL only accept service names; the host:port:SID JDBC form and (SID = ...) in CONNECT_DATA remain for legacy non-CDB databases. Run SELECT value FROM v$parameter WHERE name = 'service_names' or lsnrctl services to see the available services.
Why do I get ORA-12154 or ORA-12514 when connecting?
ORA-12154 (TNS: could not resolve the connect identifier) means the client did not find the alias: check TNS_ADMIN, the file name, that the alias starts in the first column, that parentheses are balanced, and that NAMES.DEFAULT_DOMAIN is not appending a domain. ORA-12514 (listener does not currently know of service) means the file was found but the SERVICE_NAME is not registered with the listener - compare it with lsnrctl status. Once the connection works, Chat2DB, a free AI-powered SQL client, can connect to Oracle with the same host, port and service name: download it at https://chat2db.ai/download.
