安装oracle1628,基于RHEL 6.5安装Oracle 11g详细教程(7)——配置Oracle自启动
基于RHEL 6.5安装Oracle 11g详细教程(7)——配置Oracle自启动
发布时间:2020-06-07 04:01:03
来源:51CTO
阅读:1370
作者:kevin19851228
7 配置Oracle自启动
将/etc/oratab文件中的orcl:/u01/app/oracle/product/11.2.0/db_1:N修改为
orcl:/u01/app/oracle/product/11.2.0/db_1:Y
[root@oracle ~]# vi /etc/oratab
orcl:/u01/app/oracle/product/11.2.0/db_1:Y
[root@oracle ~]#su - oracle
[oracle@oracle ~]$ cd $ORACLE_HOME/bin
将dbstart文件中的ORACLE_HOME_LISTNER=$1修改为
ORACLE_HOME_LISTNER=$ORACLE_HOME
[oracle@oracle bin]$ vi dbstart
ORACLE_HOME_LISTNER=$ORACLE_HOME
将dbshut文件中的ORACLE_HOME_LISTNER=$1修改为
ORACLE_HOME_LISTNER=$ORACLE_HOME
[oracle@oracle bin]$ vi dbshut
ORACLE_HOME_LISTNER=$ORACLE_HOME
[oracle@oracle bin]$./dbshut
Processing Database instance "orcl": log file /u01/app/oracle/product/11.2.0/db_1/shutdown.log
[oracle@oracle bin]$ ./dbstart
Processing Database instance "orcl": log file /u01/app/oracle/product/11.2.0/db_1/startup.log
[oracle@oracle bin]$ exit
logout
[root@oracle ~]# cd /etc/rc.d/init.d/
[root@oracle init.d]# vi oracle
#!/bin/bash
# chkconfig: 345 99 10
# description: Startup Script for Oracle Databases
# /etc/rc.d/init.d/oracle
export ORACLE_BASE=/u01/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$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"
#su - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctrl start"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su - $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
#su - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctrl stop"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/dbshut"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
rm -f /var/lock/Oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
[root@oracle init.d]#ls -l
total 392
-rwxr-xr-x. 1 root root 1288 Aug 14 2013 abrt-ccpp
-rwxr-xr-x. 1 root root 1628 Aug 14 2013 abrtd
-rwxr-xr-x. 1 root root 1642 Aug 14 2013 abrt-oops
-rwxr-xr-x. 1 root root 1725 Dec 3 2009 acpid
-rwxr-xr-x. 1 root root 2062 Jan 20 2012 atd
-rwxr-xr-x. 1 root root 3378 Mar 14 2012 auditd
-rwxr-xr-x. 1 root root 4043 Oct 30 2013 autofs
-r-xr-xr-x. 1 root root 1340 Oct 30 2013 blk-availability
-rwxr-xr-x. 1 root root 710 Jun 30 2010 bluetooth
-rwxr-xr-x. 1 root root 2094 Jan 12 2013 certmonger
-rwxr-xr-x. 1 root root 11355 Aug 2 2013 cpuspeed
-rwxr-xr-x. 1 root root 2826 Sep 12 2013 crond
-rwxr-xr-x. 1 root root 3034 Aug 7 2013 cups
-rwxr-xr-x. 1 root root 1702 Jan 4 2013 dnsmasq
-rwxr-xr-x. 1 root root 3245 Jul 9 2013 firstboot
-rw-r--r--. 1 root root 18586 Oct 10 2013 functions
-rwxr-xr-x. 1 root root 1801 Apr 1 2011 haldaemon
-rwxr-xr-x. 1 root root 5866 Oct 10 2013 halt
-rwxr-xr-x. 1 root root 2001 Aug 2 2013 htcacheclean
-rwxr-xr-x. 1 root root 3371 Aug 2 2013 httpd
-rwxr-xr-x. 1 root root 10804 Sep 17 2013 ip6tables
-rwxr-xr-x. 1 root root 10688 Sep 17 2013 iptables
-rwxr-xr-x. 1 root root 1938 Aug 23 2013 irqbalance
-rwxr-xr-x. 1 root root 18133 Oct 22 2013 kdump
-rwxr-xr-x. 1 root root 652 Oct 10 2013 killall
-r-xr-xr-x. 1 root root 2134 Oct 30 2013 lvm2-lvmetad
-r-xr-xr-x. 1 root root 2665 Oct 30 2013 lvm2-monitor
-rwxr-xr-x. 1 root root 2571 Oct 11 2013 mdmonitor
-rwxr-xr-x. 1 root root 2200 Sep 7 2012 messagebus
-rwxr-xr-x. 1 root root 2989 Oct 10 2013 netconsole
-rwxr-xr-x. 1 root root 5428 Oct 10 2013 netfs
-rwxr-xr-x. 1 root root 6334 Oct 10 2013 network
-rwxr-xr-x. 1 root root 2205 Oct 23 2013 NetworkManager
-rwxr-xr-x. 1 root root 6364 Oct 10 2013 nfs
-rwxr-xr-x. 1 root root 3526 Oct 10 2013 nfslock
-rwxr-xr-x. 1 root root 1923 Jul 15 2013 ntpd
-rwxr-xr-x. 1 root root 2043 Jul 15 2013 ntpdate
-rwxr-xr-x. 1 root root 2261 Feb 25 2011 oddjobd
-rw-r--r-- 1 root root 1405 May 15 07:14 oracle
-rwxr-xr-x. 1 root root 2023 Feb 1 2012 portreserve
-rwxr-xr-x. 1 root root 3852 May 13 2011 postfix
-rwxr-xr-x. 1 root root 1556 Jul 10 2012 psacct
-rwxr-xr-x. 1 root root 2034 Jun 13 2013 quota_nld
-rwxr-xr-x. 1 root root 1513 Sep 17 2013 rdisc
-rwxr-xr-x. 1 root root 1822 Oct 15 2013 restorecond
-rwxr-xr-x. 1 root root 2898 Mar 20 2010 rhnsd
-rwxr-xr-x. 1 root root 1215 Oct 17 2013 rhsmcertd
-rwxr-xr-x. 1 root root 1808 Dec 3 2011 rngd
-rwxr-xr-x. 1 root root 2073 Oct 23 2012 rpcbind
-rwxr-xr-x. 1 root root 2518 Oct 10 2013 rpcgssd
-rwxr-xr-x. 1 root root 2305 Oct 10 2013 rpcidmapd
-rwxr-xr-x. 1 root root 2464 Oct 10 2013 rpcsvcgssd
-rwxr-xr-x. 1 root root 2011 Aug 15 2013 rsyslog
-rwxr-xr-x. 1 root root 1698 Oct 15 2013 sandbox
-rwxr-xr-x. 1 root root 2056 Nov 20 2012 saslauthd
-rwxr-xr-x. 1 root root 647 Oct 10 2013 single
-rwxr-xr-x. 1 root root 3002 Sep 26 2012 smartd
-rwxr-xr-x. 1 root root 2162 Sep 11 2013 snmpd
-rwxr-xr-x. 1 root root 1738 Sep 11 2013 snmptrapd
-rwxr-xr-x. 1 root root 2472 Sep 10 2013 spice-vdagentd
-rwxr-xr-x. 1 root root 4534 Sep 30 2013 sshd
-rwxr-xr-x. 1 root root 2712 Oct 23 2013 sssd
-rwxr-xr-x. 1 root root 1144 Sep 17 2013 sysstat
-rwxr-xr-x. 1 root root 2294 Oct 17 2013 udev-post
-rwxr-xr-x. 1 root root 40189 May 14 17:10 vmware-tools
-rwxr-xr-x. 1 root root 1674 Aug 24 2012 wdaemon
-rwxr-xr-x. 1 root root 1608 Oct 11 2013 winbind
-rwxr-xr-x. 1 root root 1866 Sep 7 2012 wpa_supplicant
-rwxr-xr-x. 1 root root 4799 Oct 10 2012 ypbind
[root@oracle init.d]# chmod +x oracle
[root@oracle init.d]# ls -l | grep oracle
-rwxr-xr-x 1 root root 1405 May 15 07:14 oracle
[root@oracle init.d]# chkconfig --level 2345 oracle on
[root@oracleinit.d]# ./oracle
Usage: oracle start|stop|restart|reload
[root@oracle init.d]# cd /etc/rc.d/rc5.d/
[root@oracle rc5.d]# ls -l | grep oracle
lrwxrwxrwx 1 root root 16 May 15 07:18 S99oracle -> ../init.d/oracle
[root@oracle rc5.d]# reboot
Broadcast message from root@oracle.kely.com
(/dev/pts/0) at 7:21 ...
The system is going down for reboot NOW!
[root@oracle ~]# su - oracle
[oracle@oracle ~]$ ps -efw | grep ora_
oracle 2056 1 0 07:21 ? 00:00:00 ora_pmon_orcl
oracle 2058 1 0 07:21 ? 00:00:00 ora_vktm_orcl
oracle 2062 1 0 07:21 ? 00:00:00 ora_gen0_orcl
oracle 2064 1 0 07:21 ? 00:00:00 ora_diag_orcl
oracle 2066 1 0 07:21 ? 00:00:00 ora_dbrm_orcl
oracle 2068 1 0 07:21 ? 00:00:00 ora_psp0_orcl
oracle 2070 1 0 07:21 ? 00:00:00 ora_dia0_orcl
oracle 2072 1 0 07:21 ? 00:00:00 ora_mman_orcl
oracle 2074 1 0 07:21 ? 00:00:00 ora_dbw0_orcl
oracle 2076 1 0 07:21 ? 00:00:00 ora_lgwr_orcl
oracle 2078 1 0 07:21 ? 00:00:00 ora_ckpt_orcl
oracle 2080 1 0 07:21 ? 00:00:00 ora_smon_orcl
oracle 2082 1 0 07:21 ? 00:00:00 ora_reco_orcl
oracle 2084 1 0 07:21 ? 00:00:00 ora_mmon_orcl
oracle 2086 1 0 07:21 ? 00:00:00 ora_mmnl_orcl
oracle 2088 1 0 07:21 ? 00:00:00 ora_d000_orcl
oracle 2090 1 0 07:21 ? 00:00:00 ora_s000_orcl
oracle 2133 1 0 07:21 ? 00:00:00 ora_p000_orcl
oracle 2135 1 0 07:21 ? 00:00:00 ora_p001_orcl
oracle 2137 1 0 07:22 ? 00:00:00 ora_qmnc_orcl
oracle 2666 1 0 07:22 ? 00:00:00 ora_cjq0_orcl
oracle 2728 1 0 07:22 ? 00:00:00 ora_q000_orcl
oracle 2730 1 0 07:22 ? 00:00:00 ora_q001_orcl
oracle 3742 1 1 07:26 ? 00:00:00 ora_j000_orcl
oracle 3744 1 0 07:26 ? 00:00:00 ora_j001_orcl
oracle 3759 3717 0 07:26 pts/0 00:00:00 grep ora_
[oracle@oracle ~]$lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-MAY-2014 07:26:33
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle.kely.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 15-MAY-2014 07:21:46
Uptime 0 days 0 hr. 4 min. 48 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oracle ~]$ ps -efw | grep LISTEN | grep -v grep
oracle 1940 1 0 07:21 ? 00:00:00 /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr LISTENER -inherit
安装oracle1628,基于RHEL 6.5安装Oracle 11g详细教程(7)——配置Oracle自启动相关推荐
- Deepin系统手动安装oracle jdk8详细教程
Deepin系统手动安装oracle jdk8详细教程 oracle官网下载jdk压缩包,使用 sudo tar -zxf jdk***解压文件,我放在在了home/diy/java/jdk路径下. ...
- oracle11系统安装,Windows系统下安装Oracle 11g R2教程,oracle11g
Windows系统下安装Oracle 11g R2教程,oracle11g Windows系统下安装Oracle 11g R2教程 Oracle 11g 共有两个大的版本,一个R1(Release 1 ...
- windows安装VMware最新版本(VMware Workstation 17.0 Pro)详细教程
专栏地址:嵌入式开发 专栏文章: [01]windows安装VMware最新版本(VMware Workstation 17.0 Pro)详细教程 [02]VMware17虚拟机安装Ubuntu最新版 ...
- Oracle存储过程详细教程
Oracle存储过程详细教程 点关注不迷路,欢迎再访! 精简博客内容,尽量已行业术语来分享. 努力做到对每一位认可自己的读者负责. 帮助别人的同时更是丰富自己的良机. 目录 Oracle存储过程详细教 ...
- Linux下安装Oracle 11g详细过程
需要安装Oracle DataGuard,所以先要安装单台Oracle11g,下面是Linux下单台Oracle11g的详细安装过程. 1,安装环境 硬件环境:2台linux虚拟机,CentOS6.4 ...
- 玩转oracle 11g(1):Oracle 11g的安装
由于工作需要,本人现在要对oracle 11g做一段攻坚战,先从安装开始 基本是傻瓜程序,网上也有大量教程 1 安装数据库软件 安装前准备工作 a.必须使用超级用户安装(adminstrator) b ...
- Oracle 11g 详细安装教程 Windows版
Oracle 11g安装步骤 一.Oracle 11g下载 二.Oracle 11g安装 Oracle 11g下载完成后,解压到一个空的文件夹,然后双击setup.exe文件,就可以开始安装Oracl ...
- centos 6.5 安装 oracle 11g,安装Centos6.5 安装Oracle 11g详细过程
CentOS6.5安装oracle 11G数据库详细过程安装环境 1台l inux虚拟机 CentOS6.564位系统,内存4G,CPU 2核磁盘50G Oracle软件版本l inux.x64 ...
- zabbix 安装 mysql_基于MySQL的zabbix安装及配置
环境准备工作. zabbix的安装需要LAMP(Linux.Apache.MySQL.PHP)环境 系统Centos7,主机地址:10.0.0.10 一.关闭SELinux和Firewalld 1.首 ...
最新文章
- java 动态切换_java-动态切换日志级别的3种方案
- 图片懒加载原理-实例二
- python辗转相除法求最大公约数的递归函数_Python基于辗转相除法求解最大公约数的方法示例...
- linux nat span端口镜像,SPAN端口镜像
- 用VC++实现console程序显示彩色文本
- 【转载】URL中的文本IPv6地址的格式RFC2732
- java 正则 惰性匹配_正则表达式 - 贪婪与非贪婪(惰性)
- qt通过http连接mysql_Qt如何利用MySQL连接远程数据库?
- AngularJs的基础——$http请求数据
- SSD 网络基本原理记录
- 谈google搜索引擎的使用
- cpu天梯图2022 cpu性能排行榜2022最新版
- 在Windows Server 2012中搭建WEB服务器,附ASP配置方法
- 关于PMI-PBA商业分析师,你想知道的都在这
- 华为云云享专家申请流程
- 集结Android开发里的各种大神
- VUE3-Cesium(视角操作、时钟设置)
- 前端程序调试方法总结--高级版
- 计算机网络串行传输 并行传输,串行传输和并行传输的概念
- Android 数字显示带E(科学计数法)
热门文章
- 我们为什么要读书?被这位日本女老师的回答深深震撼
- layui 表格组件中实现动态增加数据行的一种方式
- Javascript Window的属性
- angular2 上传图片
- position属性:绝对定位position: absolute;相对定位 position: relative;固定定位 position: fixed;
- 面向对象设计原则与23种设计模式
- WIN10系统下,安装可视化工具GraphViz
- JSP制作网页购物车
- 【SQL Performance】历史SQL监控(Historical SQL Monitoring ) 功能(12c)
- 文本数据可视化_非结构化文本数据的分析和可视化