REM 适用Oracle版本:11g
REM 如需调整版本及数据库SID,请右击该脚本文件并单击编辑,修改下方的orahome和orasid两个变量的值即可。
REM
REM ————-华丽丽的分割线—————–
@echo off
set orahome="OraDb11g_home1″
set orasid="orcl"
:choice
CHOICE /C ABCD /M "将Oracle服务设为手动请输入A,启动请输入B,关闭请输入C,退出D"
if errorlevel 4 exit
if errorlevel 3 goto shutdown
if errorlevel 2 goto startup
if errorlevel 1 goto manual
:manual
sc config OracleVssWriter%orasid% start= demand
sc config Oracle%orahome%TNSListener start= demand
sc config OracleService%orasid% start= demand
sc config OracleDBConsole%orasid% start= demand
goto choice
:startup
net start OracleVssWriter%orasid%
net start OracleOraDb11g_home1TNSListener
net start OracleService%orasid%
net start OracleDBConsole%orasid%
goto choice
:shutdown
net stop OracleVssWriter%orasid%
net stop OracleOraDb11g_home1TNSListener
net stop OracleService%orasid%
net stop OracleDBConsole%orasid%
goto choice
REM 如需调整版本及数据库SID,请右击该脚本文件并单击编辑,修改下方的orahome和orasid两个变量的值即可。
REM
REM ————-华丽丽的分割线—————–
@echo off
set orahome="OraDb11g_home1″
set orasid="orcl"
:choice
CHOICE /C ABCD /M "将Oracle服务设为手动请输入A,启动请输入B,关闭请输入C,退出D"
if errorlevel 4 exit
if errorlevel 3 goto shutdown
if errorlevel 2 goto startup
if errorlevel 1 goto manual
:manual
sc config OracleVssWriter%orasid% start= demand
sc config Oracle%orahome%TNSListener start= demand
sc config OracleService%orasid% start= demand
sc config OracleDBConsole%orasid% start= demand
goto choice
:startup
net start OracleVssWriter%orasid%
net start OracleOraDb11g_home1TNSListener
net start OracleService%orasid%
net start OracleDBConsole%orasid%
goto choice
:shutdown
net stop OracleVssWriter%orasid%
net stop OracleOraDb11g_home1TNSListener
net stop OracleService%orasid%
net stop OracleDBConsole%orasid%
goto choice
本文介绍了一个适用于Oracle 11g版本的脚本,通过调整orahome和orasid变量,用户可以轻松地手动、启动或关闭Oracle服务。脚本使用Windows命令提示符实现服务的管理,并通过系统服务配置来确保服务按需运行。
134

被折叠的 条评论
为什么被折叠?



