1、root用户下修改/etc/oratab文件:将ora9idb:/u01/app/oracle/product/9.2.0/db_1:N改为ora9idb:/u01/app/oracle/product/9.2.0/db_1:Y

ora9idb:/u01/app/oracle/product/9.2.0/db_1:Y

view code

2、oracle用户下执行dbstart(执行之前最好先将数据库shutdown immediate)

执行dbstart启动数据库数据库可能无法启动,报告Can’t find init file …的错误,如果没有报错,直接启动成功也有可能(oracle 高版本11g是这样的,10g还没有实验;9i肯定会失败).

解决办法:

需要复制一个初始化文件:  cp /opt/oracle/admin/gedb/pfile/init.ora.* /opt/oracle/product/9.2.0/dbs/initgedb.ora(具体要看环境变量设置)

实际上就是在执行:cp $ORACLE_BASE/admin/$ORACLE_SID/pfile/init.ora.*  $ORACLE_HOME/dbs/init$ORACLE_SID.ora.

cp完成后,再次执行dbstart就可以了.

3、截止到第2步骤,是在手工操作启动数据库.假如需要在操作系统时,自动启动数据库监听及数据库,还需要做一点操作:

root身份登陆,在/etc/rc.d/rc.local文件末尾添加两行命令即可:

su - oracle -c "lsnrctl start"
su - oracle -c "dbstart"

然后,reboot你的os,测试一下是否启动成功!

dbstart无法启动

执行dbstart时报错

gtone-> dbstart
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /u01/app/oracle/product/11.2.0/db_1/bin/dbstart ORACLE_HOME
Processing Database instance "CQRCB": log file /u01/app/oracle/product/11.2.0/db_1/startup.log
gtone-> 

解决办法

gtone-> cp /u01/app/oracle/product/11.2.0/db_1/bin/dbstart //u01/app/oracle/product/11.2.0/db_1/bin/dbstart.bak
gtone-> ll
total 20
-rw-r----- 1 oracle oinstall 16549 Jan  5 13:10 CreateDatabase-summary.html
gtone-> vi /u01/app/oracle/product/11.2.0/db_1/bin/dbstart
#!/bin/sh
#
# $Id: dbstart.sh /st_buildtools_11.2.0/1 2013/01/24 16:20:35 tmagana Exp $
# Copyright (c) 1991, 2013, Oracle and/or its affiliates. All rights reserved.
####################################
#
# usage: dbstart $ORACLE_HOME
#
# This script is used to start ORACLE from /etc/rc(.local).
# It should ONLY be executed as part of the system boot procedure.
#
# This script will start all databases listed in the oratab file
# whose third field is a "Y".  If the third field is set to "Y" and
# there is no ORACLE_SID for an entry (the first field is a *),
# then this script will ignore that entry.
#
# This script requires that ASM ORACLE_SID's start with a +, and
# that non-ASM instance ORACLE_SID's do not start with a +.
#
# If ASM instances are to be started with this script, it cannot
# be used inside an rc*.d directory, and should be invoked from
# rc.local only. Otherwise, the CSS service may not be available
# yet, and this script will block init from completing the boot
# cycle.
#
# If you want dbstart to auto-start a single-instance database that uses
# an ASM server that is auto-started by CRS (this is the default behavior
# for an ASM cluster), you must change the database's ORATAB entry to use
# a third field of "W" and the ASM's ORATAB entry to use a third field of "N".
# These values specify that dbstart auto-starts the database only after
# the ASM instance is up and running.
#
# Note:
# Use ORACLE_TRACE=T for tracing this script.
#
# The progress log for each instance bringup plus Error and Warning message[s]
# are logged in file $ORACLE_HOME/startup.log. The error messages related to
# instance bringup are also logged to syslog (system log module).
# The Listener log is located at $ORACLE_HOME_LISTNER/listener.log
#
# On all UNIX platforms except SOLARIS
# ORATAB=/etc/oratab
#
# To configure, update ORATAB with Instances that need to be started up
#    Entries are of the form:
#    $ORACLE_SID:$ORACLE_HOME:<N|Y|W>:
#    An example entry:
#    main:/usr/lib/oracle/emagent_10g:Y
#
# Overall algorithm:
# 1) Bring up all ASM instances with 'Y' entry in status field in oratab entry
# 2) Bring up all Database instances with 'Y' entry in status field in
#    oratab entry
# 3) If there are Database instances with 'W' entry in status field
#    then
#      iterate over all ASM instances (irrespective of 'Y' or 'N') AND
#      wait for all of them to be started
#    fi
# 4) Bring up all Database instances with 'W' entry in status field in
#    oratab entry
#
#####################################LOGMSG="logger -puser.alert -s "trap 'exit' 1 2 3# for script tracing
case $ORACLE_TRACE inT) set -x ;;
esac# Set path if path not set (if called from /etc/rc)
SAVE_PATH=/bin:/usr/bin:/etc:${PATH} ; export PATH
SAVE_LLP=$LD_LIBRARY_PATH# First argument is used to bring up Oracle Net Listener
# ORACLE_HOME_LISTNER=$1
ORACLE_HOME_LISTNER=$ORACLE_HOME (将$1替换成$ORACLE_HOME)
if [ ! $ORACLE_HOME_LISTNER ] ; thenecho "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"echo "Usage: $0 ORACLE_HOME"
elseLOG=$ORACLE_HOME_LISTNER/listener.log# Set the ORACLE_HOME for the Oracle Net Listener, it gets reset to# a different ORACLE_HOME for each entry in the oratab.ORACLE_HOME=$ORACLE_HOME_LISTNER ; export ORACLE_HOME                                                       

