Oracle服务相当耗资源,有时我们会较频繁的启动或停止该服务,一般情况下会有以下两种方法:

1. 通过命令启动或停止服务;

2. 或是从开始>设置>控制面板>管理工具>服务, 的列表中启动或停止服务。

以上两种方法都不如一个批处理文件执行效率高:

@echo off
color f1
echo "停止数据库服务为1,启动数据库服务为2"

set source=:
set /p source= 请输入要进行操作的序号:
if "%source%"=="1" goto net1
if "%source%"=="2" goto net2

:net1

rem @net stop OracleDBConsoleora10g
rem @net stop OracleOraDb10g_home1iSQL*Plus
@net stop OracleOraDb10g_home1TNSListener
@net stop OracleServiceORA10G
rem oracle 服务已经停止


goto end

:net2

rem @net start OracleDBConsoleora10g
rem @net start OracleOraDb10g_home1iSQL*Plus
@net start OracleOraDb10g_home1TNSListener
@net start OracleServiceORA10G
rem oracle 服务已经启动

goto end
:end
color f2
pause & echo  操作完毕,并按任意键退出!

将以上代码中的服务名换成自已本地的服务名,复制到文本文件中,保存为 文件名.bat,即可使用了。

这样子将该 文件名.bat 文件放到桌面,启动或停止Oracle服务,双击即可。

相关文章:

  • 2021-08-19
  • 2021-08-07
  • 2022-12-23
  • 2022-02-28
  • 2022-03-03
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-12
  • 2022-01-21
  • 2021-12-07
  • 2022-12-23
  • 2021-08-04
  • 2021-06-21
相关资源
相似解决方案