Linux to start with the system under the Oracle11g Automatic
rnInstalled Oracle 11g each time had to manually start | stop the database (dbstart | dbshut), listener (lsnrctl), the console (emtcl).
rn
Set So, if manually start the database listener does not start at the same time (that is automatically activated when you start the database listener, stop the database listener stop), you need to modify the script file dbstart
rn
[root @ oracle bin] # vi dbstart
rn
Locate This remark, in the most front-end
rn
# First argument is used to bring up Oracle Net Listener
ORACLE_HOME_LISTNER = $ 1
/ / Need to be here ORACLE_HOME_LISTNER = $ 1 was revised to ORACLE_HOME_LISTNER = $ ORACLE_HOME
if [! $ ORACLE_HOME_LISTNER]; then
echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"
echo "Usage: $ 0 ORACLE_HOME"
else
LOG = $ ORACLE_HOME_LISTNER / listener.log
rn
Similarly, need to modify the dbshut
rn
[root @ oracle bin] # vi dbshut
rn
# The this to bring down Oracle Net Listener
ORACLE_HOME_LISTNER = $ 1
/ / Need to be here ORACLE_HOME_LISTNER = $ 1 was revised to ORACLE_HOME_LISTNER = $ ORACLE_HOME
if [! $ ORACLE_HOME_LISTNER]; then
echo "ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener"
echo "Usage: $ 0 ORACLE_HOME"
else
LOG = $ ORACLE_HOME_LISTNER / listener.log
rn
After the start of the Linux system, go to / etc / init.d directory;
rn
[root @ oracle ~] # cd / etc / init.d
rn
Using the vi command, the new one in order to oracle named file (and copy the following code to the file)
rn
[root @ oracle init.d] # vi oracle
rn
#! / bin / sh
# Chkconfig: 345 61 61
# Description: Oracle 11g AutoRun Services
# / Etc / init.d / oracle
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
rn
export ORACLE_BASE = / u01/app/oracle
export ORACLE_HOME = $ ORACLE_BASE/product/11.1.0/db_1
export ORACLE_SID = ORCL
export PATH = $ PATH: $ ORACLE_HOME / bin
rn
ORA_OWNR = "oracle"
rn
# If the executables do not exist - display error
rn
if [!-f $ ORACLE_HOME / bin / dbstart-o!-d $ ORACLE_HOME]
then
echo "Oracle startup: cannot start"
exit 1
fi
rn
# Depending on parameter - startup, shutdown, restart
# Of the instance and listener or usage display
rn
case "$ 1" in
start)
# Oracle listener and instance startup
su $ ORA_OWNR-lc $ ORACLE_HOME / bin / dbstart
echo "Oracle Start Succesful! OK."
;;
stop)
# Oracle listener and instance shutdown
su $ ORA_OWNR-lc $ ORACLE_HOME / bin / dbshut
echo "Oracle Stop Succesful! OK."
;;
reload | restart)
$ 0 stop
$ 0 start
;;
*)
echo $ "Usage:` basename $ 0 `(start | stop | reload | reload)"
exit 1
esac
exit 0
rn
In the editing is complete, use the: x command to save the file.
rn
Vested with the executive authority
rn
[root @ oracle init.d] # chmod 750 / etc / init.d / oracle
rn
Link:
rn
[root @ oracle init.d] # ln-s / etc / init.d / oracle / etc/rc1.d/K61oracle
rn
[root @ oracle init.d] # ln-s / etc / init.d / oracle / etc/rc3.d/S61oracle
rn
Execute the following command:
rn
[root @ oracle init.d] # chkconfig - level 345 oracle on
rn
[root @ oracle init.d] # chkconfig - add oracle / / add to the service where
Tags: oracle 11g" database, oracle 11g, oracle 11g auto listener log, ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener oracle, oracle home, sid, oracle export, orcl, script file, oracle instance, auto start, linux, oracle cd, oracle 11g, path path, rn, linux system, startup script, listener log, export path, web interface, autorun
Permalink: http://www.kods.netwww.kods.net/linux-to-start-with-the-system-under-the-oracle11g-automatic/
