再次验证dbstart命令

gtone-> dbstart
Processing Database instance "CQRCB": log file /u01/app/oracle/product/11.2.0/db_1/startup.log

转载于:https://www.cnblogs.com/arcer/p/3216920.html

oracle开机自启动、监听自启动设置相关推荐

  1. oracle开机启动监听,如何让oracle DB、监听和oem开机启动(dbstart)

    让oracle DB.监听和oem开机启动(dbstart) Oracle提供了伴随操作系统自动重启的功能,在Windows中,可以修改"我的电脑-->管理-->服务--> ...

  2. oracle开机启动监听,配置Oracle数据库和监听随Linux系统自启动

    在某些情况下需要在Linux操作系统上提供一种无人值守的随机启动Oracle的功能,目的也许仅仅是为了帮助那些对Oracle细节非常不关心的朋友.当然,如果有可能,一定不要使用这种自动化的方法,因为有 ...

  3. linux下oracle数据库服务和监听的启动停止

    oracle数据库是重量级的,其管理非常复杂,将其在linux平台上的启动和关闭步骤整理一下. 安装完毕oracle以后,需要创建oracle系统用户,并在/home/oracle下面的.bash_p ...

  4. aix oracle监听配置_LINUX系统下Oracle修改默认监听端口号操作

    各位头条的朋友们大家好,打算在今后的一段时间为大家分享一批与云计算相关的干货运维技术指南,相信这些操作手册类的文章一定会给大家一些实际的帮助,提升IT技能的@.@大家都知道ORACLE的默认监听端口号 ...

  5. linux 下停止监听程序,Linux下启动Oracle服务和监听程序步骤

    Linux下启动Oracle服务和监听程序启动和关闭步骤整理如下: 1.安装oracle: 2.创建oracle系统用户: 3./home/oracle下面的.bash_profile添加几个环境变量 ...

  6. oracle 数据库起监听,oracle启动数据库监听

    linux/Aix启动.关闭Oracle及监听 Aix环境下管理Oracle 1.Aix下查看.启动数据库监听器 以oracle用户执行以下命令: ① lsnrctl status //-查看监听器状 ...

  7. oracle 启动 linux监听,Linux下启动Oracle服务和监听程序

    $ su – oracle $ sqlplus / nolog sql> conn / as sysdba sql> startup                 #启动Oracle,需 ...

  8. windows下重启oracle服务及监听

    C:\Users\Administrator>sqlplus sys/pwd as sysdba; --重启oracle SQL>shutdown immediate; SQL>st ...

  9. oracle rac 通信端口,修改oracle 10g rac监听端口号为1523的步骤

    修改oracle  10g rac监听端口号为1523的步骤 一. 修改listener.ora ,将其中的1521改为1523.事先做该文件的备份,以便快速复原 二. 修改tnsnames.ora ...

  10. oracle监听 客户 实例,oracle 数据库实例 监听

    创建Oracle数据库.数据库名与实例名与SID之间的关系(图文详解) 目录 目录 软件环境 前言 安装Oracle监听程序 启动停止监听程序 创建数据库 数据库名db_name 数据库实例名inst ...

最新文章

  1. 【原创】开源Math.NET基础数学类库使用(06)直接求解线性方程组
  2. data类型的Url格式及Base64编码:把小数据直接嵌入到Url中
  3. Mac 10.12为打开终端增加快捷键(转)
  4. Android 用MediaCodec ,MediaExtractor解码播放MP4文件
  5. aspiration定义_志愿者的定义、理念与精神核心
  6. VBA 打开 Debug窗口 进行调试 (同时可以查看debug操作对应的快捷键)
  7. 蚂蚁金服服务器系统,蚂蚁金服轻量级监控分析系统 SOFALookout 服务端开源
  8. matlab gui 数据处理,基于MATLAB GUI的数据处理分析界面的设计与应用
  9. 将动态IP切换为静态
  10. Exp4 恶意代码分析 20154328 常城
  11. html5新浪微博代码,JS实现的新浪微博大厅文字内容滚动效果代码
  12. 理解Linux的平均负载和性能监控
  13. Ubuntu-修改图片分辨率
  14. 仪器计量校准机构的CNAS和CMA有哪些区别?分别具有什么作用?
  15. Lipschitz 条件或者Lipschitz连续
  16. IDEA vs VSCode在java开发上的横向对比
  17. 阿里云ECS静态建站学习
  18. 力扣编程题-解法汇总
  19. 地图的出图设置和经纬网的调整(基础篇)
  20. 解决shiro重定向URL中出现sessionID的情况localhost:8080/toLogin;jsessionid=D5C1EE61B97EE2D7098F58A837B82BD4

热门文章

  1. 内存越界并不等于马上出错
  2. 错误及原因推测:sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S: 没有那个文件或目录
  3. 建议电脑电源标准逐步去掉-12V、3.3V
  4. python turtle代码示例-Python turtle.left方法代码示例
  5. Arduion 底层原理之 Uart函数 串口收发 串口协议解析
  6. c++ 编程规范技巧
  7. c++ 11 之lambda
  8. visual studio怎么让button一直生效_民用建设工程设计合同怎么生效
  9. go语言查询某个值是否在数组中_一日一技:在 Golang 中如何快速判断字符串是否在一个数组中...
  10. C++内存详解[精]