Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Location
    Cape Town, South Africa
    Posts
    253

    Unanswered: How to: Connect to idle instance [Ora10gR1, Windows2k]

    Hi all,

    I am really battling with this. I have a database that is not starting and need to start it up manually. I am trying to connect to the now idle instance, but I get TNS listener errors every time.

    I have tried:
    1) sqlplus sys/password@sid as sysdba
    which gives
    ORA-12514: TNS: listener does not currently know of service requested in connect descriptor
    2) set ORACLE_SID=SID
    sqlplus sys/password as sysdba
    which gives
    ORA-12560: TNSrotocol adapter error
    3) set ORACLE_SID=SID
    sqlplus / as sysdba
    which gives
    ORA-12560: TNSrotocol adapter error
    That one works on my Linux server by the way....
    4) sqlplus "/ as sysdba"
    which gives
    ORA-12560: TNSrotocol adapter error

    Obviously the listener is not going to know about the service since it isn't running. So how do you bypass the listener (or pre-register the SID with the listener before the SID is started)?

    Thanks,
    DayneO
    Last edited by dayneo; 11-04-08 at 04:27.

  2. #2
    Join Date
    Oct 2002
    Location
    Cape Town, South Africa
    Posts
    253

    Wink Solved

    Ok, solved my own problem.

    It seems that on Windows, you HAVE TO HAVE the Oracle Service started in order to access anything. However, when the Oracle Service starts up, it also attempts to start the database by default. In my case, this resulted in an error for reasons I won't get into. So I needed to start my database manually.

    Assuming that you don't have the Oracle service running (Note: SID should be replaced with the name of your SID):
    1) Find and change the registry entry ORA_SID_AUTOSTART = FALSE
    This will prevent the Service from starting the database
    2) Start the Oracle Service (usually named OracleServiceSID)
    You can use the Computer Management console or use the "net start" command line to do this
    The Oracle Service will now be running and registered with the TNS Listener, but your database will not be started.
    3) from the command line, do:
    set oracle_sid=SID
    sqlplus sys as sysdba
    Enter the password when prompted.
    4) Then use startup command to start the database.
    In actual fact, you will probably not use the simple startup command because if you are starting your database via this method, it is probably because something is wrong...

    I find that:
    alter database backup controlfile to trace

    is a handy line to know. This will get the startup commands required to start your database (effectively what is run when issueing startup). You can then edit the file to your needs and execute from sqlplus to bring your database online.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •