Linux: RedHatEnterpriseLinux5.6Oracle: 10g1, modify the/etc/oratab file and change orcl:/home/oracle/product/10.2.0/db_1: N to orcl: /home/oracle/product/10.2.0/db_1: Y2, modify $ ORACLE_H under the oracle account
Linux: RedHat Enterprise Linux 5.6
Oracle version: 10 GB
1. Modify the/etc/oratab File
Set orcl:/home/oracle/product/10.2.0/db_1: N
Changed to orcl:/home/oracle/product/10.2.0/db_1: Y.
2. Modify the $ ORACLE_HOME/bin/dbstart file under the oracle account:
# Su-ORACLE
$ Cd $ ORACLE_HOME/bin
$ Vi dbstart
Locate ORACLE_HOME_LISTNER = $1.
Changed:
ORACLE_HOME_LISTNER = $ ORACLE_HOME
..................
3. Create the following script named oracle
#! /Bin/bash
# Chkconfig: 2345 99 10
# Description: Startup Script for oracle Databases
#/Etc/rc. d/init. d/oradbstart
Export ORACLE_BASE =/home/oracle/
Export ORACLE_HOME =/home/oracle/product/10.2.0/db_1
Export ORACLE_SID = orcl
Export PATH = $ PATH: $ ORACLE_HOME/bin
Case "$1" in
Start)
Echo "----- startup oracle -----" >>$ ORACLE_HOME/log/oracleLog. log
Su oracle-c $ ORACLE_HOME/bin/dbstart
Touch/var/lock/subsys/oracle
Echo "----- startup oracle successful -----" >>$ ORACLE_HOME/log/oracleLog. log
Echo "OK"
;;
Stop)
Echo "----- shutdwn oracle -----" >>$ ORACLE_HOME/log/oracleLog. log
Su oracle-c $ ORACLE_HOME/bin/dbshut
Rm-f/var/lock/subsys/oracle
Echo "----- shutdown oracle successful -----" >>$ ORACLE_HOME/log/oracleLog. log
Echo "OK"
;;
*)
Echo "Usage: 'basename $ 0' start | stop"
Exit 1
Esac
Exit 0
4. Modify permissions
# Su-root
Chown oracle/etc/init. d/oracle
Chmod 775/etc/init. d/oracle
5. Create a connection
Create a symbolic link file.
Chkconfig -- add/etc/init. d/oracle
(Note that the system is usually restarted here)
6. Verification
Copy the Code as follows:
# Cd/etc/init. d
Sh oracle11 start
After the script is executed, check the oracleLog file in the/$ ORACLE_HOME/log/directory. Is there any output information for the startup branch of the script?
Sh oracle11 stop
After the command is executed, check the oracleLog file in the/$ ORACLE_HOME/log/directory. Is there any script to close the branch output information?
If the information is displayed, the setting is successful. If not, set it again and pay attention to file permissions. LINUX has strict user concepts. After all, it is a multi-user system.