case \‘start’)
# Start the Oracle databases:
# The following command assumes that the oracle login # will not prompt the user for any value
su – $ORA_OWNER -c \dbconsole\
su – $ORA_OWNER -c \su – $ORA_OWNER -c $ORA_HOME/bin/dbstart ;; ‘stop’)
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su – $ORA_OWNER -c \dbconsole\
su – $ORA_OWNER -c \su – $ORA_OWNER -c $ORA_HOME/bin/dbshut ;; esac
用下面的命令修改权限: # chmod 750 /etc/init.d/dbora 然后把它添加到 chkconfig中: # chkconfig –level 345 dbora on 现在可以测试一下是否能按预期工作: # /etc/init.d/dbora start # /etc/init.d/dbora stop
现在可以登录到 Web Console,默认URL是
“https://localhost:1158/em”,默认用户名是: sys,你可以查看到数据库各项服务的信息:
Oracle 服务启动或停止时的常见错误 1. 错误信息:
“ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener”
解决方法 : 编辑文件 “dbstart” & “dbshut”, 找到“ $ORACLE_HOME_LISTNER=$1” 这行,将其改为:
“ $ORACLE_HOME_LISTNER=$ORACLE_HOME”
2. 错误信息:
“Message 1070 not found; No message file for product=NETWORK, facility=TNS TNS-12538: Message 12538 not found;
No message file for product=NETWORK,facility=TNS TNS-12560: Message 12560 not found; No message file for product=NETWORK, facility=TNS
TNS-00508: Message 508 not found; No message file for product=NETWORK, facility=TNS”
解决方法::配置 ORACLE_HOME,编辑 oracle 用户账号下的 .bash_profile,添加:
export ORACLE_HOME=/home/oracle/app
3. 错误信息:
“Environment variable ORACLE_SID not defined. Please define it”
解决方法:配置 ORACLE_SID,编辑 oracle 用户账号下的 .bash_profile,添加:
export ORACLE_SID=orcl