To achieve the following goals:
A. Enable auto-start of Oracle instances
B. Shut down the Oracle database before shutting down the operating system or restarting the operating system.
A. Follow these steps to start an oracle instance:
1. modify the content of the Oracle system configuration file/etc/oratab and change the N of the last character in the last line to Y.
Root User Logon Modification
# Vi/etc/oratab
As follows:
Wwl:/oracle/orahome/10.2.0/db_1: N
Change to the following and save and exit.
Wwl:/oracle/orahome/10.2.0/db_1: Y
2. Modify the/etc/rc. d/rc. local file in RedHat and add the following content:
Modify/etc/init. d/after. local in SUSE and add the following content:
# Vi/etc/rc. d/rc. local
Su-c "dbstart"-oracle
3. Switch to oracle user login and modify $ ORACLE_HOME/bin/dbstart, find ORACLE_HOME_LISTNER =, and change the value to the ORACLE_HOME path or environment variable.
# Su-oracle
$ Vi $ ORACLE_HOME/biin/dbstart
# Set this to bring up Oracle Net Listener
ORACLE_HOME_LISTNER = $ ORACLE_HOME --- modify here. You can use $ ORACLE_HOME or the absolute path.
If [! $ ORACLE_HOME_LISTNER]; then
Echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"
Else
LOG = $ ORACLE_HOME_LISTNER/listener. log
# Start Oracle Net Listener
If [-f $ ORACLE_HOME_LISTNER/bin/tnslsnr]; then
Echo "$0: Starting Oracle Net Listener" >>$ LOG 2> & 1
$ ORACLE_HOME_LISTNER/bin/lsnrctl start >$ LOG 2> & 1 &
Export VER10LIST = '$ ORACLE_HOME_LISTNER/bin/lsnrctl version | grep "LSNRCTL for" | cut-d ''-f5 | cut-d'.'-f1'
Else
Echo "Failed to auto-start Oracle Net Listene using $ ORACLE_HOME_LISTNER/bin/tnslsnr"
Fi
Fi
B. perform the following steps to disable oracle instances:
1. Create the k01orashut file and write the su-c "dbshut"-oracle command to this file.
Vi/etc/init. d/k01orashut
Add
Su-c "dbshut"-oracle
2. Modify the permission to execute
# Chown 777/etc/rc. d/init. d/k01orashut
3. Go to the/etc/rc3.d/directory and create a connection to shut down and execute commands.
# Ln-s/etc/rc. d/init. d/k01orashut
For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12