RE: Auto shutdown of Oracle for Windows reboot

  • From: Yong Huang <yong321@xxxxxxxxx>
  • To: "Allen, Brandon" <Brandon.Allen@xxxxxxxxxxx>
  • Date: Fri, 16 May 2008 07:48:51 -0700 (PDT)

Brandon,

I notice you always use / instead of - for the shutdown command option. I
remember the old version of the command from Resource Kit only supports /. Can
you make sure to use %windiw%\system32\shutdown.exe which comes with Windows?
What version of Windows is it?

Another idea is to bump up WaitToKillServiceTimeout (possibly
WaitToKillAppTimeout too). Somebody says on Vista you need to reboot for it to
take effect but no need to reboot on XP. Not sure about Windows 2003.

http://www.reactos.org/wiki/index.php/ShutdownProcess has a section "Service
Shutdown" probably copied from "Inside Microsoft Windows 2000". It talks about
the service shutdown sequence. Now the question is whether shutdown.exe is
written to follow the same sequence as GUI shutdown. One way is to ask
Microsoft (open a ticket). The other is ask ReactOS team. Their OS is very
close to the real Microsoft OS. Their source code is open, such as
http://www.reactos.org/generated/doxygen/da/dbf/dll_2win32_2advapi32_2misc_2shutdown_8c-source.html
But I don't know if that's for GUI or shutdown.exe.

Since we know for sure the "time /t... sleep" script is successfully run, maybe
we can use that to give "net stop..." more time (Windows cares about "sleep"
command but not "net stop" command?). To run them in parallel, use these lines
in your shutdown script:
start /b sleep 300
psexec -s net stop OracleServiceSID

Actually start is probably a shell (DOS) built-in, so maybe you need "cmd /c
start /b sleep 300" instead.

Sorry I can't help more.

Yong Huang

--- "Allen, Brandon" <Brandon.Allen@xxxxxxxxxxx> wrote:

> Well, at least I'm not the only one with this problem - I googled the SC
> error message I'm getting and got just this one hit:
> 
> http://x220.minasi.com/forum/topic.asp?TOPIC_ID=20715
> 
> Unfortunately, no solution is given.
> 
> 
> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx
> [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Allen, Brandon
> Sent: Thursday, May 15, 2008 1:54 PM
> To: Yong Huang; oracle-l@xxxxxxxxxxxxx
> Subject: RE: Auto shutdown of Oracle for Windows reboot
> 
> 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
> 
> 
> 



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


Other related posts: