Oracle 自动启动脚本的编写
2006-10-25 14:07
441 查看
Oracle 自动启动脚本的编写
在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
$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. All rights reserved.
SQL> Connected to an idle instance.
SQL> ORACLE instance started.
Total System Global Area 437327188 bytes
Fixed Size 451924 bytes
Variable Size 134217728 bytes
Database Buffers 301989888 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
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" warm started.
[oracle@tzcenter oracle]$
注意:dbstart 脚本里面用的是 pfile 来启动数据库的,所以需要连接到数据库产生pfile文件,才能直接使用dbstart命令启动并连接数据库,具体方法:
[oracle@tzcenter oracle]$ sqlplus '/ as sysdba'
SQL*Plus: Release 9.2.0.4.0 - Production on Thu Nov 11 21:02:43 2004 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL>connect internal/oracle
SQL>create pfile from spfile
[oracle@tzcenter oracle]$
相关文章推荐
- oracle 10g 随linux系统自动启动的设置脚本
- oracle数据库自动启动脚本
- Linux下oracle自动启动脚本
- linux自动启动 oracle脚本
- 设置oracle自动启动与关闭脚本
- Linux下,Oracle自动启动,停止脚本 (转载)
- 自动启动ORACLE脚本
- Oracle的自动启动脚本
- Linux crontab的使用方式,sh脚本的编写,sh脚本自动启动tomcat服务器,sh监控系统运行情况
- 编写可以监控oracle监听器是否启动的shell脚本
- 自动启动和关闭Oracle 脚本
- Linux下Oracle自动启动、停止脚本
- linux手动或者自动启动oracle11g的服务 Oracle 自动启动脚本
- Linux下编写 jar包自动启动脚本
- oracle 11.2.0.3 设置启动脚本使ORACLE自动启动
- 在linux oracle 10g/11g x64bit环境中,goldengate随os启动而自动启动的脚本
- 编写批处理脚本启动和关闭Oracle
- 自己编写了Oracle EBS程序自动移植脚本
- linux 自己编写脚本,开机自动启动
- ORACLE自动启动脚本