Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2010-01-12
4
Medium Priority
?
1,068 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
  • 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

571 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