Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shutdown/Startup from Windows Batch?

Status
Not open for further replies.

thermidor

Programmer
Nov 28, 2001
123
US
Hi All,

Can Oracle 9i be shutdown and started from a Windows batch script? If so, can anyone provide any examples? I have been unable to log on as sys as sysdba from a script or command prompt.

TIA,
Sven
 
Yes:
Batch script:
Code:
sqlplus /nolog @C:\Myscripts\shutdown.sql
shutdown.sql script:
Code:
conn <uid>/<pw>@MyDB as sysdba
shutdown immediate
exit
and same for startup.


----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Thanks for the info.
Can you give an example of the conn?

Thanks,
Sven
 
Or rather do I need statements before the call to sqlplus?
 
Maybe:
Code:
SET ORACLE_HOME=C:\Ora9i
SET ORACLE_SID=MyDB
sqlplus /nolog @C:\Myscripts\shutdown.sql >C:\Temp\MyDB_Startup.log


----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top