In windows, you can set ORACLE service to automatic in Computer Service Management. After Oracle is installed in Linux, If you restart Linux, Oracle will not
In windows, you can set ORACLE service to automatic in Computer Service Management. After Oracle is installed in Linux, If you restart Linux, Oracle will not
In windows, you can set Oracle service to automatic in Computer Service Management. After Oracle is installed in Linux, Oracle will not start automatically if Linux is restarted, you can manually call the dbstart command to start the instance, but it seems complicated. We can configure the Oracle Automatic startup script and then use the Linux Service to start the Oracle server.
First, configure the Oracle service file in the/etc/rc. d/init. d/directory.
Touch oracle10g
Chmod a + x oracle10g
Edit the oracle10g file. The content is as follows.
#! /Bin/bash
# Whoami
# Root
# Chkconfig: 345 51 49
# Description: starts the oracle dabase deamons
#
ORA_HOME =/opt/oracle
ORA_OWNER = oracle
Case "{GetProperty (Content)}" in
'Start ')
Echo-n "Starting oracle10g :"
Su-$ ORA_OWNER-c "$ ORA_HOME/bin/dbstart "&
Su-$ ORA_OWNER-c "$ ORA_HOME/bin/lsnrctl start"
Touch/var/lock/subsys/oracle10g
Echo
;;
'Stop ')
Echo-n "shutting down oracle10g :"
Su-$ ORA_OWNER-c "$ ORA_HOME/bin/dbshut "&
Su-$ ORA_OWNER-c "$ ORA_HOME/bin/lsnrctl stop"
Rm-f/var/lock/subsys/oracle10g
Echo
;;
'Restart ')
Echo-n "restarting oracle10g :"
{GetProperty (Content)} stop
{GetProperty (Content)} start
Echo
;;
*)
Echo "usage: oracle10g {start | stop | restart }"
Exit 1
Esac
Exit 0
Save the file. After exiting, add and start the service.
/Sbin/chkconfig -- add oracle10g
/Sbin/chkconfig -- list oracle10g
When you restart Linux, if the Oracle startup item appears OK, it means that Oracle is successfully started with Linux.
,