婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > Shell實現的Oracle啟動腳本分享

Shell實現的Oracle啟動腳本分享

熱門標簽:申請公司400電話要注意什么 聯通電話機器人怎么接 衛星地圖標注地名 寧波智能外呼系統公司 安裝外呼系統費用 曲阜400電話辦理 地圖標注輻射圖案 電銷機器人 劍魚 奧維互動地圖標注參數

Usage: sh oracled [start|stop|restart] SIDs 其中SIDs是數據庫名,多個名稱之間用逗號分隔。缺省的操作是 restart ,也可以指定需要進行的操作( start | stop | restart )

復制代碼 代碼如下:

#!/bin/sh 
 
cmdname="restart" 
# get oracle sid information from env by default. 
oracleSID=${ORACLE_SID} 
env_oracleSID=${ORACLE_SID} 
 
function echohelp(){ 
  echo "******oracled Tool Helper******" 
  echo "Usage:sh oracled [start|stop|restart] SIDs" 
  echo "SIDs : seperated by comma" 
  exit 5 

 
function startoracle(){ 
  echo "begin to start oracle ..." 
 
  lsnrctl start 
  for curSID in `echo ${oracleSID} | awk 'BEGIN {RS=","}{ORS="\n"}{print $1}'` ; do 
    if [ "x${curSID}" = "x" ] ; then 
      continue; 
    fi 
    export ORACLE_SID=${curSID} 
 
sqlplus /nolog EOF 
 
connect /as sysdba 
startup 
exit 
exit 
 
EOF 
 
    echo "oracle DB [${curSID}] started OK." 
  done 

function stoporacle(){ 
  echo "begin to stop oracle ..." 
 
  for curSID in `echo ${oracleSID} | awk 'BEGIN {RS=","}{ORS="\n"}{print $1}'` ; do 
    if [ "x${curSID}" = "x" ] ; then 
      continue; 
    fi 
    export ORACLE_SID=${curSID} 
 
sqlplus /nolog EOF 
 
connect /as sysdba 
shutdown immediate 
exit 
exit 
 
EOF 
 
    echo "oracle DB [${curSID}] stopped OK." 
  done 
  lsnrctl stop 

function restartoracle(){ 
  stoporacle 
  startoracle 

 
 
if [ $# -lt 1 ] ; then 
  echohelp 
fi 
 
until [ $# -eq 0 ] 
do 
  tmpVOrg=$1 
  tmpV=`echo "${tmpVOrg}" | awk '{printf "%s",$1}' | tr '[A-Z]' '[a-z]'` 
  if [ $tmpV = "start" -o $tmpV = "restart" -o $tmpV = "stop" ] ; then 
    cmdname=${tmpV} 
  elif [ $tmpV = "--help" -o $tmpV = "-h" ] ; then 
    echohelp 
  else 
    oracleSID=$tmpVOrg 
  fi 
 
  shift 
done 
 
if [ "x${cmdname}" = "x" ] ; then 
  echohelp 
fi 
 
${cmdname}oracle 
 
export ORACLE_SID=${env_oracleSID} 

您可能感興趣的文章:
  • linux環境下編寫shell腳本實現啟動停止tomcat服務的方法
  • Linux啟動jar包的shell腳本
  • 用shell腳本監控進程是否存在 不存在則啟動的實例
  • Shell實現判斷進程是否存在并重新啟動腳本分享
  • CentOS下redis自啟動shell腳本
  • 如何利用shell開發keepalived啟動腳本

標簽:江西 三門峽 仙桃 上饒 大興安嶺 安康 大慶 遵義

巨人網絡通訊聲明:本文標題《Shell實現的Oracle啟動腳本分享》,本文關鍵詞  Shell,實現,的,Oracle,啟動,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《Shell實現的Oracle啟動腳本分享》相關的同類信息!
  • 本頁收集關于Shell實現的Oracle啟動腳本分享的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 基隆市| 达日县| 榆中县| 普宁市| 汝城县| 尼勒克县| 盐源县| 利津县| 湖州市| 江城| 绥阳县| 青岛市| 罗江县| 商都县| 尖扎县| 高平市| 青州市| 会昌县| 永福县| 中方县| 浦北县| 泸水县| 宾阳县| 南昌县| 阿克苏市| 盘锦市| 永善县| 宜都市| 阳江市| 卫辉市| 祁连县| 嘉荫县| 临沂市| 太白县| 仙桃市| 佛冈县| 玉树县| 宁武县| 马公市| 右玉县| 泸溪县|