linux下单实例数据库开机自启动设置

1、修改/oratab

root@org54 ~]# vi/etc/oratab --把N改为Y,如下提示

# This file is used by ORACLEutilities. It is created by root.sh

# and updated by the Database ConfigurationAssistant when creating

# a database.

# A colon, ':', is used as the fieldterminator. A new line terminates

# the entry. Lines beginning with a pound sign, '#', arecomments.

#

# Entries are of the form:

# $ORACLE_SID:$ORACLE_HOME:<N|Y>:

#

# The first and second fields are thesystem identifier and home

# directory of the databaserespectively. The third filed indicates

# to the dbstart utility that the databaseshould , "Y", or should not,

# "N", be brought up at systemboot time.

#

# Multiple entries with the same$ORACLE_SID are not allowed.

#

#

#game:/u01/app/oracle/product/10.2.0/db_1:N --dbca创建库时注册的默认信息

--格式:$ORACLE_SID:$ORACLE_HOME:<N|Y>

--<N|Y>选项代表开机是否自启动

instance_name:/u01/app/oracle/product/10.2.0/db_1:Y



2.编辑/dbstart
 

[oracle@org54 bin]$ cd$ORACLE_HOME/bin

[oracle@org54 bin]$ ls-ll |grep dbstart

-rwxr-xr-x 1 oracle oinstall 10415 Jan 1 2000 dbstart

[oracle@org54 bin]$ vi dbstart

--dbstart为开机自启动脚本,让系统开机就去执行dbstart脚本文件,它会去读oratab文件,读到Y就会把对应的实例开机自启动

找到并修改ORACLE_HOME_LISTNER=$ORACLE_HOME根据设置的监听调整路径

3.编辑/rc.d/rc.local

[root@org54 ~]# vi/etc/rc.d/rc.local --添加如下两行信息,启动实例、启动监听

#!/bin/sh

#

# This script will be executed *after* allthe other init scripts.

# You can put your own initialization stuffin here if you don't

# want to do the full Sys V style initstuff.

touch /var/lock/subsys/local

modprobe hangcheck-timer hangcheck_tick=30hangcheck_margin=180

su - oracle  -c " /u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"

su - oracle  -c " /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"

4.重启验证一下
 
 #reboot

小结:

linux下设置实例自启动有关脚本:

oratab:实例是否自启动的注册信息

dbstart:开机启动脚本文件会读取oratab信息

rc.local:开机后立即要做的文件


 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25116248/viewspace-1797173/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25116248/viewspace-1797173/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值