If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > auto start oracle listener in AIX at system startup

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-27-07, 12:27
joy32327 joy32327 is offline
Registered User
 
Join Date: Mar 2007
Location: Tallahassee, FL
Posts: 10
auto start oracle listener in AIX at system startup

My initial goal was to auto start/stop the oracle database and listener on AIX. Oracle suggested the following for starting and stopping the database (not the listener):

1. Create a file called dbora in the /etc directory.
2. chgrp dba /etc/dbora (change the group for the file permissions)
3. chmod 750 /etc/dbora (change the permissions of the file.)
4. add the following lines in the dbora file:

#! /bin/sh -x
#
# Change the value of ORACLE_HOME to specify the correct Oracle home
# directory for your installation.

ORACLE_HOME=/u01/app/oracle/product/ora10g
#
# Change the value of ORACLE to the login name of the
# oracle owner at your site.
#
ORACLE=oracle

PATH=${PATH}:$ORACLE_HOME/bin
HOST=`hostname`
PLATFORM=`uname`
export ORACLE_HOME PATH
#
if [ ! "$2" = "ORA_DB" ] ; then
if [ "$PLATFORM" = "HP-UX" ] ; then
remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB"
exit
else
rsh $HOST -l $ORACLE $0 $1 ORA_DB
exit
fi
fi
#
case $1 in
'start')
$ORACLE_HOME/bin/dbstart $ORACLE_HOME &
;;
'stop')
$ORACLE_HOME/bin/dbshut $ORACLE_HOME &
;;
*)
echo "usage: $0 {start|stop}"
exit
;;
esac
#
exit

5. Now that we have the dbora file with the correct oracle user and oracle home, we simply create the soft links as follows:

# ln -s /etc/dbora /etc/rc.d/rc2.d/S99dbora
# ln -s /etc/dbora /etc/rc.d/rc2.d/K01dbora

6. You then have to edit the /etc/hosts.equiv file with the following entry:

host root (where the host is the name of the server)

My database now will auto start and stop when the AIX system is rebooted.

I tried doing the same thing for the listener with the following changes:

I created a dblsn file with the following changes in the script:

case $1 in
'start')
$ORACLE_HOME/bin/lsnstart $ORACLE_HOME &
;;
'stop')
$ORACLE_HOME/bin/lsnstop $ORACLE_HOME &
;;
*)
echo "usage: $0 {start|stop}"
exit
;;
esac
#
exit

The lsnstart script works when I run it from the user Oracle or root. It is as follows:

#
# Startup the oracle listener
#
export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/ora10g
export ORACLE_SID=orasql
export AGENT_HOME=/u01/app/oracle/product/agent10g

/bin/su oracle -c /u01/app/oracle/product/ora10g/bin/lsnrctl start

For the /etc/dblsn file, I implemented the following soft links:

# ln -s /etc/dbora /etc/rc.d/rc2.d/S97dbora
# ln -s /etc/dbora /etc/rc.d/rc2.d/K03dbora

If it worked for the database, I thought it should work for the listener. When it didn't, I tried a different method for auto starting the listener:

1. I copied the lsnstart script above to the /etc directory and renamed it to rc.lsnstart
2. I then added the script to the inittab by using the following:

#/usr/sbin/mkitab "rclsnstart:2:wait:/etc/rc.lsnstart > /dev/console 2>&1"

If I do a telinit q, it should reread the inittab file and start the listener. It doesn't work.

So, I've tried two methods to automajically starting the oracle listener in an AIX environment with no luck. Any suggestions would be appreciated.

Last edited by joy32327; 03-27-07 at 13:54.
Reply With Quote
  #2 (permalink)  
Old 01-19-11, 20:45
autorosston autorosston is offline
Registered User
 
Join Date: Jan 2011
Posts: 1
штатная навиг

Сделать тюнинг для своего автомобиля Audi для повышения превлекательности внешнего вида можно осуществив установку или сделав: audi a3 тюнинг колесные диски ауди а6 колодки на ауди оригинальные литые диски ауди доп оборудование audi светодиоды в audi колодки на audi рестайлинг ауди а4 рестайлинг ауди q7 навигация для audi a4 колесные диски ауди оригинальные аксессуары audi блютуз на audi рестайлинг ауди q5 webasto в audi audi q5 навигация рестайлинг audi q7 тюнинг audi q5 диски audi q7 литые диски ауди оптика ауди дополнительное оборудование audi опции ауди дополнительные опции audi . Обратитесь в нашу фирму Upgrade-Car, и мы сделаем тюнинг audi и тонирование ауди любой модели. Позвоните по тел. (495) 760-07-46 (без выходных) или просмотрите на сайте upgrade-car**** Вы найдете то, чего может не доставать Вашему автомобилю, для выражения вашей индивидуальности. Всегда в наличии есть к примеру рестайлинг Audi q5
Reply With Quote
  #3 (permalink)  
Old 01-24-11, 13:37
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Talking Easy does it...

Quote:
Originally Posted by joy32327 View Post
My initial goal was to auto start/stop the oracle database and listener on AIX. Oracle suggested the following for starting and stopping the database (not the listener):
... Etc ...
If you are using Oracle version 10+ or 11+, the dbstart/dbshut scripts will start/stop the listener for you.
Therefore all you need to do is use this script:
Code:
#!/bin/sh -x
# dbora.sh - Start/Stop Oracle
#
# Copy this script to /etc/init.d
# Create the following symbolic links:
#     /etc/rc0.d/K10dbora -> /etc/init.d/dbora.sh
#     /etc/rc3.d/S80dbora -> /etc/init.d/dbora.sh
#
# Following is the Oracle Home for the listener:
#
ORACLE_HOME=/opt/app/oracle/product/11.2.0; export ORACLE_HOME

if [ "$1" = "start" ] ; then
    su - oracle -c "$ORACLE_HOME/bin/dbstart" >> /opt/app/oracle/logs/startup.log 2>&1
    exit
fi
if [ "$1" = "stop" ] ; then
    su - oracle -c "$ORACLE_HOME/bin/lsnrctl stop" >> /opt/app/oracle/logs/shutdown.log 2>&1
    exit
fi
echo "Usage: $0 [start|stop]"
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On