18 Temmuz 2011 Pazartesi

Oracle – Servis olarak çalıştırmak

Oracle – Servis olarak çalıştırmak


vi /etc/init.d/oracle

Yukarıdaki komutla dosyanızı oluşturarak, içine aşağıdaki verileri yapıştın.
Renkli satırları kendi sisteminize göre düzenlemeyi unutmayın.. !!!

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORA_OWNER=oracle
ORACLE_SID=orcl
export $ORACLE_SID

if [ ! -f $ORA_HOME/bin/dbstart ]

then
echo "Oracle startup: cannot start"
exit
fi

case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
echo "OK"
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
;;
esac

Servisin çalıştırılabilmesi için yetkilendirme yapıyoruz,
chmod 750 /etc/init.d/oracle

ve son olarak açılışta başlaması için,  aşağıdaki satırı çalıştırıp servisimizi tamamlıyoruz.

/sbin/chkconfig --level 345 oracle on





http://www.zekiguven.com/?cat=16 sayfasından destek alınarak hazırlanmıştır.

Hiç yorum yok:

Yorum Gönder