dbstart $oracle_home,使用dbstart和dbshut命令启动和关闭数据库

Oracle提供了两个脚本dbstart和dbshut用来启动和关闭数据库(包括数据库实例和监听)。

这两个脚本首先读取oratab(/etc/oratab)文件来决定哪些数据库是需要自动启动和关闭的,然后启动和关闭那些数据库。

[oracle@linux1 ~]$ vi /etc/oratab

#

# This file is used by ORACLE utilities.  It is created by root.sh

# and updated by the Database Configuration Assistant when creating

# a database.

# A colon, ':', is used as the field terminator.  A new line terminates

# the entry.  Lines beginning with a pound sign, '#', are comments.

#

# Entries are of the form:

#   $ORACLE_SID:$ORACLE_HOME::

#

# The first and second fields are the system identifier and home

# directory of the database respectively.  The third filed indicates

# to the dbstart utility that the database should , "Y", or should not,

# "N", be brought up at system boot time.

#

# Multiple entries with the same $ORACLE_SID are not allowed.

#

#

orcl:/home/database/oracle/product/11g:N

要使用dbstart和dbshut启动和关闭数据库,需要把N改成Y。

执行 dbstart和dbshut会提示:

[oracle@linux1 ~]$ dbstart

ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener

Usage: /home/database/oracle/product/11g/bin/dbstart ORACLE_HOME

错误原因是:dbstart和dbshut脚本文件中没有设置ORACLE_HOME_LISTNER。

有两种解决方式:

1、 运行命令时带上$ORACLE_HOME参数:

[oracle@linux1 ~]$ dbstart $ORACLE_HOME

2、 分别打开两个文件找到:ORACLE_HOME_LISTNER=$1,修改为:

ORACLE_HOME_LISTNER=$ORACLE_HOME

命令如下:

[oracle@linux1 ~]$ vi $ORACLE_HOME/bin/dbstart

[oracle@linux1 ~]$ vi $ORACLE_HOME/bin/dbshut

启动数据库:

[oracle@linux1 ~]$ dbstart

Processing Database instance "orcl": log file /home/database/oracle/product/11g/startup.log

关闭数据库:

[oracle@linux1 ~]$ dbshut

Processing Database instance "orcl": log file /home/database/oracle/product/11g/shutdown.log

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值