喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 喜悦证交所 | 帮助

RSS 订阅当前论坛  

[北京]代朋友公司招聘PHP高级程序员多名

上一主题 下一主题
     
标题: [问题] 为什么每次启动sqlplus都的设置环境?  
 
eaglesjazz (eaglesjazz)
注册会员
Rank: 2
一般会员



UID 16020
精华 0
积分 178
帖子 140
金钱 178 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2002-8-20
状态 离线
为什么每次启动sqlplus都的设置环境?

每次机器重起都得设置
export ORACLE_HOME=/datas/apps/oracle/product/10.2.0/db_1
export ORACLE_SID=orcl


要不然就会报错!!
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

我设置了一个自动启动Oracle的dbora
内容是:

#!/bin/bash
#
# chkconfig: 2345 80 05
# description: Oracle 10g Server
# /etc/init.d/dbora
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface

export ORACLE_BASE=/datas/apps/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATHORACLE_HOME/bin

ORA_OWNR="oracle"

# if the executables do not exist -- display error

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

# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
    start)
        # Oracle listener and instance startup
        echo -n "Starting Oracle: "
#       su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
        su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart
        touch /var/lock/oracle

        su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
        echo "OK"
        ;;
    stop)
        # Oracle listener and instance shutdown
        echo -n "Shutdown Oracle: "
#       su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
        su $ORA_OWNR -c $ORACLE_HOME/bin/dbshut
        rm -f /var/lock/oracle

        su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
        echo "OK"
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: `basename $0` start|stop|restart|reload"
        exit 1
esac
exit 0

有人帮帮忙吗???
2008-1-9 02:45 PM#1
查看资料  发短消息  顶部
 
eaglesjazz (eaglesjazz)
注册会员
Rank: 2
一般会员



UID 16020
精华 0
积分 178
帖子 140
金钱 178 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2002-8-20
状态 离线
[推荐阅读] 用友软件工程有限公司诚聘
这个是用户环境变量没有设置好!!
应该编辑vi $HOME/.bash_porfile
再运行 source - $HOME/.bash_porfile
让环境变量生效!!
2008-1-15 11:58 PM#2
查看资料  发短消息  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 




Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.022295 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP