ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 自定义查看oracle实例状态命令

自定义查看oracle实例状态命令

原创 Linux操作系统 作者:dasong2410 时间:2011-10-31 16:43:19 0 删除 编辑
将如下内容写至文件ss,并将文件放至/home/oracle/bin目录下,打开终端,以oracle用户输入ss则可查看当前oracle实例的状态。

#! /bin/bash
#Author: Marcus Mao
#Date: 2011-10-28
#Desc: show the status of current oracle instance
status=$(sqlplus -L -S / as sysdba < set head off;
 select lower(status) from v\$instance;
 exit;
EOF)

if [[ "$status" =~ "ORA-" ]]; then
  status="idle"
else
  status=$(echo $status | tr -d "\n")
fi

echo "sid: $ORACLE_SID, status: $status"

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

上一篇: clob载入
请登录后发表评论 登录
全部评论

注册时间:2011-05-12

  • 博文量
    66
  • 访问量
    349769