How to automatically start Oracle with Linux

Source: Internet
Author: User
1) In etcoratab, the file should be generated by executing the root. sh command at the end of database installation. Pwdb: Oracleprocduct10.2db _ 1: Y $ ORA

1) in/etc/oratab, the file should be generated by executing the root. sh command at the end of database installation. Pwdb:/Oracle/procduct/10.2/db_1/: Y $ ORA

1)

In the/etc/oratab file, the file is generated by the root. sh Command executed last when the database is installed.

Pwdb:/Oracle/procduct/10.2/db_1/: Y

$ ORACLE_SID: $ ORACLE_HOME:

2)

Add/etc/rc. local

Su-oracle-c 'dbstart'

Su-oracle-c 'lsnrctl start'

This should be executed by the specified user at startup,

Similarly, some other commands can also be written here and executed at startup.

3)

In the $ ORACLE_HOME/bin/dbstart file, add

ORACLE_HOME_LISTNER = '/ade /....'

Change

ORACLE_HOME_LISTNER = $ ORACLE_HOME

Step 3: I wrote the information on the network, but I didn't know what the function is,

It may be for the old version.

After completing these steps, restart linux. After the startup is complete, you can directly connect the database to discover that the data and tns have been started.

Another method is as follows:

Add a file in/etc/rc. d/init. d. Here is oradb.

The content is as follows. I copied it from the Internet and made some modifications.

####################################
#! /Bin/bash
# Chkconfig: 35 95 1
# Description: init script. to start/stop oracle database 10g, TNS listener, EMS
#
#
# Set the variable value as needed:
Export ORACLE_BASE =/u01
Export ORACLE_HOME = $ ORACLE_BASE/oracle
Export ORACLE_SID = huang
Export PATH =/home/oracle/bin: $ ORACLE_HOME/bin: $ PATH
Export ORACLE_USER = oracle

# Perform the following two operations based on the $1 parameter: Start and close:
Case $1 in
Start)
Su-"$ ORACLE_USER" < Lsnrctl start
Dbstart
EOS
# Start oem

# Emctl start dbconsole
EOO
;;

Stop)
Su-"$ ORACLE_USER" < Lsnrctl stop
Dbshut
EOS

# Disable ocm
# Emctl stop dbconsole
EOO
;;

*)

# Other input, with the syntax format
Echo "Usage: $0 {start | stop }"
;;
Esac
###################################

Save and modify the group and permissions.

Chown oracle: oinstall oradb
Chmod 755 oradb

Chkconfig oradb on

Chkconfig -- list oradb

You can start or stop a service

Service oradb start
Service oradb stop

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.