5 Replies Latest reply: Feb 21, 2013 5:39 PM by Gary Graham-Oracle RSS

    Cannot create connection with SQL Developer using Oracle XE

    992599
      I installed the Oracle XE 10g and am trying to create a connection with SQL Developer. The inputs are:
      Connection Name: XE
      Username; SYS
      Password: <which I had given during Oracle XE installation>
      Hostname: localhost
      Port: 1521
      SID: XE

      The error: Listener refused the connection with the following error: ORA-12505
      TNS: Listener does not currently know of SID given in connect descriptor.

      Please help
        • 1. Re: Cannot create connection with SQL Developer using Oracle XE
          Jim Smith
          Looks like your database isn't running.

          The database installation should have created a menu option to startup the database.
          • 2. Re: Cannot create connection with SQL Developer using Oracle XE
            992599
            Thank you for your reply.

            If I start database(start -> all programs -> Oracle XE -> Start database), in the command prompt it says:
            Access denied.
            But, if I right click on it and do Run as administrator, it says service has already started.

            But same error after that when I try to create a connection with SQL Developer.
            • 3. Re: Cannot create connection with SQL Developer using Oracle XE
              Gary Graham-Oracle
              Hi,

              Did you try running the following command from a Windows console:
              lsnrctl status
              If XE is a valid SID, the output should contain something like the following:
              Services Summary...
              Service "xe.<yourdomain>" has 1 instance(s).
                Instance "XE", status UNKNOWN, has 1 handler(s) for this service...
              If not, then your listener.ora file may not have been created/updated properly. Or possibly you have a more complex environment with multiple listeners, or a single listener which may not be the listener that comes with Oracle 10g XE. For example, I have both 11.2.0.1 and 10g XE installed, but I run only the 11g listener (and disabled the 10g listener).

              That means I don't care about the tnsnames.ora and listener.ora files in my
              C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN directory
              but instead had to alter those files in my
              C:\app\<myuserid>\product\11.2.0\<dbhome>\NETWORK\ADMIN directory
              so my database listener knows about the XE instance.

              Regards,
              Gary
              SQL Developer Team

              Edited by: Gary Graham on Feb 21, 2013 3:02 PM
              Fixed bad reference to tnsnames.ora -- I meant to say listener.ora
              • 4. Re: Cannot create connection with SQL Developer using Oracle XE
                992599
                Hi,

                When I run this command, I get the following:
                C:\>lsnrctl status

                LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 21-FEB-2013 18:09:13

                Copyright (c) 1991, 2005, Oracle. All rights reserved.

                Message 1053 not found; No message file for product=NETWORK, facility=TNSTNS-12557: Message 12557 not found; No message file for product=NETWORK, facility=TNS
                TNS-12560: Message 12560 not found; No message file for product=NETWORK, facility=TNS
                TNS-00527: Message 527 not found; No message file for product=NETWORK, facility=TNS


                In the Sevices, the following services are showing as Started:
                OracleServiceXE, OracleXETNSListener

                Any idea how to fix it?
                • 5. Re: Cannot create connection with SQL Developer using Oracle XE
                  Gary Graham-Oracle
                  Well, it seems the most common approach when a message is not found is to:
                  1. Make sure you have the ORACLE_HOME environment variable set (at least on Linux. Mine, for example, is not set on Windows).
                  2. Suspect some aspect of your installation process failed.

                  For instance, in the following:
                  Message file not found: DB Down

                  And, if all else fails, it never hurts to fall back on a very popular "catch all" solution: reboot

                  -Gary