VM虚拟机下在LINUX上安装ORACLE 11G单实例数据库(三)

2014-11-24 09:08:59 · 作者: · 浏览: 4
92.168.1.212:1521/bys001
3.正常情况下数据库实例未启动,此时用SYS登陆,启动数据库,看数据库能否启动
4.实现开机ORACLE自动启动监听和实例
第一步:修改/etc/oratab文件,命令如下:
格式如下:
--------------------------------------------------------------------------------
SID:ORACLE_HOME:AUTO
--------------------------------------------------------------------------------
[oracle@oracle11g ~]$ vi /etc/oratab
添加或修改成(默认好像是N)这一句:
bys001:/u01/app/oracle/product/11.2.0/dbhome_1/:Y
[root@oel-01 ~]# cat /etc/oratab
bys001:/u01/app/oracle/product/11.2.0/dbhome_1:Y
第二步:把lsnrctl start和dbstart添加到rc.local文件中,命令如下:
[oracle@oracle11g ~]$ vi /etc/rc.d/rc.local
添加如下内容:
su oracle -lc"/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"
su oracle -lc"/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"
[root@oel-01 ~]# cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* allthe other init scripts.
# You can put your own initialization stuffin here if you don't
# want to do the full Sys V style initstuff.
touch /var/lock/subsys/local
su oracle -lc"/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"
su oracle -lc "/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"
第三步,重启后直接用SQLPLUS登陆测试数据库是否已经打开哈哈。