当前位置:  数据库>oracle

AIX下Oracle数据库自动重启设置

    来源: 互联网  发布时间:2017-04-02

    本文导语: 一个关于Oracle数据库的有趣问题: 中远公司在没加磁盘阵列前建了一个oracle实例zycw,加磁盘阵列后新建了一个实例zync。 为了节省系统资源本打算平时只启实例yznc,需要时才启动zycw。可每次系统重启后系统会自动重启实例zycw...

一个关于Oracle数据库的有趣问题:

中远公司在没加磁盘阵列前建了一个oracle实例zycw,加磁盘阵列后新建了一个实例zync。

为了节省系统资源本打算平时只启实例yznc,需要时才启动zycw。可每次系统重启后系统会自动重启实例zycw,rc.d下没有找到任何自动重启数据库的脚本,ORACL_HOME/network/admin下也没有listener.ora文件(系统自启动时listener服务时是读取何处的参数文件还未搞清楚)。

后来才找到系统通过在inittab文件中加入一行startdb:2345678:wait:/etc/rc.startdb调用/etc/rc.startdb启动oracle的。下面详细介绍一下Oracle的这种自启动方式:

1、 编辑修改 /etc/oratab文件将要启动的实例后面的字符改成Y。 文本样例:
#
# 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::
#
# 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.
##
*:/home/oracle:N
# *:/u2/oracle/product/9.2.0.2.0:N
zycw:/u2/oracle/product/9.2.0.2.0:N
*:/u2/oracle/product/9.2.0.2.0:N
zync:/u2/oracle/product/9.2.0.2.0:Y
#
2、 配置启动文件: 在/etc下建立文件rc.startdb,脚本如下:(这里是直接调用oracle系统自带的启动脚本,也可自己编写启动脚本)
su - oracle "-c /u2/oracle/product/9.2.0.2.0/bin/dbstart"
3、 下面要把启动信息放到/etc/inittab中,加入一行 startdb:2345678:wait:/etc/rc.startdb ,文本样例:
: @(#)49 1.28.2.9 src/bos/etc/inittab/inittab, cmdoper, bos520 8/23/00 19:50:13
: IBM_PROLOG_BEGIN_TAG
: This is an automatically generated prolog.
:
: bos520 src/bos/etc/inittab/inittab 1.28.2.9
:
: Licensed Materials - Property of IBM
:
: (C) COPYRIGHT International Business Machines Corp. 1989,1993
: All Rights Reserved
:
: US Government Users Restricted Rights - Use, duplication or
: disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
:
: IBM_PROLOG_END_TAG
:
: COMPONENT_NAME: CMDOPER
:
: ORIGINS: 3, 27
:
: (C) COPYRIGHT International Business Machines Corp. 1989, 1993
: All Rights Reserved
: Licensed Materials - Property of IBM
:
: US Government Users Restricted Rights - Use, duplication or
: disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
:
: Note - initdefault and sysinit should be the first and second entry.
:
init:2:initdefault:
brc::sysinit:/sbin/rc.boot 3 >/dev/console 2>&1 # Phase 3 of system boot
powerfail::powerfail:/etc/rc.powerfail 2>&1 | alog -tboot > /dev/console # Power Failure Detection
mkatmpvc:2:once:/usr/sbin/mkatmpvc >/dev/console 2>&1
atmsvcd:2:once:/usr/sbin/atmsvcd >/dev/console 2>&1
load64bit:2:wait:/etc/methods/cfg64 >/dev/console 2>&1 # Enable 64-bit execs
tunables:23456789:wait:/usr/sbin/tunrestore -R > /dev/console 2>&1 # Set tunables
rc:23456789:wait:/etc/rc 2>&1 | alog -tboot > /dev/console # Multi-User checks
fbcheck:23456789:wait:/usr/sbin/fbcheck 2>&1 | alog -tboot > /dev/console # run /etc/firstboot
srcmstr:23456789:respawn:/usr/sbin/srcmstr # System Resource Controller
rctcpip:23456789:wait:/etc/rc.tcpip > /dev/console 2>&1 # Start TCP/IP daemons
sniinst:2:wait:/var/adm/sni/sniprei > /dev/console 2>&1
rcnfs:23456789:wait:/etc/rc.nfs > /dev/console 2>&1 # Start NFS Daemons
cron:23456789:respawn:/usr/sbin/cron
piobe:2:wait:/usr/lib/lpd/pio/etc/pioinit >/dev/null 2>&1 # pb cleanup
qdaemon:23456789:wait:/usr/bin/startsrc -sqdaemon
writesrv:23456789:wait:/usr/bin/startsrc -swritesrv
uprintfd:23456789:respawn:/usr/sbin/uprintfd
shdaemon:2:off:/usr/sbin/shdaemon >/dev/console 2>&1 # High availability daemon
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
l7:7:wait:/etc/rc.d/rc 7
l8:8:wait:/etc/rc.d/rc 8
l9:9:wait:/etc/rc.d/rc 9
naudio::boot:/usr/sbin/naudio > /dev/null
logsymp:2:once:/usr/lib/ras/logsymptom # for system dumps
diagd:2:once:/usr/lpp/diagnostics/bin/diagd >/dev/console 2>&1
ctrmc:2:once:/usr/bin/startsrc -s ctrmc > /dev/console 2>&1
dt:2:wait:/etc/rc.dt
cons:0123456789:respawn:/usr/sbin/getty /dev/console
ha_star:h2:once:/etc/rc.ha_star >/dev/console 2>&1
ntbl_reset:2:once:/usr/bin/ntbl_reset_datafiles
rcml:2:once:/usr/sni/aix52/rc.ml > /dev/console 2>&1
tty0:2:off:/usr/sbin/getty /dev/tty0
tty1:2:off:/usr/sbin/getty /dev/tty1
tty2:2:off:/usr/sbin/getty /dev/tty2
startdb:2345678:wait:/etc/rc.startdb






























































































AIX下oracle数据库重启设置的资料文档:
Automating Database Startup for AIX (Optional)

Oracle Corporation recommends that you configure your system to automatically
start Oracle databases when your system starts up, and to shut down Oracle
databases when your system shuts down. Automatic database startup and
shutdown protects against improper shutdown of the database.
Automating Database Startup
Perform the following tasks to set up the dbstart and dbshut scripts so that they
are called at system startup. This process must be completed for every new
database that you want to configure for automated startup:
1. Edit the /etc/oratab file.
Configuration Tasks to Perform as the root User
Database entries in the oratab file appears in the following format:
ORACLE_SID:ORACLE_HOME:{Y|N}
In the preceding command, Y or N specifies whether you want the dbstart
and dbshut scripts to start up and shut down the database.
For Oracle Real Application Clusters installation, this entry appears in the
following format:
DB_NAME:ORACLE_HOME:{Y|N}
In the preceding command, DB_NAME is the cluster database name. Y or N
specifies whether you want the dbstart and dbshut scripts to start up and
shut down the database.
2. For each database that you want to start up, find the ORACLE_SID entry
identified by the sid in the first field. Change the last field for each to Y.
3. Add the dbstart script to the /etc/inittab file:
# mkitab "oradb:2:wait:/bin/su oradb -c|/$ORACLE_HOMES/bin/dbstart"
In the preceding command, oradb is the identifier of the oracle user for
which you want to start the database.

























    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 公告:CSDN AIX论坛有奖话题讨论活动(八)——本期话题:除了数据库应用,还有哪些应用也可以运行于AIX系统之上?(和Linux系统相比较,性能更优)
  • Oracle10g在AIX上的安装准备工作《Oracle大型数据库系统在AIX/unix上的实战详解》 集中答疑 40
  • AIX 5.3下调用windows 2000上的exe程序,且AIX下需要得到windows下程序执行的返回结果
  • IBM AIX可以用其他的unix 或者 lunix代替吗? iis7站长之家
  • 公告:CSDN AIX论坛有奖话题讨论活动(七)——本期话题:在海量运算方面,和Linux系统相比,AIX系统有优势吗?
  • 哪里可以下载AIX操作系统?
  • 公告:CSDN AIX论坛有奖话题讨论活动(四)——本期话题:从开发周期上来看,和HP-UX、Solaris相比,AIX系统有优势吗?
  • AIX共享内存分配问题
  • 求GCC for AIX5.3
  • aix上编译问题
  • linux -> aix 发展
  • 公告:CSDN AIX论坛有奖话题讨论活动(六)——本期话题:AIX的动态工作负载分区和Hypervisor的逻辑分区相比,有何优劣?
  • 有关 AIX 编程兼容性方面的疑问
  • aix问题求教--愿给200分!!!
  • 关于AIX的进程间通讯的方法
  • window 向aix 的移植问题----在线等待
  • 普通pc机,可否装aix操作系统?
  • 有谁在AIX下装过下载版的websphere
  • IBM AIX可以用其他的unix 或者 lunix代替吗?
  • 请问AIX下用什么命令能够获取CPU型号、频率信息,多CPU情况下
  • 在AIX(4.3)系统上如何查看内存情况
  • 请教一个AIX下内存分配的问题


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3