CentOS Oracle11gR2 设置开机自启动
来源:互联网 发布:网络电台软件 编辑:程序博客网 时间:2024/05/17 22:46
http://www.cnblogs.com/lightnear/archive/2012/10/10/2718737.html
CentOS Oracle11gR2 设置开机自启动
[1] 更改/etc/oratab
[root@localhost ~]# vi /etc/oratab## This file is used by ORACLE utilities. It is created by root.sh# and updated by the Database Configuration Assistant when creating# a database.# A colon, ':', is used as the field terminator. A new line terminates# the entry. Lines beginning with a pound sign, '#', are comments.## Entries are of the form:# $ORACLE_SID:$ORACLE_HOME:<N|Y>:## The first and second fields are the system identifier and home# directory of the database respectively. The third filed indicates# to the dbstart utility that the database should , "Y", or should not,# "N", be brought up at system boot time.## Multiple entries with the same $ORACLE_SID are not allowed.##MFGS:/usr/oracle/app/product/11.2.0/dbhome_1:Y #改变此处
[2] oracle用户profile文件中增加SID环境变量
[root@localhost ~]# vi /usr/oracle/.bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATH# add at the last lineumask 022export ORACLE_BASE=/usr/oracle/appexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export PATH=$PATH:$ORACLE_HOME/bin#在文件末尾增加
export ORACLE_SID=MFGS
[3] 创建启动Oracle的Init脚本
[root@localhost ~]# vi /etc/rc.d/init.d/oracle# this is an example#!/bin/bash# oracle: Start/Stop Oracle Database 11g R2## chkconfig: 345 90 10# description: The Oracle Database is an Object-Relational Database Management System.## processname: oracle. /etc/rc.d/init.d/functionsLOCKFILE=/var/lock/subsys/oracleORACLE_HOME=/usr/oracle/app/product/11.2.0/dbhome_1ORACLE_USER=oraclecase "$1" in'start') if [ -f $LOCKFILE ]; then echo $0 already running. exit 1 fi echo -n $"Starting Oracle Database:" su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start" su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole" touch $LOCKFILE ;;'stop') if [ ! -f $LOCKFILE ]; then echo $0 already stopping. exit 1 fi echo -n $"Stopping Oracle Database:" su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop" su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut" su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole" rm -f $LOCKFILE ;;'restart') $0 stop $0 start ;;'status') if [ -f $LOCKFILE ]; then echo $0 started. else echo $0 stopped. fi ;;*) echo "Usage: $0 [start|stop|status]" exit 1esacexit 0
[4] 更改启动脚本权限
[root@localhost ~]# chmod 755 /etc/rc.d/init.d/oracle
[5] 启动oracle数据库
[root@localhost ~]# service oracle startStarting Oracle Database:LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 09-OCT-2012 12:50:44Copyright (c) 1991, 2009, Oracle. All rights reserved.Starting /usr/oracle/app/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionSystem parameter file is /usr/oracle/app/product/11.2.0/dbhome_1/network/admin/l istener.oraLog messages written to /usr/oracle/app/diag/tnslsnr/localhost/listener/alert/lo g.xmlListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionStart Date 09-OCT-2012 12:50:44Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /usr/oracle/app/product/11.2.0/dbhome_1/network/admin/ listener.oraListener Log File /usr/oracle/app/diag/tnslsnr/localhost/listener/alert/ log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))The listener supports no servicesThe command completed successfullyOracle Enterprise Manager 11g Database Control Release 11.2.0.1.0Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.https://localhost:1158/em/console/aboutApplicationStarting Oracle Enterprise Manager 11g Database Control ....... started.------------------------------------------------------------------Logs are generated in directory /usr/oracle/app/product/11.2.0/dbhome_1/localhost_MFGS/sysman/log
相应关闭oracle数据库的命令为
[root@localhost ~]# service oracle stop
[6] 设置oracle为开机自启动
[root@localhost ~]# chkconfig oracle on[root@localhost ~]# chkconfig --list oracleoracle 0:off 1:off 2:on 3:on 4:on 5:on 6:off
0 0
- CentOS Oracle11gR2 设置开机自启动
- CentOS Oracle11gR2 设置开机自启动
- CentOS Oracle11gR2 设置开机自动启动
- CentOS设置开机自启动
- oracle11gR2单机设置开机自启动监听和数据库
- centos下设置程序开机自启动
- centos设置开机自启动服务
- centos 设置oracle 开机自启动
- centos设置开机自启动脚本
- centos ngrok设置开机自启动 笔记
- Centos开机自启动
- centos 开机自启动
- centos 开机自启动
- 设置开机自启动
- CentOS设置开机启动
- CentOS设置开机启动
- centos开机启动设置
- CentOS设置开机启动
- tomcat如何配置环境变量
- 还是要iyishi啊 不然就废了
- 黑马程序员——多线程(线程间通信)
- ubuntu12 安装 apache2.4+php5.6+mysql5.6
- 你真的懂任务管理器中有关内存的参数Private(提交大小)和working set(工作设置)吗?
- CentOS Oracle11gR2 设置开机自启动
- http://ec.iresearch.cn/reservation/20150327/248051.shtml#6634817-qzone-1-22915-3e7edfcacfa3df75b7a4b
- 第4周课后实践·阅读程序-构造函数和析构函数(2)
- clojure-运行环境安装
- vector开辟二维数组
- JS给Table动态添加 TR
- rhel 6.x下oracle asmlib包
- 看论坛、博客为团队建设做基础
- Java发送GET,POST请求