SUSELinux11 automatically starts Oracle database upon startup

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.