你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux 下Oracle 开机自启动 与 oratab, dbstart 脚本 说明

[日期:2012-04-14] 来源:Linux社区  作者:tianlesoftware [字体:大 中 小]

三.DB 开机自启动示例

3.1 修改/etc/oratab的值为Y

gg1:/u01/app/Oracle/product/11.2.0.3/db_1/bin>ll /etc/oratab

-rw-rw-r-- 1 oracle oinstall 722 Jan 3020:36 /etc/oratab

gg1:/u01/app/oracle/product/11.2.0.3/db_1/bin>cat /etc/oratab

#

gg1:/u01/app/oracle/product/11.2.0.3/db_1:Y

 

3.2 修改dbstart的ORACLE_HOME_LISTNER,使其指向$ORACLE_HOME:

# First argument is used to bring up OracleNet Listener

ORACLE_HOME_LISTNER=$ORACLE_HOME

 

3.3  用root用户在rc.local里添加如下内容:

 

[root@gg1 ~]# cat /etc/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 -c"/u01/app/oracle/product/11.2.0.3/db_1/bin/dbstart"

su - oracle -c"/u01/app/oracle/product/11.2.0.3/db_1/bin/emctl start dbconsole"

 

这里注意必须用oracle 用户来启动脚本。

 

3.4 reboot 系统,Oracle就自动启动了。

 

在我们的配置中,启动的包括监听,实例和OEM。

 

启动日志如下:

gg1:/u01/app/oracle/product/11.2.0.3/db_1>cat startup.log

 

/u01/app/oracle/product/11.2.0.3/db_1/bin/dbstart:Starting up database "gg1"

Mon Jan 30 20:48:26 CST 2012

 

 

SQL*Plus: Release 11.2.0.3.0 Production onMon Jan 30 20:48:31 2012

 

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

 

SQL> Connected to an idle instance.

SQL> ORACLE instance started.

 

Total System Global Area  939495424 bytes

Fixed Size                  2233960 bytes

Variable Size             675285400 bytes

Database Buffers          255852544 bytes

Redo Buffers                6123520 bytes

Database mounted.

Database opened.

SQL> Disconnected from Oracle Database11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining andReal Application Testing options

 

/u01/app/oracle/product/11.2.0.3/db_1/bin/dbstart:Database instance "gg1" warm started.

 

 

gg1:/u01/app/oracle/product/11.2.0.3/db_1>cat listener.log

/u01/app/oracle/product/11.2.0.3/db_1/bin/dbstart:Starting Oracle Net Listener

 

LSNRCTL for Linux: Version 11.2.0.3.0 -Production on 30-JAN-2012 21:24:37

 

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

 

Starting /u01/app/oracle/product/11.2.0.3/db_1/bin/tnslsnr:please wait...

 

TNSLSNR for Linux: Version 11.2.0.3.0 -Production

System parameter file is/u01/app/oracle/product/11.2.0.3/db_1/network/admin/listener.ora

Log messages written to/u01/app/oracle/diag/tnslsnr/gg1/listener/alert/log.xml

Listening on:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gg1)(PORT=1521)))

Listening on:(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

 

Connecting to(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=gg1)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version11.2.0.3.0 - Production

Start Date                30-JAN-2012 21:24:40

Uptime                    0 days 0 hr. 0 min. 1 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File  /u01/app/oracle/product/11.2.0.3/db_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/gg1/listener/alert/log.xml

Listening Endpoints Summary...

 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gg1)(PORT=1521)))

 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

The listener supports no services

The command completed successfully

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即���明您已经阅读并接受上述条款