Getting Oracle to Start Automatically

I previously blogged about installing PeopleSoft HRMS 9 on a VMWare Image. One of the problems I had was getting the database to start automatically with the service when the image boots. We constantly boot and shutdown the image since we can only have one copy of it running at a time.

In my case, the problem appears to be an Oracle bug. Installing a patch fixed the problem. But, here is everything I learned on the issue.


Downloading the Patch:

  • Log into
  • Go to Patches and Updates
  • Click on Simple Search
  • Search for Patch “4547817“, Platform Microsoft Windows (32-bit)
  • Download (543M)

Installing the Patch:

  • Unzipped it
  • Stopped the Web Server, App Server, Process Scheduler, and the Database
  • Ran the setup.exe
  • See the log below, I had to run catupgrd.sql

After Upgrading the oradim log said this:
Tue Jun 12 17:16:50 2007
c:\oracle\db10g\bin\oradim.exe -startup -sid hcm90 -usrpwd * -pfile c:\oracle\db10g\database\initHCM90.ora -log oradim.log -nocheck 0
Tue Jun 12 17:17:09 2007
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option

So, I used the upgrade option as describe here.

sqlplus /nolog
connect / as sysdba
startup upgrade

Logs to Check

Specific to the Service:


Tue Jun 05 15:28:13 2007
c:\oracle\db10g\bin\oradim.exe -startup -sid hcm90 -usrpwd * -pfile c:\oracle\db10g\database\initHCM90.ora -log oradim.log -nocheck 0
Tue Jun 05 15:28:18 2007
ORA-12560: TNS:protocol adapter error


Fatal NI connect error 12560, connecting to:

TNS for 32-bit Windows: Version – Production
Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version – Production
Time: 05-JUN-2007 15:28:18
Tracing not turned on.
Tns error struct:
ns main err code: 12560
TNS-12560: TNS:protocol adapter error
ns secondary err code: 0
nt main err code: 530
TNS-00530: Protocol adapter error
nt secondary err code: 2
nt OS err code: 0

Specific to the Listener


TNSLSNR for 32-bit Windows: Version – Production on 05-JUN-2007 15:28:09

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

System parameter file is c:\oracle\db10g\network\admin\listener.ora
Log messages written to c:\oracle\db10g\network\log\listener.log
Trace information written to c:\oracle\db10g\network\trace\listener.trc
Trace level is currently 0

Started with pid=348
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=psqa895)(PORT=1521)))
Listener completed notification to CRS on start

05-JUN-2007 15:29:23 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST= * establish * orcl * 12514



The Service and the Registry

Deleting the Service:

At the command prompt> oradim -delete -sid <SID>

If either that doesn’t work or you have uninstalled, you have to open regedit and delete the following key:


Recreating Your Service:

At the command prompt>
oradim -new -sid <SID> -intpwd <password> -startmode AUTO -pfile <oracle_home>\database\init<SID>.ora

Other Registry Settings:

HKLM\Software\Oracle\Key_<Oracle Home Name>\ORA<SID>_AUTOSTART
Start the database when the service starts

HKLM\Software\Oracle\Key_<Oracle Home Name>\ORA<SID>_PFILE
Location of the Configuration File

HKLM\Software\Oracle\Key_<Oracle Home Name>\ORA<SID>_SHUTDOWN
Shutdown the database when the service stops

HKLM\Software\Oracle\Key_<Oracle Home Name>\ORA<SID>_SHUTDOWNTYPE
type of shutdown to do when stopping the server

Helpful Links

Windows Service Not Starting Your Database?

ORA-12560 on NT

Thread: ORACLE not available problem 10g release 2

Thread: DB not open, with Windows Service

3 Responses to “Getting Oracle to Start Automatically”

  1. Bens Says:

    where can i find the package oradim

  2. digitaleagle Says:


    oradim is part of the Oracle database installation. So, you can find it in \bin\oradim.exe. For example: c:\oracle\ora92\bin\oradim.exe.

  3. Nis Says:

    Good Document.. Did work for me

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: