linux db 启动盘,在linux下使用dbstart和dbshut启动和关闭db!

版本10.2

在9i下dbstart存在一bug:dbstart启动时在$ORACLE_HOME/dbs下寻找initSID.ora,事实上在该目录下不存在这个pfile,在9i 已经使用了spfile,所以要想正常通过dbstart启动db,需要在目录$ORACLE_HOME/dbs下创建一个initSID.ORA文件,10g中我发现修正了这一问题。不过10g中dbstart在自动启动listener时存在一问题:dbstart脚本中存在下面一行:#ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle

致使启动是出现错误:

[oracle@xys bin]$ dbstart

Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr

Processing Database instance "TEST": log file /opt/app/oracle/product/10.2.0/db_1/startup.log

该错误显示listener不能正常启动,但是instance可以正常启动,原因就是ORACLE_HOME_LISTNER设置的不对,我们修正一下,注释下面一行,增加:

#ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle

ORACLE_HOME_LISTNER=$ORACLE_HOME即可[@more@]

修正之后启动和停止测试如下:

[oracle@xys bin]$ dbstart

Processing Database instance "TEST": log file /opt/app/oracle/product/10.2.0/db_1/startup.log

[oracle@xys bin]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 07-AUG-2008 12:17:51

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

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

STATUS of the LISTENER

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

Alias LISTENER

Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production

Start Date 07-AUG-2008 12:17:27

Uptime 0 days 0 hr. 0 min. 23 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /opt/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Listener Log File /opt/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening Endpoints Summary...

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

Services Summary...

Service "ORCL" has 1 instance(s).

Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...

Service "TEST" has 2 instance(s).

Instance "TEST", status UNKNOWN, has 1 handler(s) for this service...

Instance "TEST", status READY, has 1 handler(s) for this service...

Service "test_XPT" has 1 instance(s).

Instance "TEST", status READY, has 1 handler(s) for this service...

The command completed successfully

[oracle@xys bin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 7 12:17:55 2008

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL> select status from v$instance;

STATUS

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

OPEN

SQL> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

[oracle@xys bin]$ dbshut

shutdown之后发现listener并没有stop,查看dbshut脚本发现该脚本中没有lsnrctl stop命令,也就是说dbshut只是停止instance而并不会停止listener,如果想让dbshut在停止instance的同时也停止listener,可以简单的在dbshut的结尾加上lsnrctl stop.

[oracle@xys bin]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 07-AUG-2008 12:18:48

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

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

STATUS of the LISTENER

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

Alias LISTENER

Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production

Start Date 07-AUG-2008 12:17:27

Uptime 0 days 0 hr. 1 min. 20 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /opt/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Listener Log File /opt/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening Endpoints Summary...

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

Services Summary...

Service "ORCL" has 1 instance(s).

Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...

Service "TEST" has 1 instance(s).

Instance "TEST", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

[oracle@xys bin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 7 12:19:11 2008

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

Connected to an idle instance.

SQL> exit

Disconnected

[oracle@xys bin]$ echo $ORACLE_SID

TEST

[oracle@xys bin]$

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值