RE: Auto shutdown of Oracle for Windows reboot

From: Yong Huang <yong321_at_yahoo.com>
Date: Thu, 15 May 2008 09:56:17 -0700 (PDT)
Message-ID: <641697.42758.qm@web80608.mail.mud.yahoo.com>


Brandon,

I think you can solve your problem by adding

psexec -s -d net stop OracleServiceSID

to your group policy shutdown script. psexec.exe can be downloaded from sysinternals.com (now part of Microsoft). Running it with -s allows you to run as the pseudo system account instead of the real user, oracle in your case. (I often launch psexec -s -i -d taskmgr to lower priority of virus scan processes. That won't violate our institution policy!)

Let me know if it works for you. I can't find a Windows box running Oracle server and I can reboot at will.

Yong Huang

  • "Allen, Brandon" <Brandon.Allen_at_OneNeck.com> wrote:

> No problem, I still appreciate your help. No, I don't have access to
> the console, so I can't see that message if it's there, but I did do a
> similar test already by adding the "time /t" commands with output
> redirected to a log file and thus verified that my script is indeed
> being executed, however the "net stop" commands in the same script seem
> to have no effect when shutdown is via shutdown.exe. I suspect it's
> some sort of Windows authentication/privilege issue because if I run the
> shutdown from the GUI, it shows the shutdown being done by NT
> AUTHORITY\SYSTEM in the Event Viewer and the net stop commands work as
> expected, but if I shutdown via shutdown.exe, it shows the shutdown
> actually being run by my oracle user account - details are in the
> attached spreadsheet, but not sure if it will make it to the list so
> below is a text version although it will probably be a bit difficult to
> read.
>
> Date Time Source Type Category Event User Computer
> Description
> Shutdown from Windows GUI (Start > Shutdown)
>
> 5/12/2008 12:37:24 PM USER32 Information None 1074
> NEWIM-DBS01\oracle NEWIM-DBS01 The process Explorer.EXE has
> initiated the restart of computer NEWIM-DBS01 on behalf of user
> NEWIM-DBS01\oracle for the following reason: Other (Planned)
> Reason Code: 0x85000000
>
> Shutdown Type: restart
>
> Comment: Brandon - testing again"
>
> 5/12/2008 12:37:27 PM USER32 Information None 1074
> NT AUTHORITY\SYSTEM NEWIM-DBS01 The process svchost.exe has
> initiated the restart of computer NEWIM-DBS01 on behalf of user NT
> AUTHORITY\SYSTEM for the following reason: No title for this reason
> could be found
> Reason Code: 0x80070020
>
> Shutdown Type: restart
>
> Comment: "
> 5/12/2008 12:37:27 PM Service Control Manager Information
> None 7035 NT AUTHORITY\SYSTEM NEWIM-DBS01 The
> OracleDBConsolecsdprd service was successfully sent a stop control.
> 5/12/2008 12:38:03 PM Service Control Manager Information
> None 7036 N/A NEWIM-DBS01 The OracleDBConsolecsdprd
> service entered the stopped state.
> 5/12/2008 12:38:04 PM Service Control Manager Information
> None 7035 NT AUTHORITY\SYSTEM NEWIM-DBS01 The
> OracleServiceCSDPRD service was successfully sent a stop control.
> 5/12/2008 12:38:13 PM Service Control Manager Information
> None 7036 N/A NEWIM-DBS01 The OracleServiceCSDPRD service
> entered the stopped state.
> 5/12/2008 12:38:15 PM Service Control Manager Information
> None 7036 N/A NEWIM-DBS01 The
> OracleOraDb10g_home1TNSListener service entered the stopped state.
> 5/12/2008 12:38:15 PM Service Control Manager Information
> None 7035 NT AUTHORITY\SYSTEM NEWIM-DBS01 The
> OracleOraDb10g_home1TNSListener service was successfully sent a stop
> control.
> 5/12/2008 12:38:20 PM EventLog Information None
> 6006 N/A NEWIM-DBS01 The Event log service was stopped.
>
>
> Shutdown from command line: shutdown /r /t 30 /c "Brandon - Testing
> Oracle shutdown 2" /d p:4:1
>
> 5/12/2008 5:01:27 PM Application Popup Information
> None 26 N/A NEWIM-DBS01 Application popup: System
> Shutdown : The system is shutting down. Please save all work in
> progress and log off. Any unsaved changes will be lost. This shutdown
> was initiated by NEWIM-DBS01\oracle. Shutdown will begin in 30 seconds.
> Shutdown message: Brandon - Testing Oracle shutdown 2.
> 5/12/2008 5:01:27 PM USER32 Information None 1074
> NEWIM-DBS01\oracle NEWIM-DBS01 The process winlogon.exe has
> initiated the restart of computer NEWIM-DBS01 on behalf of user
> NEWIM-DBS01\oracle for the following reason: Application: Maintenance
> (Planned)
> Reason Code: 0x84040001
>
> Shutdown Type: restart
>
> Comment: Brandon - Testing Oracle shutdown 2"
>
> 5/12/2008 5:01:57 PM Service Control Manager Information
> None 7036 N/A NEWIM-DBS01 The DSM SA Event Manager service
> entered the stopped state.
> 5/12/2008 5:01:58 PM EventLog Information None
> 6006 N/A NEWIM-DBS01 The Event log service was stopped.
>
> -----Original Message-----
> From: Yong Huang [mailto:yong321_at_yahoo.com]
>
> When you run shutdown.exe, do you see "Running shutdown script" on
> console?
      

--
http://www.freelists.org/webpage/oracle-l
Received on Thu May 15 2008 - 11:56:17 CDT

Original text of this message