Article Title: Automatic startup service creation for Oracle in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. Use the root user to modify the/etc/oratab file:
$ Vi/etc/oratab
Orcl:/oracle/app/product/10.2.0/db_1: N
Changed:
Orcl:/oracle/app/product/10.2.0/db_1: Y
That is, change the last N to Y.
2. Use the Oracle user to modify the $ ORACLE_HOME/bin/dbstart file:
# Su-oracle
$ Cd $ ORACLE_HOME/bin
$ Vi dbstart
Locate ORACLE_HOME_LISTNER = ...... This line is changed to ORACLE_HOME_LISTNER =/u01/app/oracle/product/10.1.0/db_1.
Or directly modify it:
ORACLE_HOME_LISTNER = $ ORACLE_HOME
3. Test and run dbshut. Check whether dbstart can start the Oracle service and listener service. 1. modify the permissions of dbstart and dbshut log files:
$ Su-root
# Cd $ ORACLE_HOME
# Chown oracle: oinstall startup. log # chown oracle: oinstall shutdown. log Note: startup. log and shutdown. log may not exist when you run. /dbstart and. /dbshut.
2. Execute the corresponding script for testing
# Su-oracle
$ Cd $ ORACLE_HOME/bin
$./Dbstart (. /Dbshut)
$ Ps-efw | grep ora _
$ Lsnrctl status
$ Ps-efw | grep LISTEN | grep-v grep
4. Create a service
$ Su-root
# Cd/etc/rc. d/init. d/
# Vi oradbstart
Copy the following Script 1 or script 2 to the oradbstart file:
Note:
(1) # The number of rows to start cannot be small. Otherwise, the following chkconfig command will return an error: the oradbstart service does not support chkconfig.
(2) modify the environment variable configuration section based on your environment (in blue)
(3) copy the following script content saved in windows to linux through ISO, copy the script to the oradbstart file, and run the vi oradbstart command on the terminal, some lines may be followed by characters similar to ^ M and deleted. Otherwise, after running the chkconfig command. d/rcN. the S99oradbstart file generated under the d directory (N is run level) is empty. You can use vi to view the S99oradbstart file, and the content should be/etc/rc. d/init. d/oradbstart file content is the same (the third case is that I use the Virtual Machine VMWARE to install linux under xp, save the following script as a text file, and then make it into an ISO file, copy the file content in ISO to oradbstart. In this case, some lines are followed by characters similar to ^ M, which cannot be seen using gredit. Only vi can be seen)
[1] [2] [3] [4] Next page