打印本文 打印本文 关闭窗口 关闭窗口
RHEL AS 3 安装及启动 Oracle10g 指南
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2053  更新时间:2009/4/22 22:04:17  文章录入:mintao  责任编辑:mintao
ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.100)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                22-FEB-2006 10:24:03
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/dbse/network/admin/listener.ora
Listener Log File         /oracle/product/dbse/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.100)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully


4.2启动数据库
9i 之后已经没有 svrmgrl 了,所有的管理工作都通过 sqlplus 来完成:
$ sqlplus /nolog
SQL> connect system/change_on_install as sysdba
SQL> startup

出现如下显示,表示Oracle已经成功启动
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  1218968 bytes
Variable Size              88082024 bytes
Database Buffers          188743680 bytes
Redo Buffers                7168000 bytes
Database mounted.
Database opened.

4.3 自动启动与关闭

编辑 /etc/oratab ,把所有的 instance 的重启动标志设置成 ''''Y'''',如:
orcl:/oracle/product/dbse:Y

做一个启动脚本 /etc/init.d/dbora ,如下所示:

#!/bin/sh
# description: Oracle auto start-stop script.
# chkconfig: - 20 80
#
# 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=/oracle/product/dbse
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
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/dbstart
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl 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/lsnrctl stop"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
;;
''''restart'''')
$0 stop
$0 start
;;
esac

赋予执行权限
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也会随之启动/停止。

参考信息

http://www.dbanotes.net

上一页  [1] [2] 

打印本文 打印本文 关闭窗口 关闭窗口