温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2021-09-28 17:10:51 来源:亿速云 阅读:116 作者:柒染 栏目:系统运维

这篇文章给大家介绍如何进行CentOS Oracle测试运行使用root用户修改,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

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

关于如何进行CentOS Oracle测试运行使用root用户修改就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI