This content has been marked as final. Show 4 replies
Your problem is you have two Oracle_homes, and the Developer Suite home is the first one.
As soon as you start any Oracle tool, it will determine which Oracle_home to use. This determines which tnsnames.ora it uses unless you set the TNS_ADMIN environment variable. This is documented, and posted here, and all over the Internet, over and over again to answer questions from people, who assume they are unique, and refuse to do any research prior to posting the question yet again.
You are one of those persons.
Senior Oracle DBA
1. Create a new user Variable called “TNS_ADMIN”
Assume ORACLE_HOME of XE is in C:\oracle\product\oraclexe
Since when you install Oracle 10g Express Edition, a tnsnames.ora file has already been created for you in C:\oracle\product\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN\tnsnames.ora
•Either set TNS_ADMIN in DOS prompt or in a New User Variable
You can set TNS_ADMIN to your local path of Oracle Express Database
set TNS_ADMIN= C:\oracle\product\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN\tnsnames.ora
or you can copy tnsnames.ora from C:\oracle\product\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN\tnsnames.ora to C:\oracle\product\XEClient, and set TNS_ADMIN in the User Variable
Click on [Start], Programs, Oracle Client 10g Express Edition, Run SQL Command Line
SQL> connect sys/ora10g_manager@xe as sysdba
Other ways to connect to Oracle Express in DOS prompt
Method 1: Set TNS_ADMIN in DOS prompt
In DOS prompt,
C:\> set TNS_ADMIN=C:\oracle\product\XEClient
C:\> C:\oracle\product\XEClient\bin\sqlplus.exe /nolog
SQL> connect sys/ora10g_manager@XE as sysdba
Method 2: No need to set TNS_ADMIN in DOS prompt but enter the full connection string in one line of DOS command
Set NLS_LANG in DOS Prompt
Enter the following DOS command all in ONE line
C:\>sqlplus "sys/ora10g_manager@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XE))) as sysdba"
It does not work for me.
Why it has to be so difficult? Why not it installs/configures automatically? The software objective is that: make the user life easyer, not more complicated...
Because it is Oracle. If they make our life easier, we will have more time thinking in how to get rid of their products from our companies...
Every other version of oracle client comes with a NETWORK/ADMIN directory shipped. Oracle Express Client (for linux at least) does not have it.
And about the documentation, for sure it is on "the web", and we have to do our "research", but when it comes to Oracle documentation, we can have all sorts of information but to find what you will need is another thing... For instance, how an average person can find that an environmental variable could affect the instance lookup?
And why, for God's sake, Oracle still uses TNSNAMES.ORA?