Start Oracle server when system boot
来源:互联网 发布:淘宝店名字 编辑:程序博客网 时间:2024/06/02 05:32
1. 生成脚本/etc/init.d/dbora
#/bin/sh
#chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
#chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/usr/oracle/db10g
ORA_OWNER=oracle
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
#su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl start"
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
#su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl start"
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
#su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
;;
esac
2. 配置服务
赋予执行权限
chmod 750 /etc/init.d/dbora
作成以下链接:
ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
执行以下命令:
chkconfig --level 345 dbora on
这样就OK了。下次开关机的时候,Oracle也会随之启动/停止。
3. 修改/etc/oratab
4. Issues
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
#su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
;;
esac
2. 配置服务
赋予执行权限
chmod 750 /etc/init.d/dbora
作成以下链接:
ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
执行以下命令:
chkconfig --level 345 dbora on
这样就OK了。下次开关机的时候,Oracle也会随之启动/停止。
3. 修改/etc/oratab
/***********************************************
/* /etc/oratab
/***********************************************
/etc/oratab:
orcl:/usr/work/oracle/10.2.0/db_1:Y
Note: run dbstart to start up the oracle instance if above database set to "Y"
4. Issues
Question: dbstart problem: "Failed to auto-start Oracle Net Listener using /ade/vikrKuma_new/oracle/bin/tnslsnr". This problem usually happend when DHCP is used.
Fix:
Edit file $ORACLe_HOME/bin/dbstart
In line 78, replace the line with:
"ORACLE_HOME_LISTNER=$ORACLE_HOME"
- Start Oracle server when system boot
- WebLogic - Managed Server failed to start when started from console.
- Local operating system boot fails when external storage is attached - IBM BladeCenter and System x
- when you start Windows 7: "The Windows Boot Configuration Data file is missing required information"
- Start a VNC Server on Ubuntu on Boot
- Vino& VNC server auto start after Ubuntu boot up
- 第二章Getting Start with the Oracle Server(oracle入门)
- oracle when
- CPU Usage Spiking When Start DBMS On Oracle Linux 6 (Doc ID 1995167.1)
- SQL Server和Oracle中case when then 的用法及when like 的使用
- Enlarge Gvim When Start Up
- when reduce jobs start up?
- 1182566 - Error: "RUN-050406 Bad system" when you try to run jobs on the server
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrato
- An error occurred on the server when processing the URL. Please contact the system administrator.
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrato
- An error occurred on the server when processing the URL. Please contact the system administrator
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrato
- 计算机类核心期刊投稿指南
- Access 的参数查询(Parameter Query) (二)
- 关于PropertyGrid的使用以及控件编写(转载微软的一片文章)
- 小彭语录 2008-02-29
- 安全技术的困惑与趋势:主动防御路漫漫
- Start Oracle server when system boot
- 三大检索系统(SCI、EI、 ISTP)投稿指南
- 还是不太明白:OleDb、ODBC、ADO、ADO.net等
- 机器狗木马源文件
- test
- 什么是 DLL
- C#连接MySql中文乱码的解决方案
- 探索动态程序集
- 给官员和本地富人准备的经济适用房