Thursday, June 12, 2014

Oracle on Windows, troubleshooting suggestions

1.  Check the status of the Oracle services.  Are they started?

2.  From a command prompt, sqlplus / as sysdba, then enter startup.  Are there error messages?

3.  In the last instance I had to troubleshoot, the client had entered non-functional values into the Oracle config.  This meant the spfile was toast.  To recover from this:

  • sqlplus / as sysdba
  • create pfile='c:\temp\initorcl.ora' from spfile;
  • exit
  • Use notepad or your preferred text editor and clean up the bad values in the pfile you just created.  Save the file.
  • sqlplus / as sysdba
  • startup pfile='c:\temp\initorcl.ora'
  • create spfile from pfile='c:\temp\initorcl.ora';
  • shutdown immediate
  • startup
4.  To restart your database without rebooting the server, you have several options.
  • Restart the Oracle service.  You only need to restart the one for the instance.  Assuming your SID is named orcl, you just need to restart the OracleServiceORCL.
  • My preferred way is to do this from the command prompt.  It's a lot easier to catch any problems this way.
    • sqlplus / as sysdba
    • shutdown immediate;
    • startup;
5.  I also had a client with listener issues.  Again, the command prompt is your friend.
  • lsnrctl status - shows the status of the listener.
  • lsnrctl services - shows what services the listener knows about.
  • lsnrctl stop - yep, stops it.
  • lsnrctl start - you guessed it, starts it.