在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]$

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/19602/viewspace-1008653/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/19602/viewspace-1008653/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Linux下安装和启动Oracle数据库的步骤如下: 1. 首先,需要安装Oracle数据库软件。可以按照引用\[1\]中的步骤进行安装。 2. 安装完毕后,需要创建Oracle系统用户。可以按照引用\[1\]和引用\[2\]中的步骤创建用户。 3. 在用户的.bash_profile文件中添加必要的环境变量。这些环境变量包括ORACLE_HOME、ORACLE_SID、PATH等。可以按照引用\[1\]和引用\[2\]中的步骤进行设置。 4. 启动Oracle数据库服务。可以使用以下命令启动数据库: ``` cd $ORACLE_HOME dbstart ``` 5. 启动监听器。可以使用以下命令启动监听器: ``` lsnrctl start ``` 6. 确保数据库和监听器已成功启动。可以使用以下命令检查数据库和监听器的状态: ``` lsnrctl status sqlplus / as sysdba ``` 请注意,以上步骤仅为一般情况下的安装和启动步骤,具体步骤可能会因Oracle版本和操作系统版本的不同而有所差异。建议在安装和启动过程中参考官方文档或相关指南以获取更详细的信息和指导。 #### 引用[.reference_title] - *1* *2* *3* [Linux启动Oracle服务和监听程序](https://blog.csdn.net/weixin_42314711/article/details/116383766)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值