shutdwon script before run coldback up script in linux [message #218075] |
Tue, 06 February 2007 13:20 |
pavan27
Messages: 50 Registered: December 2006 Location: bangalore
|
Member |
|
|
Hi to every one,
i an new to Oracle DBA. and i am doing R&D on backup's and shell script.
i have a cold backup script. before run the cold backup script o want to shutdown the database. i want shutdown and startup scripts. because i want to do it automated... i am using linux AS4..
can any one send me the scripts. i find some scripts but i am unable to understand.
thanks,
|
|
|
|
Re: shutdwon script before run coldback up script in linux [message #218079 is a reply to message #218076] |
Tue, 06 February 2007 14:15 |
pavan27
Messages: 50 Registered: December 2006 Location: bangalore
|
Member |
|
|
Hi i got this script in the net.
#!/sbin/sh
# Start/stop Oracle database(s) found in /var/opt/oracle/oratab
# NOTE that tns listener must start AFTER this script (S98tns start)
# and stop BEFORE (K20tns stop) this script.
case "$1" in
'start')
su oracle -c "/oracle/app/oracle/product/8.1.6/bin/dbstart"
;;
'stop')
su oracle -c "/oracle/app/oracle/product/8.1.6/bin/dbshut"
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
can any one explain me above block
i wrote one script file like this
vi shutdown.sql
set echo off
set feed off
spool shutdown.sh
select 'sqlplus "/ as sysdba"' from dual;
select 'shut immediate' from dual;
spool off;
then i got shutdown.sh file
at $sh shutdown.sh
when i tried to execute this one two things are happening
1) i am connectiong to as sysdba
2) database is not shutting down.
why? can any one explain this concept.
[Updated on: Tue, 06 February 2007 14:22] Report message to a moderator
|
|
|
|
Re: shutdwon script before run coldback up script in linux [message #218122 is a reply to message #218088] |
Tue, 06 February 2007 22:34 |
pavan27
Messages: 50 Registered: December 2006 Location: bangalore
|
Member |
|
|
Hi Rajendran,
thanks for your suggestion. but i did not understand the concept. can you pleae send me sample script on linux so i can understand.
in this oracle@mutation#somescript
what is oracle---- is it user name
mutation ---------database name
somescript---------my script
where i have to run this statement oracle@mutation#somescript.
plese could you please send me sample script
thanks
|
|
|
|