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

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

  1. 利用dbstart和dbshut脚本自动启动和停止数据库的问题

    客户的两台IBM Power 740小型机使用HACMP软件创建互备关系的数据库服务器,每台小型机运行一个数据库,任何一台服务器出现故障宕机,另一台小型机应该立即接管,且要一并接管数据库,这时在一台小 ...

  2. Linux退出sqlplus界面,Linux CentOS中使用SQL*Plus启动和关闭数据库

    启动和关闭数据库的常用工具有三个 一.SQL*Plus 在SQL*Plus环境中,用户以SYSDBA身份连接到Oracle后,可以通过命令行方式启动或关闭数据库. 二.OEM(企业管理器) 利用OEM ...

  3. 使用dbstart 和dbshut 脚本来自动化启动和关闭数据库

    使用dbstart 和dbshut 脚本来自动化启动和关闭数据库: 1. 登录用户root. 2. 编辑你的平台的oratab 文件. 打开文件/etc/oratab: 文件里数据库条目为以下格式: ...

  4. 利用doc命令启动与关闭服务

    利用doc命令启动与关闭服务 关闭mysql服务 开启mysql服务 连接mysql 格式 mysql -h服务器主机地址 -u用户名 -p密码

  5. 03-mysql的相关命令-启动与关闭服务-配置环境变量

    P9009_MySQL基础_MySQL服务的启动和停止 服务的启动与停止在这里调 >方式二 通过管理员启动 cmd 通过命令启动与停止服务 net stop 服务名称net start 服务名称 ...

  6. MySQL命令启动与关闭服务

    1.启动与关闭MySQL 1.查看mysql服务的两种方式 [root@localhost bin]ps -ef|grep mysql [root@localhost bin]netstat -nlp ...

  7. oracle 10g 关库,Oracle Db10g 启动和关闭数据库

    启动数据库的步骤: 1.创建并启动例程 当例程启动时,根据参数文件给内存结构和服务进程分配.初始化和启动.此时,用户可以与数据库通信.但是,不能访问数据库中任何对像(如表.视图等等),原因是例程还没有 ...

  8. vm磁盘映射 不能启动_Oracle的启动与关闭-数据库(4)

    Oracle数据的库的启动与关闭,为了节约资源消耗,把我们用到的服务开启,这样对于项目开发也有好处. 1 Oracle 启动 Oracle 是通过系统的服务来启动的. 图1. 找到计算机管理 图2. ...

  9. oracle启动或关闭数据库实例

    1.oracle启动数据库步骤 1.1.启动实例.为实例创建后台服务进程,并在内存中创建SGA区等内存结构,在实例启动中只会使用到初始化参数文件,无论数据库是否存在. 1.2.为实例加载数据库.打开数 ...

最新文章

  1. 过滤器实例——字符编码Filter
  2. 把java当爱好_(观点)如果把爱好做成职业 把职业做成事业
  3. php 正则 前望,PHP 正则表达式
  4. 修改docker镜像的存储地址的方法(--graph)
  5. Windows Server 2003 DNS服务安装篇
  6. 西安理工大学计算机研究生名单,西安理工大学2019年硕士研究生拟录取名单
  7. SpringBoot多环境配置与使用
  8. Meteor 加入账户系统
  9. C#:xml操作(待补充)
  10. vue 后端返回图片乱码处理方法
  11. 如何使页面POSTBACK后,仍然显示原来的显示位置
  12. 大一新生应该如何学习C语言,书上代码看不懂理解不了怎么办?
  13. 打印和为sum的组合,动规法+DFS+迭代法
  14. 基于混沌的一般彩色图像加密算法的Matlab实现
  15. MRT工具谢幕,HEG华丽登场
  16. 如何把token存储到本地和headers中
  17. mysql导出数据到csv的方式
  18. spring prototype 使用场景
  19. VI命令使用大全(删除精华)
  20. zk-creds: Flexible Anonymous Credentials from zkSNARKs and Existing Identity Infrastructure

热门文章

  1. Python 数据结构与算法 —— 插入排序
  2. convenient functions in numpy
  3. java 控制台输出到gui_java – 如何将类似窗口的“控制台”添加到GUI?
  4. python创建矩阵_python中Numpy的属性与创建矩阵
  5. qml中使用combobox实现多级菜单_Excel教程:还不会做Excel三级下拉菜单?其实它跟复制粘贴一样简单...
  6. python是干什么的-python学来主要是干什么的
  7. python怎么读文件-python怎么读json文件
  8. 零基础学python要多久-零基础学Python要多久
  9. python是什么意思-python是什么
  10. CheetahLab:2018中国人工智能报告