目录
bat启动oracle
@echo off
rem Copyright (c) 2019 Moses and/or its affiliates.
net start OracleServiceORCL
net start OracleVssWriterORCL
net start OracleOraDB12Home1TNSListener
net start OracleJobSchedulerORCL
pause
bat停止oracle
@echo off
rem Copyright (c) 2019 Moses and/or its affiliates.
net stop OracleServiceORCL
net stop OracleVssWriterORCL
net stop OracleOraDB12Home1TNSListener
net stop OracleJobSchedulerORCL
pause
bat启动pdborcl
sqlplus sys/sys as sysdba @pdborcl.sql
pause
pdborcl.sql
conn sys/sys as sysdba
alter session set container=pdborcl;
startup;
exit
bat启动mysql
@echo off
rem Copyright (c) 2019 Moses and/or its affiliates.
rem Get Administrator Rights
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
rem start
net start MySQL
bat停止mysql
@echo off
rem Copyright (c) 2019 Moses and/or its affiliates.
rem Get Administrator Rights
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
rem stop
net stop MySQL
bat执行mysql脚本
@ECHO OFF
rem Copyright (c) 2019 Moses and/or its affiliates.
SET bin=D:\program\mysql-5.7.16-winx64\bin
SET dbhost=127.0.0.1
SET dbuser=root
SET dbpasswd=123456
SET dbName=test
rem current directory
SET sqlpath=%~dp0
rem sql file
set sqlfile=update.sql
cmd /k "cd %bin% && mysql -h%dbhost% -u%dbuser% -p%dbpasswd% %dbName% < %sqlpath%%sqlfile% --default-character-set=utf8"
ECHO finish!
PAUSE
@ECHO Done!
bat执行SQL Server脚本
@echo off
choice /t 3 /c yn /d n /m "Please enter Y to start the SQL SERVER service, N to stop the SQL SERVER service, otherwise automatically choose to start after 3 seconds."
if errorlevel 1 goto start
if errorlevel 2 goto stop
:start
net start SSASTELEMETRY
net start SQLTELEMETRY
net start SSISTELEMETRY130
net start SQLWriter
net start SQLPBENGINE
net start MsDtsServer130
net start MSSQLFDLauncher
net start MSSQLLaunchpad
net start MSSQLSERVER
net start MSSQLServerOLAPService
net start ReportServer
goto end
:stop
net stop SSASTELEMETRY
net stop SQLTELEMETRY
net stop SSISTELEMETRY130
net stop SQLWriter
net stop SQLPBENGINE
net stop MsDtsServer130
net stop MSSQLFDLauncher
net stop MSSQLLaunchpad
net stop MSSQLSERVER
net stop MSSQLServerOLAPService
net stop ReportServer
goto end
:end
echo Thank you for using it. It will be turned off automatically in three seconds.
pause