Ask the Expert

Script to shut down database with Windows scheduler

Can you please send me a script to shut down my database using a Windows scheduler? Our database is 8.05. Thank you very much.

    Requires Free Membership to View

Create the following in Notepad and save it with a SQL extension:
Shut.sql 
==================== 
connect internal/<password> 
shutdown <normal/immediate/abort> 
exit 
Then, create the following batch file and call the previously created SQL file within it:
Shutdown.bat 
=================== 
SET ORACLE_SID=<SID> 
svrmgr30 @c:shut.sql 
NET STOP ORACLESERVICE<SID> /y
If ORA_<SID>_SHUTDOWN = TRUE and ORA_<SID>_SHUTDOWN_TIMEOUT is high enough, you can simply create this instead:
Shutdown.bat 
=================== 
NET STOP ORACLESERVICE<SID> /y

This was first published in April 2006

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: