3 Replies Latest reply: Jan 24, 2013 2:00 AM by Alain RSS

    Win 7 x64 - 11g xe and 11g client - cannot connect locally

    Alain
      Hi,
      I have a win 7 x64 computer (in a domain). I installed oracle 11g XE (local database) AND also oracle 11 full client (for remote databases administration).
      I only set ORACLE_SID=XE and added xe in tnsnames.ora.

      I can connect using sqlplus system/password@XE as sysdba, but sqlplus system/password is refused. sqlplus / as sysdba is also refused.

      I would like to put the db in archivelog mode, not possible: I even can't do a startup mount.

      Any hint?
        • 1. Re: Win 7 x64 - 11g xe and 11g client - cannot connect locally
          Paul M.
          I only set ORACLE_SID=XE and added xe in tnsnames.ora.

          I can connect using sqlplus system/password@XE as sysdba, but sqlplus system/password is refused. sqlplus / as sysdba is also refused.
          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 :
          C:\>set ORACLE_HOME=<XE Oracle Home>
          
          C:\>set PATH=%ORACLE_HOME%\bin;%PATH%
          
          C:\>set ORACLE_SID=XE
          
          C:\>sqlplus / as sysdba
          • 2. Re: Win 7 x64 - 11g xe and 11g client - cannot connect locally
            clcarter
            I even can't do a startup mount.
            Yes that does sound like a rather unfortunate situation ;)

            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:
            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
            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.

            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.
            • 3. Re: Win 7 x64 - 11g xe and 11g client - cannot connect locally
              Alain
              thanks, it works now.