Oracle self-launch in Linux

Source: Internet
Author: User

 

Root @ localhost oracle] # vim/etc/oratab

 

 

1 $ ORACLE_SID: $ ORACLE_HOME: Y

 

 

? 1 [root @ localhost oracle] # vim/etc/init. d/dbora

 

 

View sourceprint? 01 #! /Bin/sh

 

02 # chkconfig: 345 99 10

 

03 # description: Oracle auto start-stop script.

 

04 #

 

05 # Set ORA_HOME to be equivalent to the $ ORACLE_HOME

 

06 # from which you wish to execute dbstart and dbshut;

 

07 #

 

08 # Set ORA_OWNER to the user id of the owner of

 

09 # Oracle database in ORA_HOME.

 

10

 

11 ORA_HOME = $ ORACLE_HOME

 

12 ORA_OWNER = oracle

 

13

 

14 if [! -F $ ORA_HOME/bin/dbstart]

 

15 then

 

16 echo "Oracle startup: cannot start"

 

17 exit

 

18 fi

 

19

 

20 case "$1" in

 

21 'start ')

 

22 # Start the Oracle databases:

 

23 # The following command assumes that the oracle login

 

24 # will not prompt the user for any values

 

25 su-$ ORA_OWNER-c "$ ORA_HOME/bin/lsnrctl start"

 

26 su-$ ORA_OWNER-c $ ORA_HOME/bin/dbstart

 

27 touch/var/lock/subsys/dbora

 

28 ;;

 

29 'stop ')

 

30 # Stop the Oracle databases:

 

31 # The following command assumes that the oracle login

 

32 # will not prompt the user for any values

 

33 su-$ ORA_OWNER-c $ ORA_HOME/bin/dbshut

 

34 su-$ ORA_OWNER-c "$ ORA_HOME/bin/lsnrctl stop"

 

35 rm-f/var/lock/subsys/dbora

 

36 ;;

 

37 esac

 

 

1 [root @ localhost oracle] # chmod 750/etc/init. d/dbora

 

 

1 [root @ localhost oracle] # chkconfig -- add dbora

 

 

If bash: chkconfig: command not found appears in chkconfig

 

1 [root @ localhost oracle] # rpm-aq | grep chkconfig

 

2 chkconfig-1.3.30.2-2.el5

 

3 [root @ localhost oracle] # export PATH =/sbin: $ PATH

 

4 [root @ localhost oracle] # chkconfig

 

 

Yes. restart the system!

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.