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