Oracle 10 Gb self-starting in Linux as4

Source: Internet
Author: User
1. Create a file/etc/oratab
# Add the following content to the/etc/oratab file,
# $ Oracle_sid is the SID of your Oracle Database
# $ ORACLE_HOME is the ORACLE_HOME of your Oracle Database
# Y indicates that Oracle database is required to be started at system startup. N indicates that Oracle database cannot be started at system startup.
$ Oracle_sid: $ ORACLE_HOME: Y

2. Modify the file/etc/rc. Local and add two lines.
##
# For more information about Su commands, see the Linux Manual document.
##
Su-Oracle-C 'dbstart'
Su-Oracle-C 'lsnrctl start listener'

Environment variable settings:
Edit/etc/profile

Export oracle_base =/usr/Oracle
Export ORACLE_HOME = $ oracle_base/product/10.2.0/db_2
Export oracle_sid = orcl
Export Path = $ path: $ home/bin: $ ORACLE_HOME/bin
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib
Export lc_ctype = en_US.UTF-8

Reprinted and self-started by script:
#! /Bin/sh
# Author: jackylau <squidipt@yahoo.com.cn>
# Chkconfig: 345 99
# Description: start or stop Oracle
./Etc/rc. d/init. d/functions
# Oracle_env
Export oracle_base =/home/Oracle
Export ORACLE_HOME = $ oracle_base/product/9.2.0
Export Path = $ path: $ ORACLE_HOME/bin
Export oracle_sid = oradb
Export oracle_term = VT100
Export ora_nls33 = $ ORACLE_HOME/ocommon/NLS/admin/Data
Export nls_lang = american_america.zhs16gbk
Oracle_user = Oracle

# Killproc
Start (){
Echo-n "Starting ORACLE :"
Su-"$ oracle_user" <
LSNRCTL start
Sqlplus/nolog <
Connect/As sysdba
Startup
EOS
EOO
}
Stop (){
Echo-n "stoping ORACLE :"
Su-"$ oracle_user" <
LSNRCTL stop
Sqlplus/nolog <
Connect/As sysdba
Shutdown immediate
EOS
EOO
}
Case "$1" in
Start)
Start
Touch/var/lock/subsys/orad
;;
Stop)
Stop
Rm-F/var/lock/subsys/orad
;;
Status)
Status Oracle
;;
Restart)
Stop
Sleep 3
Start
;;
*)
Echo "$0 {START | stop | status | restart }"
;;
Esac
Run the script CP to the/etc/rc. d/init. d/directory.

Add executable permissions:
Chmod 755/etc/rc. d/init. d/orad
Release:
Chkconfig -- add orad
You can!

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.