1,更改配置如下内容:
bash-3.00# more /var/opt/oracle/oratab --linux 在/etc/oratab
#
# 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.
#
#
target:/orainstall/oracle/product/10.2.0/db_1:Y
2,以oracle用户vi 下列文件相关内容
分两部分:
$ORACLE_HOME/bin/dbstart
ORATAB变量为/var/opt/oracle/oratab
ORACLE_HOME_LISTNER变量为$ORACLE_HOME
$ORACLE_HOME/bin/dbshut
同上相关变量(同dbstart)
3,以root用户编辑如下内容
vi /etc/init.d/dbstart 和dbshut
bash-3.00# more /etc/init.d/dbstart
su - oracle -c "/orainstall/oracle/product/10.2.0/db_1/bin/dbstart"
su - oracle -c "/orainstall/oracle/product/10.2.0/db_1/bin/lsnrctl start"
bash-3.00# more /etc/init.d/dbshut
su - oracle -c "/orainstall/oracle/product/10.2.0/db_1/bin/dbshut"
su - oracle -c "/orainstall/oracle/product/10.2.0/db_1/bin/lsnrctl stop"
4,以root用户给第3步创建的文件授权
chmod 755 /etc/init.d/db*
5,到相应的os初始化脚本目录下(启与关os),进行ln操作
cd /etc/rc2.d ---启动os
ln -s /etc/init.d/dbstart S99oracle
cd /etc/rc0.d ---关闭os
ln -s /etc/init.d/dbshut K01oracle
bash-3.00# more /etc/rc2.d/S99oracle
su - oracle -c "/orainstall/oracle/product/10.2.0/db_1/bin/dbstart"
su - oracle -c "/orainstall/oracle/product/10.2.0/db_1/bin/lsnrctl start"
bash-3.00# more /etc/rc0.d/K01oracle
su - oracle -c "/orainstall/oracle/product/10.2.0/db_1/bin/dbshut"
su - oracle -c "/orainstall/oracle/product/10.2.0/db_1/bin/lsnrctl start"
小结:
1,oracle与os结合相当紧密,要加深对于os的理解,/etc/init.d与/etc/rcx.d的作用与区别
2,学习下dbshut and dbstart的shell
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-621052/
,如需转载,请注明出处,否则将追究法律责任。