?
Solved

How to Automate Database startup script in Linux,Hp-ux & Aix ?

Posted on 2010-01-12
4
Medium Priority
?
1,041 Views
Last Modified: 2013-12-06

  Hello Experts

   Could you suggest How we can Automate Database(oracle10g) startup script in Linux,Hp-ux & Aix as well in Windows? As we have to execute the script in order to start the DB But we want the DB to be started when we start the OS

Thanks
0
Comment
Question by:junaid_baig1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 26296555
Just check if /var/opt/oracle/oratab has Y at end of statement.
0
 

Author Comment

by:junaid_baig1
ID: 26296661
@virdi_ds
 
I 've already made the change at the end of /var/opt/oracle/oratab file <SID>:<ORACLE_HOME>:Y !  Please suggest how to make the  link the with the startup script  in rc.d files of linux & Hp-ux !  Plz give the complete steps
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 26296975
There is another link in Experts-Exchange, please have a look on the following link.
http://www.experts-exchange.com/Database/Oracle/Product_Info/Q_22039186.html
0
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 2000 total points
ID: 26297150
It is the init script that calls dbstart, and dbstart refers to /etc/oratab.

This is a previous solution from my EE knowledgebase.

http://www.experts-exchange.com/Q_24445764.html


1) dbora file must go in /etc/init.d
   make sure it has execute perm (chmod +x dbora)

2) It will call $ORA_HOME/bin/dbstart

3) Add a symbolic link from /etc/rc.d/rc5.d/
   cd /etc/rc.d/rc5.d/
   ln -s ../init.d/dbora S98dbora

4) Also, some versions of Oracle have an error in $ORACLE_HOME/bin/dbstart
   Edit it and change the line:

   ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
   
   to
 
   ORACLE_HOME_LISTNER=$ORACLE_HOME

5) Manually test the startup by running
  /etc/init.d/dbora start
  /etc/init.d/dbora stop

6) Make sure /etc/oratab lists the instance as an auto-start instance (Y)

# processname: oracle
# config: /etc/oratab
# pidfile: /var/run/oracle.pid
 
# Source function library.
. /etc/init.d/functions
 
RETVAL=0
ORA_OWNER="oracle"
ORA_HOME="/oracle/11.1.0"
 
# See how we were called.
 
prog="oracle"
 
start() {
echo -n $"Starting $prog: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" 
# su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dbora
 
return $RETVAL
}
 
stop() {
echo -n $"Stopping $prog: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME" 
# su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
} 
 
restart() {
stop
start
} 
 
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
 
exit $?
 
Open in New WindowSelect All

Open in new window

0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses
Course of the Month8 days, 23 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question