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