- @echo off
- setlocal enabledelayedexpansion
- title 医信通停库数据库定时备份 不许关闭
- :bf
- rem 下句del是用于测试环境
- del 已备份.txt
- color 1f
- set sj=%time:~0,2%
- if %sj% neq 3 (
- color 0f
- del 已备份.txt>nul 2>nul
- echo.
- echo 警告:不要关闭
- echo.
- echo 计划备份时间为每晚3点范围内 程序处于检测等待状态(每45分钟检测一次)
- echo.
- echo 医信通数据库备份程序 现不在备份时间
- ping /n 2700 127.1>nul
- ) else (
- if exist 已备份.txt (
- echo 已备份过 延时处理
- ping /n 2700 127.1>nul
- goto bf
- ) else (
- rem 停止yxt oracle服务 可能是有顺序的
- echo.>已备份.txt
- net stop OracleServiceYXT
- net stop OracleOraHome81TNSListener
- net stop OracleOraHome81Agent
- net stop OracleOraHome81HTTPServer
- net stop OracleOraHome81DataGatherer
- ping /n 5 127.1 >nul
- echo.>>!date:~0,4!医信通停库备份记录.txt
- echo !date! !time! 停库备份数据库开始>>!date:~0,4!医信通停库备份记录.txt
- xcopy "d:\Oracle\*.*" "e:\医信通停库备份数据库\Oracle" /d/y/e/k/h/r/c
- ping /n 5 127.1 >nul
- echo !date! !time! 停库备份数据库成功>>!date:~0,4!医信通停库备份记录.txt
- ping /n 5 127.1 >nul
- rem 启动yxt oracle服务 可能是有顺序的
- net start OracleOraHome81DataGatherer
- net start OracleOraHome81HTTPServer
- net start OracleOraHome81Agent
- net start OracleOraHome81TNSListener
- net start OracleServiceYXT
- )
- )
- goto bf
复制代码
|