Startup/shutdown automatique d'une DB Oracle 10g sous linux AS5
Bonjour à tous,
j'ai une base de données 10g sous Linux RedHat AS5, je veux automatiser le startup et shutdown de la base de données, j'ai créer le fichier /etc/init.d/dbora et suite j'ai créer le lien dans /etc/rc1.d/,......
au démarrage du système je recoi le warning suivant :
ORACLE_HOME_LISTNER is not set, uniable to auto-start Oracle Net Listner
mais la base de données et TNS Listner son up. est-ce que Oracle Net Listner est un service dans Oracle 10g?
Merci d'avance
how to make startup/shutdown : kamel oulide lakhdaria
salam a tous : voici les étapes nécessaire pour automatisé votre base de données :
1: Log in as the root user.
2: Edit the oratab file for your platform.
To open the file, use one of the following commands:
o On Solaris:
o # vi /var/opt/oracle/oratab
o
o On AIX, HP-UX, Linux, and Tru64 UNIX:
o # vi /etc/oratab
o
exemple:
Vi /etc/oratab
kamel:/u01/app/oracle/product/10.2.0/db_1:Y
3: cd etc/init.d
4: Maintenant créez le fichier dbora
vi /etc/init.d/dbora
dont le contenu est la suivant:
#!/bin/bash
ORA_HOME="/u01/app/oracle/product/10.1.0/db_3"
ORA_OWNR="oracle"
if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNR -c $ORA_HOME/bin/dbstart
#Optional : for isqlplus only
su - $ORA_OWNR -c "$ORA_HOME/bin/isqlplusctl start"
#Optional : for Enterprise Manager software only
su - $ORA_OWNR -c "$ORA_HOME/bin/emctl start dbconsole"
# touch /var/lock/subsys/oracle
Touch /var/lock/subsys/dbora
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
#Optional : for isqlplus only
su - $ORA_OWNR -c "$ORA_HOME/bin/isqlplusctl stop"
#Optional : for Enterprise Manager software only
su - $ORA_OWNR -c "$ORA_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNR -c $ORA_HOME/bin/dbshut
rm -f /var/lock/subsys/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0
5:Rendez ensuite le script exécutable grâce à la commande:
chmod u+x /etc/init.d/oracle
6: vi $ORACLE_HOME/bin/dbstart
remplacer cette ligne :
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
With this:
ORACLE_HOME_LISTNER=$ORACLE_HOME
exemple
su – oracle
Cd $ORACLE_HOME
Cd bin
Vi dbstart
Modifier la ligne suivante :
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
Par :
ORACLE_HOME_LISTNER=$ORACLE_HOME
7:Create symbolic links to the dbora script in the appropriate run-level script directories as follows.
Platform Symbolic Links Commands
AIX # ln -s /etc/dbora /etc/rc.d/rc2.d/S99dbora
# ln -s /etc/dbora /etc/rc.d/rc2.d/K01dbora
HP-UX # ln -s /sbin/init.d/dbora /sbin/rc3.d/S990dbora
# ln -s /sbin/init.d/dbora /sbin/rc3.d/K001dbora
Linux # ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/K01dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/K01dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
Solaris # ln -s /etc/init.d/dbora /etc/rc3.d/K01dbora
# ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
Tru64 UNIX # ln -s /sbin/init.d/dbora /sbin/rc3.d/S99dbora
# ln -s /sbin/init.d/dbora /sbin/rc3.d/K01dbora
8: netolobe menkome edouaa esalah
9: salam alikoume
10=kamel iben lakhdaria