手动启动oracle数据库连接,每次启动机器都要手动打开数据库

Oracle 自动启动脚本的编写

http://puber.itpub.net/post/3120/17603

在Linux RedHat AS 3.0 Update5上安装完Oracle 9i后,发现当主机重新启动后,Oralce不能自动重新启动,而且监听程序和Oracle Web Server都不能自动启动,按照下面的方法进行了设置,能够达到自动启动Oracle数据库以及监听程序和Web Server的效果。

1. 在文件/etc/oratab中添加

# 添加如下内容到/etc/oratab文件中,

# $ORACLE_SID是你的Oracle数据库的sid

# $ORACLE_HOME是你的Oracle数据库的Oracle_home

# Y表示要求在系统启动的时候启动Oracle数据库.N表示不要在系统启动的时候启动Oracle

*:/rdb/product:N

$ORACLE_SID:$ORACLE_HOME:Y

2. 修改文件/etc/rc.local添加一下两行

## 关于su的具体命令参看linux的manual文档

## dbstart: 启动Oracle数据库

## lsnrctl: 启动Oracle数据库监听程序

## $ORACLE_HOME/Apache/Apache/bin/startJServ.sh: 启动Oracle Web Server 7777端口

su - oracle -c 'dbstart'

su - oracle -c 'lsnrctl start'

su - oracle -c '$ORACLE_HOME/Apache/Apache/bin/startJServ.sh'

3. 在本机使用dbstart,和dbshut测试设置是否准确.

[oracle@tzcenter oracle]$ dbshut

SQL*Plus: Release 9.2.0.4.0 - Production on Thu Nov 11 21:02:35 2004 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> Connected.

SQL> Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production

Database "webora9" shut down.

[oracle@tzcenter oracle]$ dbstart

SQL*Plus: Release 9.2.0.4.0 - Production on Thu Nov 11 21:02:43 2004 Copyright (c) 1982, 2002, Oracle Corporation.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值