Greetings

There are many topics on this issue over the internet but None of them addresses this issue properly, so I couldn't find a solution to the problem.

I installed: *Oracle Database 10g Express Edition*

After the installation was done, I opened SQL Command Line
and I used the command "connect" to login
I enter the *username*
Then I entered the *password*

After a couple of seconds I got the following ERROR message:
*ORA-12154: TNS:could not resolve the connect identifier specified*

Screenshot of the error:

I installed this version of Oracle on both Windows XP 32 bit and Windows 7 32 bit and I get the same error message when it tries to connect.

Why doesn't Oracle work right after the installation?
Are there any further steps that need to be done in order to make this work? If so I would really appreciate any step by step help, I've been stuck trying to find a solution for days.

Dani AI

Generated

Brief summary and likely causes: ORA-12154 means the Oracle client could not resolve the connect identifier (the TNS alias or connect string). This is usually a local configuration issue: the client is looking in the wrong Oracle home, the TNS alias is missing or has the wrong filename/extension, or SQLNET/TNS settings point somewhere else. is correct to check tnsnames.ora, but the troubleshooting below fills in the practical steps and common traps.

Useful diagnostics and checks (run locally):

sqlplus -v
echo %ORACLE_HOME%
echo %TNS_ADMIN%
echo %PATH%
dir "%ORACLE_HOME%\network\admin\tnsnames.ora"
lsnrctl status

What to look for and fixes:

  • Multiple Oracle installations: confirm the sqlplus in PATH is the XE one. If an older client appears first, move the XE ...\bin ahead or use the full path to the XE sqlplus.
  • TNS files location: tnsnames.ora normally lives in %ORACLE_HOME%\network\admin. If TNS_ADMIN is set, Oracle will use that folder instead. Confirm the file is literally named tnsnames.ora (Windows Notepad can save it as tnsnames.ora.txt by accident).
  • sqlnet.ora: ensure NAMES.DIRECTORY_PATH includes TNSNAMES (or EZCONNECT if that will be used).
  • Listener and DB: confirm the database service and listener are running (check Services or use lsnrctl status).

Quick workaround (bypass tnsnames.ora):

sqlplus username/password@//localhost:1521/XE

This uses Easy Connect and avoids the TNS alias.

Common gotchas: hidden “.txt” extensions, wrong Oracle home in PATH, TNS_ADMIN pointing to an empty folder, or editing the wrong tnsnames.ora. The steps above narrow the cause quickly so the actual TNS alias resolution problem can be fixed without reinstalls.

Hello

If your problem is still existed, you may check whether TNSNAMES.ORA is in your directory path. There could also be discrepance between SQLNET.ORA and TNSNAMES.ORA. You could post both files here (make copy of them and replace your private data). Well, I am not an ora admin, just working with it, nevertheless I am trying to help you.

Where is our friend Deabsis Das? He is true Oracle expert and can help you instantly.

-- tes

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.