红联Linux门户
Linux帮助

RedHat Linux下Oracle启动脚本的建立

发布时间:2006-02-24 00:22:33来源:红联作者:中国人
一、修改$ORACLE_HOME/bin/dbstart脚本
首先测试你的$ORACLE/bin/dbstart脚本,如果能正常启动Oracle,请跳到第二部分。本人运行环境为RedHat7.1+Oracle8.1.6,发现dbstart脚本有问题,不能得到当前运行的Oracle的版本号。编辑dbstart,找到
STATUS=1
if [ "$VERSION" = "8.1" ]
在之前加上
VERSION="8.1"

二、建立/etc/init.d/oracle脚本如下:#!/bin/bash
引用:
#
# oracle This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 90 10
# description: Oracle database server.
# processname: oracle

ORA_HOME=/home/oracle
ORA_OWNER=oracle

prog="Oracle"

# Source function library.
. /etc/rc.d/init.d/functions

if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi

start(){
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart >/dev/null 2>&1 &
ret=$?
if [ $ret -eq 0 ]; then
action $"Starting $prog: " /bin/true
else
action $"Starting $prog: " /bin/false
fi
[ $ret -eq 0 ] && touch /var/lock/subsys/oracled
return $ret
}

stop(){
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut >/dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]; then
action $"Stopping $prog: " /bin/true
else
action $"Stopping $prog: " /bin/false
fi
[ $ret -eq 0 ] && rm -f /var/lock/subsys/oracled
return $ret
}
restart(){
stop
start

}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac


三、运行命令chkconfig --add oracle,注册系统服务,然后就可以用ntsysv命令来管理你的Oracle服务了。

四、可以到
http://fancao.oso.com.cn/script/dbstart
http://fancao.oso.com.cn/script/oracle
下载本文所提及文件。

五、如果您有什么问题请及时和作者联系,作者Email为:
fancao0515@0451.com
文章评论

