WEB开发网
开发学院操作系统CentOS CentOS Oracle测试运行使用root用户修改 阅读

CentOS Oracle测试运行使用root用户修改

 2010-05-06 13:16:54 来源:WEB开发网   
核心提示:特别值得一提的是CentOS Oracle有很多值得学习的地方,这里我们主要介绍CentOS Oracle,CentOS Oracle测试运行使用root用户修改,包括介绍CentOS Oracle等方面,Linux : CentOS-5Oracle: 10.2.0.1.0设置 Linux 上Oracle 自动启动 2

特别值得一提的是CentOS Oracle有很多值得学习的地方,这里我们主要介绍CentOS Oracle,包括介绍CentOS Oracle等方面。Linux : CentOS-5Oracle: 10.2.0.1.0设置 Linux 上Oracle 自动启动 200807221、首先在/etc/rc.d/init.d/目录下配置CentOS Oracle的服务文件。su - rootvi oracledb将最后的附件脚本贴入chmod 775 oracledb

2、使用root用户修改:[root@localhost init.d]# vi /etc/oratabcatlogdb:/oracle/product/10.2.0/db_1:Y 将最后的N改为Y

3、使用CentOS Oracle用户修改$ORACLE_HOME/bin/dbstart文件[root@localhost init.d]# su - oracle[oracle@localhost ~]$ cd $ORACLE_HOME/bin[oracle@localhost bin]$ vi dbstart找到 ORACLE_HOME_LISTNER 这行, 修改成:
ORACLE_HOME_LISTNER=/oracle/product/10.2.0/db_1或者直接修改成:ORACLE_HOME_LISTNER=$ORACLE_HOME

测试运行 dbshut, dbstart 看能否启动CentOS Oracle 服务及listener服务: [oracle@localhost bin]$ ps -ef|grep ora_[oracle@localhost bin]$ lsnrctl status

4、创建服务 chkconfig --add oracledbservice oracledb does not support chkconfig在脚本中以下两行必须存在# chkconfig: 345 99 10# description: script for the Oracle Instance, Listener 

[root@localhost ~]# chkconfig --list oracledb oracledb     0:off  1:off  2:off  3:on   4:on   5:on   6:off--附件oracledb 脚本
#!/bin/bash
#
# chkconfig: 345 99 10
# description: script for the Oracle Instance, Listener 
# /etc/init.d/oracledb
#

export ORACLE_HOME=/oracle/product/10.2.0/db_1
export ORACLE_SID=catlogdb
export PATH=$PATH:$ORACLE_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/dbstart"
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
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 ` start|stop|restart|reload"
exit 1
esac
exit 0
CentOS Oracle备注说明# chkconfig: 345 99 10指出3,4,5级别启动这个服务,99是在相应的/etc/rc.d/rcN.d(N为前面指定的级别,这里是345)目录下生成的链接文件的序号(启动优先级别)S99oradbstart,10为在除前面指出的级别对应的/etc/rc.d/rcN.d(N为除345之外的级别)目录生成的链接文件的序号(服务停止的优先级别)K10oradbstart撤销服务的话:chkconfig --del CentOS Oracledb

Tags:CentOS Oracle

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接