RE: Auto shutdown of Oracle for Windows reboot

  • From: "Allen, Brandon" <Brandon.Allen@xxxxxxxxxxx>
  • To: "Yong Huang" <yong321@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 15 May 2008 13:54:25 -0700

Thanks Yong, that was a great idea and I was really hoping it was going
to work, but still no luck.  I tried all the following:

psexec -s -d net stop
psexec -s net stop
psexec -s sc stop
psexec -s shutdown /r

Unfortunately none of them successfully shutdown the Oracle services
when running shutdown.exe even though they did run the commands as NT
AUTHORITY\SYSTEM according to the Windows Event Viewer.

When I ran "psexec -s shutdown /r" combined with the "sc stop" command
in my script, I did get a little more output in the log file at least as
you can see here:

Starting 
Thu 05/15/2008 
12:58 PM
[SC] OpenSCManager FAILED 1115:

A system shutdown is in progress.

[SC] OpenSCManager FAILED 1115:

A system shutdown is in progress.

[SC] OpenSCManager FAILED 1115:

A system shutdown is in progress.

Finished 
Thu 05/15/2008 
12:58 PM

So, it seems to indicate that even though my shutdown script is being
executed, it's being executed *after* the shutdown has begun so its
commands are prevented from running, compared to this output when I run
the shutdown from the GUI and the "sc stop" commands successfully shut
down the Oracle services gracefully as they're supposed to:

Starting 
Thu 05/15/2008 
01:38 PM

SERVICE_NAME: OracleDBConsolecsdprd 
        TYPE               : 10  WIN32_OWN_PROCESS  
        STATE              : 3  STOP_PENDING 
                                (NOT_STOPPABLE, NOT_PAUSABLE,
IGNORES_SHUTDOWN))
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x7530

SERVICE_NAME: OracleServiceCSDPRD 
        TYPE               : 10  WIN32_OWN_PROCESS  
        STATE              : 3  STOP_PENDING 
                                (STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x1
        WAIT_HINT          : 0x493e0

SERVICE_NAME: OracleOraDb10g_home1TNSListener 
        TYPE               : 10  WIN32_OWN_PROCESS  
        STATE              : 3  STOP_PENDING 
                                (STOPPABLE, NOT_PAUSABLE,
IGNORES_SHUTDOWN))
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x1
        WAIT_HINT          : 0xfa0
Finished 
Thu 05/15/2008 
01:38 PM

It looks like a Windows bug to me.  Someone else told me the net stop
commands work for them via shutdown.exe, but they are running 32-bit
Windows so maybe it's just a 64-bit bug since that's what I'm running
here.

Thanks,
Brandon

-----Original Message-----
From: Yong Huang [mailto:yong321@xxxxxxxxx] 

I think you can solve your problem by adding

psexec -s -d net stop OracleServiceSID

Privileged/Confidential Information may be contained in this message or 
attachments hereto. Please advise immediately if you or your employer do not 
consent to Internet email for messages of this kind. Opinions, conclusions and 
other information in this message that do not relate to the official business 
of this company shall be understood as neither given nor endorsed by it.

--
//www.freelists.org/webpage/oracle-l


Other related posts: