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

php中文网
发布: 2016-06-07 17:00:54
原创
1608人浏览过

为了节省系统资源本打算平时只启实例yznc,需要时才启动zycw。可每次系统重启后系统会自动重启实例zycw,rc.d下没有找到任何自动

一个关于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的这种自启动方式:

发卡宝-卡密寄售系统
发卡宝-卡密寄售系统

发卡宝是一个专业的软件卡密等虚拟商品在线交易平台,拥有多种兑换方式,费率低,结算快,正规企业平台一直稳定运营,24小时不间断提供自动发卡服务。【模板说明】试用版自带一套模板(响应式)【环境支持】PHP环境 / 200M或以上空间大小 / 开启父路径 / 设置index.php为默认首页 / 目录写入权限需要开启【数据库】MySQL【安装步骤】将文件上传至空间目录,运行“http://域名/inst

发卡宝-卡密寄售系统 1
查看详情 发卡宝-卡密寄售系统

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.

linux

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号