oracle的shell命令,Shell实现的Oracle启动脚本分享
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 <
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 <
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}
oracle的shell命令,Shell实现的Oracle启动脚本分享相关推荐
- oracle禁止自动启动命令,自动启动和关闭Oracle 脚本
配置完ASM实例后,每次启动oracle数据库服务器的时候要先启动ASM实例,然后启动数据库实例:关闭的时候,需要先关闭oracle数据库实例,然后关闭ASM实例:敲起命来来麻烦的很,因而改进了原来的 ...
- oracle移动文件命令是什么意思,Oracle使用命令移动各类文件的方法
二. 移动控制文件 step1: 通过spfile创建pfile #sqlplus / as sysdbaSQL> select * from v$controlfile; SQL> cr ...
- shell启动oracle客户端,Shell实现的Oracle启动脚本分享
Usage: sh oracled [start|stop|restart] SIDs 其中SIDs是数据库名,多个名称之间用逗号分隔.缺省的操作是 restart ,也可以指定需要进行的操作( st ...
- sqlplus命令 mysql_[Oracle]SQL*PLUS命令的使用大全
一.DataBase 保存数据,以表的形式表现数据 二.SQL Structur query language 结构化查询语言,是操作关系型数据库中的对象. DDL(Data definition l ...
- apache php 执行shell,PHP执行普通shell命令流程解析
这里演示一些普通的shell命令 php执行shell命令,可以使用下面几个函数: string system ( string $command [, int &$return_var ] ...
- python调用linux命令输出结果,Python-运行shell命令并捕获输出
小编典典 这个问题的答案取决于你使用的Python版本.最简单的方法是使用以下subprocess.check_output功能: >>> subprocess.check_outp ...
- java基础/java调用shell命令和脚本
一.项目需求: 从某一机构获取证书,证书机构提供小工具,执行.sh脚本即可启动服务,本地调用该服务即可获取证书. 问题:linux服务器启动该服务,不能关闭.一旦关闭,服务即停止. 解决方案:java ...
- Unix/Linux 中shell命令 awk
shell命令awk使用例: 通过脚本打印出系统当前内存使用的百分比: #!/bin/bash [centos@centos shell]$ free -mtotal used free shared ...
- python中command是什么意思_python中command执行shell命令脚本方法
在Python中有一个模块commands也很容易做到以上的效果. 看一下三个函数: 1). commands.getstatusoutput(cmd) 用os.popen()执行命令cmd, 然后返 ...
最新文章
- 《大道至简》读后感(伪代码)
- 生成式AI,引领AI从“换脸”到“造脸”
- New Companies(关联查询+group by)
- sharedpreferences 重启不保存_MMKV为什么可以替换SharedPreferences
- A Walk Through the Forest
- larvel php restful_Laravel教你简单写出专业的RestfulAPI
- windows找不到文件gpedit.msc_此电脑右键管理提示windows找不到文件的解决方法
- DNN Mail功能介绍 [DNN 3.2.2]
- win7(32位)U盘安装、卸载ubuntu(64位)双系统
- ztree Api官方文档
- 自学FPGA第一期:初学FPGA
- j2sdkversion-doc.zip下载地址
- Activiti6--入门学习--中间事件
- 阿尔法贝塔阀原理_阿尔法跟贝塔以及夏普讲的最通俗的
- 永洪科技贺新颖:业务中台+数据中台,赋能企业核心业务
- MarkMan(马克鳗)
- 互联网晚报 | 05月31日 星期二 | 教育部将彻查教材插图问题;​6月1日上海有序恢复相关秩序;近半数职场人年终奖少于1个月...
- Papers with Code一个查找论文和对应代码的神器
- svchost.exe占用cpu100%
- 关于SSM(mybatis)入门01