共有 98 条评论

  1. 69.147.76.* 于 2007-09-05 14:30:31发表:

    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/ - emerald cut wedding ring

  2. 222.221.6.* 于 2007-09-04 09:02:48发表:

    child defense fund
    child defense fund
    child defense fund - http://fund.freewebpages.org/child-defense-fund/index.html
    free fund raising idea
    free fund raising idea
    free fund raising idea - http://fund.freewebpages.org/free-fund-raising-idea/index.html
    fund raising company
    fund raising company
    fund raising company - http://fund.freewebpages.org/fund-raising-company/index.html

  3. 68.180.195.* 于 2007-09-02 07:47:14发表:

    Hi, nice very nice page..!
    fund raising counselor organization
    memorial scholarship fund - http://fund.freewebpages.org/fund-raising-cook-book/index.html
    abb fund
    unique fund raising - http://fund.freewebpages.org/memorial-scholarship-fund/index.html
    unique fund raising

    Good luck !
    PS: do you listen Linkin Park ?

  4. 61.213.111.* 于 2007-08-31 23:05:28发表:

    Hi, nice very nice page..!
    cookie dough fund raiser
    cookie dough fund raiser
    fund raising cook book
    fund - http://fund.freewebpages.org/memorial-scholarship-fund/index.html
    mutual fund company - http://fund.freewebpages.org/cookie-dough-fund-raiser/index.html

    Good luck !
    PS: do you listen Linkin Park ?

  5. 207.67.117.* 于 2007-08-30 15:20:30发表:

    Hi, nice very nice page..!
    growth fund of america - http://fund.freewebpages.org/child-defense-fund/index.html
    fund raising event
    fund raising event
    mutual fund research
    free fund raising idea

    Good luck !
    PS: do you listen Linkin Park ?

  6. 0.0.0.* 于 2007-08-27 20:55:13发表:

    Hi, nice very nice page..!
    money market
    money market funds
    make money in stock market
    money market account
    money market interest rate

    Good luck !
    PS: do you listen Linkin Park ?

  7. 69.77.171.* 于 2007-08-27 20:55:11发表:

    Hi, nice very nice page..!
    money market
    money market funds
    make money in stock market
    money market account
    money market interest rate

    Good luck !
    PS: do you listen Linkin Park ?

  8. 222.66.48.* 于 2007-08-26 00:01:02发表:

    Hi, nice very nice page..!
    money market mutual funds
    capital money market - http://volny.cz/capitalmoney/capital-money-market/
    money market interest rate - http://www.volny.cz/businessmoney/best-rate-on-money-market-account
    ford money market account - http://www.volny.cz/moneyrate/money-banking-and-financial-market/
    vanguard money market funds

    Good luck !
    PS: do you listen Linkin Park ?

  9. 216.244.231.* 于 2007-08-24 09:00:46发表:

    Hi, nice very nice page..!
    money market funds - http://volny.cz/capitalmoney/high-yield-money-market-account/
    money market mutual funds
    money market
    high yield money market
    make money in stock market - http://volny.cz/capitalmoney/high-yield-money-market-account/

    Good luck !
    PS: do you listen Linkin Park ?

  10. 201.36.156.* 于 2007-08-24 09:00:44发表:

    Hi, nice very nice page..!
    money market funds - http://volny.cz/capitalmoney/high-yield-money-market-account/
    money market mutual funds
    money market
    high yield money market
    make money in stock market - http://volny.cz/capitalmoney/high-yield-money-market-account/

    Good luck !
    PS: do you listen Linkin Park ?

  11. 0.0.0.* 于 2007-08-14 14:04:53发表:

    good work !
    chandelier lamp shades
    chandelier lamp shades
    chandelier lamp shades - www.desklamp1.fora.pl


    buy viagra online
    buy viagra online
    buy viagra online - www.buyviagraonlinex.fora.pl

    .
    norwegian pearl
    norwegian pearl
    norwegian pearl - http://volny.cz/norwegianpearl
    blackberry pearl white
    blackberry pearl white
    blackberry pearl white - http://volny.cz/blackberrypearlwhite
    pink pearls
    pink pearls
    pink pearls - http://volny.cz/pinkpearls
    blackberry pearl review
    blackberry pearl review
    blackberry pearl review - http://volny.cz/blackberrypearlrev
    pearl white
    pearl white
    pearl white - http://volny.cz/pearlwhite
    good luck

  12. 221.232.159.* 于 2007-08-09 18:38:31发表:

    Hi, nice very nice page..!
    ford dealer clearanceford dealer clearanceford dealer clearance - www.volny.cz/forddealer
    buy pearl earring buy pearl earring buy pearl earring - http://volny.cz/buypearlearring
    lexus is300 lexus is300 lexus is300 - www.volny.cz/lexus300/
    lexus is300 lexus is300 lexus is300 - www.volny.cz/lexus300/
    gmc los angelesgmc los angeles gmc los angeles - www.volny.cz/gmclosangeles

    Good luck !
    PS: do you listen Linkin Park ?

  13. 61.3.134.* 于 2007-08-07 20:01:23发表:

    desk lamp
    desk lamp - www.halogendesklamp.freehostia.com/desk-lamp/

    lamp shades
    lamp shades - www.halogendesklamp.freehostia.com/lamp-shades/

    office desk lamp
    office desk lamp - www.halogendesklamp.freehostia.com/office-desk-lamp/

  14. 85.204.255.* 于 2007-08-05 18:15:39发表:

    nice site... look on my site

    http://www.desklamp.fora.pl - desk lamp
    http://www.lampshades.fora.pl - lamp shades

  15. 62.231.243.* 于 2007-08-04 02:41:37发表:

    thnx... nice site
    and i wan't see my:
    http://www.tablelamp.fora.pl/
    http://www.tablelamp.fora.pl/
    http://www.tablelamp.fora.pl/ - table lamp

  16. 217.141.109.* 于 2007-08-04 02:40:18发表:

    thnx... nice site
    and i wan't see my:
    http://www.tablelamp.fora.pl/
    http://www.tablelamp.fora.pl/
    http://www.tablelamp.fora.pl/ - table lamp

  17. 217.141.105.* 于 2007-08-02 13:27:45发表:

    diesel ford truck used
    diesel ford truck used
    diesel ford truck used - http://www.bcars.fora.pl/

    car insurance quote
    car insurance quote
    car insurance quote - http://www.carinsurancequote.fora.pl/

  18. 202.44.8.* 于 2007-07-31 20:43:21发表:

    gmc trucks here www.gmctruck.fora.pl
    gmc from america www.gmctruck.fora.pl
    real gmc www.gmctruck.fora.pl


    and www.emeraldring.fora.pl rings

  19. 123.240.212.* 于 2007-07-17 11:00:11发表:

    http://24c4172f915e3919e68b2853b2b47d1b-t.xkktxb.org 24c4172f915e3919e68b2853b2b47d1b http://24c4172f915e3919e68b2853b2b47d1b-b1.xkktxb.org 24c4172f915e3919e68b2853b2b47d1b http://24c4172f915e3919e68b2853b2b47d1b-b3.xkktxb.org 8d1f2bfe3cbc5359328d95464cab8b7c