Set up Oracle power On self-boot

Source: Internet
Author: User

ORACLE Setup Boot from

Description: In general, the Windows platform Oracle server will start automatically, but Linux will not, including listening, database, console emctl need to be set

Available methods:
Way one: Using OS services: Oratab Mode II: Leveraging Oracle's own Dbstart and Dbshut

Personally feel that there is no particular difference between the two ways, the last is the use of Linux services to achieve, this article combined with their own production operations, using Oratab examples to illustrate

Step 1 Modify Oratab settings
Path:/etc/oratab, only then can Oracle's own dbstart and Dbshut work. Vi/etc/oratab format: $ORACLE _sid: $ORACLE _home:<n| Y>:examplewind:/u01/app/oracle/product/11.2.0/dbhome_1:y
Step 2 Configure Oracle Services

Linux init Description:

When Linux starts, it runs an init program, which is then initiated by INIT, including the multiuser environment (set in Inittab) and the network. The runlevel is the functional level of the current program running, from 1 to 6, with different functions. These levels are specified in/etc/inittab (the file location of the other distributions), which is the main file that the INIT program looks for. The first running service is placed under the/ETC/RC.D directory.

The file starts with S, represents start (start), the following numbers are the boot order, the file starts with K, it represents kill (end), and the subsequent numbers represent the end order. For example:/etc/rc3.d/s55sshd indicates that it is related to RunLevel 3, 55 is its boot order,/etc/rc3.d/k15nginx indicates that it is related to run Level 3, and 15 is the order in which it is closed.

INIT.D This directory contains some service startup scripts, several RPM packages at System installation, which can be used to start, stop, and restart these services when they are executed. RCX.D (x is 0~6) This directory is the startup level of the Execution Program link directory, which is a file in the INIT.D directory is a number of soft links. Under/etc/init.d/, create the file Oracle with the following content:

#!/bin/sh# chkconfig: 35 80 10# description: oracle auto start-stop  script.## Set ORA_HOME to be equivalent to the  $ORACLE _home#  from which you wish to execute dbstart and dbshut;## set  ora_owner to the user id of the owner of the# oracle  database in ora_home. ora_home=/u01/app/oracle/product/11.2/dbhome_1ora_owner=oracleif [ ! -f  $ORA _home/bin/ dbstart ]thenecho  "Oracle startup: cannot start" exitficase  "$"  in ' start ') #  Start the Oracle databases:echo  "starting oracle databases ... " echo  "-------------------------------------------------"  >> /var/log/oracledate + "  %t %a %d : starting oracle databases as part of&nbSp;system up. "  >> /var/log/oracleecho  "-------------------------------------------------"  >>  /var/log/oraclesu -  $ORA _owner -c  "$ORA _home/bin/dbstart"  >>/var/log/ oracleecho  "Done" # start the listener:echo  "starting oracle listeners  ...  "echo "-------------------------------------------------" >> /var/log/oracledate  + " %t %a %d : starting oracle listeners as part of  system up. "  >> /var/log/oracleecho  "-------------------------------------------------"  >>  /var/log/oraclesu -  $ORA _owner -c  "$ORA _home/bin/lsnrctl start"  >>/ var/log/oracleecho  "Done." echo  "-------------------------------------------------"  >> /var/log/oracledate + "  %t %a %d : finished. "  >> /var/log/oracleecho  "-------------------------------------------------"  >> /var/ log/oracletouch /var/lock/subsys/oracle ;; ' Stop ') # stop the oracle listener:echo  "STOPING&NBSP;ORACLE&NBSP;LISTENERS&NBSP;   "echo "-------------------------------------------------" >> /var/log/oracledate  + " %T %a %D : Stoping Oracle Listener as part of  System down. "  >> /var/log/oracleecho  "-------------------------------------------------"  >>  /var/log/oraclesu -  $ORA _owner -c  "$ORA _home/bin/lsnrctl stop"  >>/ var/log/oracleecho  "Done." rm -f /var/lock/subsys/oracle# stop the oracle database:echo  "Stoping  oracle databases ...  "echo "-------------------------------------------------" > > /var/log/oracledate + " %t %a %d : stoping oracle databases as part of  system down. "  >> /var/log/oracleecho  "-------------------------------------------------"  >>  /var/log/oraclesu -  $ORA _owner -c  "$ORA _home/bin/dbshut"  >>/var/log/ oracleecho  "Done." echo  "" echo  "-------------------------------------------------"  >> /var/log/ oracledate + " %t %a %d : finished."  >> /var/log/oracleecho  "-------------------------------------------------"  >>  /var/log/oracle;; ' Restart ') $0 stop$0 start;; Esac
Step 3 Setup Service Oracle Boot
chmod 755/etc/init.d/oraclechkconfig--level Oracle onln-s/etc/init.d/oracle/etc/rc0.d/k01oracle----set OS shutdown, Turn off Oracle before restarting
Step 4 test method
# service Oracle Start//Start oracle# service Oracle Stop//SHUTDOWN oracle# Service Oracle restart//Restart oracle# re Boot


This article is from the Oracle all-in-one blog, so be sure to keep this source http://woquer.blog.51cto.com/9290811/1828021

Set up Oracle power On self-boot

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.