1. Modify the etcoratab file. The following dbstart and dbshut start the database soadb: u01oracleproduct11.2.0dbhome _ 1: Y2. create a database.
1. Modify the/etc/oratab file. The following dbstart and dbshut start the database soadb:/u01/oracle/product/11.2.0/dbhome_1: Y2. create a database.
1. Modify the/etc/oratab file. The following dbstart and dbshut start the database based on the file.
Soadb:/u01/Oracle/product/11.2.0/dbhome_1: Y
2. Create a database initialization file:
# Cp $ ORACLE_BASE/admin/$ ORACLE_SID/pfile/init $ ORACLE_SID.ora. * $ ORACLE_HOME/dbs/init $ ORACLE_SID.ora
Cp/u01/oracle/admin/soadb/pfile/init. ora.201201214406/u01/oracle/product/11.2.0/dbhome_1/dbs/initsoadb. ora
3. Create a script file under/etc/init. d to automatically shut down Oracle before the system starts automatically and shuts down, as shown below:
Vi start_oracle.sh (start the oracle database script after startup ):
#! /Bin/bash
# This script is used to start the oracle
Su-oracle-c "/u01/oracle/product/11.2.0/dbhome_1/bin/dbstart"
Su-oracle-c "/u01/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"
Chmod a + x/etc/init. d/start_oracle.sh
Vi stop_oracle.sh (stop the oracle database script before shutdown ):
#! /Bin/bash
# This script is used to stop the oracle
Su-oracle-c "/u01/oracle/product/11.2.0/dbhome_1/bin/lsnrctl stop"
Su-oracle-c "/u01/oracle/product/11.2.0/dbhome_1/bin/dbshut"
Chmod a + x/etc/init. d/stop_oracle.sh
4. Create a link with system startup and shutdown:
Add the Automatic startup Link under/etc/rc2.d. The command is as follows:
Ln-s/etc/init. d/start_oracle.sh/etc/rc. d/rc2.d/S16start_oracle
Ln-s/etc/init. d/start_oracle.sh/etc/rc. d/rc3.d/S16start_oracle
Ln-s/etc/init. d/start_oracle.sh/etc/rc. d/rc5.d/S16start_oracle
Add the automatic close link under/etc/rc0.d. The command is as follows:
Ln-s/etc/init. d/stop_oracle.sh/etc/rc. d/rc2.d/K01stop_oracle
Ln-s/etc/init. d/stop_oracle.sh/etc/rc. d/rc3.d/K01stop_oracle
Ln-s/etc/init. d/stop_oracle.sh/etc/rc. d/rc5.d/K01stop_oracle
Then, the two links of cp are located at/etc/rc. d/rcN. d (N = 3, 5 ).
After the settings are complete, restart and check the effect.
Linux :~ # Reboot
Test @ linux: ~> Ps-ef | grep ora