This content has been marked as final. Show 3 replies
I only set ORACLE_SID=XE and added xe in tnsnames.ora.Looks like you're working in Client Home, if so you can't connect locally, it's the same as if you were on a different machine. You may try setting XE Home :
I can connect using sqlplus system/password@XE as sysdba, but sqlplus system/password is refused. sqlplus / as sysdba is also refused.
C:\>set ORACLE_HOME=<XE Oracle Home> C:\>set PATH=%ORACLE_HOME%\bin;%PATH% C:\>set ORACLE_SID=XE C:\>sqlplus / as sysdba
Yes that does sound like a rather unfortunate situation ;)
I even can't do a startup mount.
Was the 11g client installed after the XE installer was run? Some clients used to add an "oracle home switcher" program item in Windows, which would let you set your environment to a specific ORACLE_HOME when more than one Oracle software installation exists on the host.
Specifically for XE, since its a "one installation allowed per host" setup when other oracle installations are on the box it works better when installing XE last, after all the other installs.
Its a bit trickier for Windows, since you shouldn't have to specify ORACLE_HOME or tweak your environment settings (i.e. %PATH%, %ORACLE_SID%, %ORACLE_HOME%) as one needs to on Linux. In Windows those settings are "maintained" under regedit entries. Gee, things were so much less complicated when one only had 500 application .ini files on a host ;)
Anyways, a .bat file may do the trick. Try a Notepad session, paste these lines in and adjust appropriately for your XE installation, save it as xeenv.bat and run your .bat file. You should then have better luck with a sqlplus /as sysdba connection:
The ORACLE_SID line may or may not be needed, it will take some testing to see what can work. I don't use Windows much so this might not be exactly or totally correct.
rem xeenv.bat rem set the XE ORACLE_HOME in front of PATH set PATH=C:\oraclexe\app\oracle\product\11.2.0\server\bin;%PATH% rem set ORACLE_SID=XE
If using the instant client (?) ORACLE_HOME you won't be able to get a "connect /as sysdba" since a non-tnsname connection (a "connect [user/passwd]@<tnsalias>) has to use the Oracle binaries that run the database. When the .bat file puts your XE ORACLE_HOME in the path that should change sqlplus behavior.
thanks, it works now.