You could try something like this to monitor the instance..
rem -- Set Database SID ---
set ORACLE_SID=<SID>
rem -- Create SQL Script ---
echo connect sys/orcl as sysdba; > %0.tmp
echo set echo off feed off pages 0 >> %0.tmp
echo whenever sqlerror exit sql.sqlcode >> %0.tmp
echo select * from global_name; >> %0.tmp
echo exit; >> %0.tmp
rem -- Test connect to database ---
sqlplus -s /nolog @%0.tmp >NUL:
if {%ERRORLEVEL%} == {0} (
echo Database %ORACLE_SID% is available
) else (
echo Database %ORACLE_SID% is NOT available
echo connect sys/<PWD> as sysdba; >> %0.tmp
echo startup force; >> %0.tmp
)
rem -- Cleanup --
del %0.tmp
Ryan
|---------+--------------------------------------------------------->
| | "Tom Lombardi " |
| | <oracledba-ezmlmshield-x21355565.[Email Address Removed] | azyDBA.com> |
| | |
| | |
| | |
| | 08/07/2005 03:07 AM |
| | |
|---------+--------------------------------------------------------->
>-------------------------------------------------------------------------------------------------------------------------------|
| |
| To: "LazyDBA Discussion" <[Email address protected] |
| cc: |
| Subject: looking for script to monitor instance |
>-------------------------------------------------------------------------------------------------------------------------------|
Hello,
Does anyone have a script that can check the status of an instance (idle,
mounted)
and issue a startup command if the instance is idle?
Thanks,
Tom Lombardi
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these terms:
http://www.lazydba.com/legal.html
_______________________________________________________________________________
Unencrypted electronic mail is not secure and may not be authentic.
If you have any doubts as to the contents please telephone to confirm.
This electronic transmission including any attachments is intended only
for those to whom it is addressed. It may contain copyright material or
information that is confidential, privileged or exempt from disclosure by law.
Any claim to privilege is not waived or lost by reason of mistaken transmission
of this information. If you are not the intended recipient you must not
distribute or copy this transmission and should please notify the sender.
Your costs for doing this will be reimbursed by the sender.
We do not accept liability in connection with computer virus, data corruption,
delay, interruption, unauthorised access or unauthorised amendment.
_______________________________________________________________________________
Oracle LazyDBA home page