Re: shutdown on AIX
From: Gary Kirsh <gkirsh_at_news.dorsai.org>
Date: 1995/05/03
Message-ID: <D80Es6.KM3_at_dorsai.org>#1/1
ORACLE_SID=$1; export ORACLE_SID
sqldba <<EOF
connect internal
shutdown immediate
exit
EOF to call the script from cron:
Date: 1995/05/03
Message-ID: <D80Es6.KM3_at_dorsai.org>#1/1
Mark Loth - DBA (lothmar_at_cscoe.ac.com) wrote:
: Hi,
: I'm currently automating the Oracle backup process on AIX thru cron. Unfortunately,
: I have not been able to write a script which successfully shuts down the database. There are multiple databases on this machine, and I have not been able to startup SQL*DBA with the proper SID thru cron.
: Any help would be greatly appreciated,
: Mark
: lothmar_at_cscoe.ac.com
Mark,
You can write a shell script to shut the db as follows:
# shutdb # takes 1 parameter: the ORACLE SID of the db to shut #
ORACLE_SID=$1; export ORACLE_SID
sqldba <<EOF
connect internal
shutdown immediate
exit
EOF to call the script from cron:
su - oracle -c "<path>/shutdb <SID>"
substituting the full path of the shutdb file for <path> and the ORACLE_SID for <SID>
You can write a statup script the same way. Hope this helps, Gary
-- Gary Kirsh Next Extent, Inc. Phone: (718) 380-8546 Internet: gkirsh_at_dorsai.orgReceived on Wed May 03 1995 - 00:00:00 CEST