64 lines
2.0 KiB
Batchfile
64 lines
2.0 KiB
Batchfile
::@SET DBVER=38
|
|
::@SET DBPRV=37
|
|
::@SET DBPRVPATH=z:\Archief\FACILITOR\2019\02\DB37\FCLT37.sql
|
|
::=============================
|
|
@SET BUILD=z:\Project\FACILITOR\BUILD
|
|
|
|
@SET SOURCE=z:\Project\FACILITOR\Database\%1
|
|
|
|
@IF EXIST %DBPRVPATH% GOTO START
|
|
ECHO %DBPRVPATH% niet gevonden
|
|
PAUSE
|
|
GOTO EINDE
|
|
|
|
:START
|
|
@echo off
|
|
REM Usage: %0 [mailall]
|
|
SET mailall=%2
|
|
|
|
SET OUTPUT=%BUILD%\DB%DBVER%\TEST_OUTPUT
|
|
MKDIR %OUTPUT%>nul
|
|
MKDIR %OUTPUT%\OLD>nul
|
|
DEL %OUTPUT%\OLD\*.LST
|
|
MOVE %OUTPUT%\*.lst %OUTPUT%\OLD
|
|
|
|
PUSHD %SOURCE%
|
|
CALL mx12 NOWAIT
|
|
POPD
|
|
:START0
|
|
IF EXIST %BUILD%\DB%DBVER%\FCLT%DBVER%.sql GOTO STARTCREA
|
|
ECHO %BUILD%\DB%DBVER%\FCLT%DBVER%.sql niet gevonden
|
|
PAUSE
|
|
GOTO EINDE
|
|
:STARTCREA
|
|
|
|
ECHO ==========================================================================================================>diffwork_%DBVER%.lst
|
|
ECHO Comparescript %0>>diffwork_%DBVER%.lst
|
|
ECHO Creates databases users TEST_DB%DBVER% and TEST_DB%DBPRV%TO%DBVER% and compares them>>diffwork_%DBVER%.lst
|
|
ECHO (password is the same as username in uppercase)>>diffwork_%DBVER%.lst
|
|
ECHO ==========================================================================================================>>diffwork_%DBVER%.lst
|
|
ECHO.>>diffwork_%DBVER%.lst
|
|
|
|
ECHO Starting Create DB%DBVER% test
|
|
ECHO Starting Create DB%DBVER% test>>diffwork_%DBVER%.lst
|
|
CALL _CREA_WORK %DBVER% z:\Project\FACILITOR\BUILD>>diffwork_%DBVER%.lst
|
|
|
|
ECHO Starting Update %DBPRV%to%DBVER% test
|
|
ECHO Starting Update %DBPRV%to%DBVER% test>>diffwork_%DBVER%.lst
|
|
CALL _CREA_WORK_UPDATE %DBPRV% %DBPRVPATH% %DBVER% z:\Project\FACILITOR\BUILD>>diffwork_%DBVER%.lst
|
|
|
|
ECHO %time:~,8% Starting Compare
|
|
ECHO Starting Compare>>diffwork_%DBVER%.lst
|
|
cscript compare.js %DBPRV% %DBVER% >>diffwork_%DBVER%.lst 2>>&1
|
|
ECHO %time:~,8% Done Compare
|
|
|
|
findstr /i "ORA-" "diffwork_%DBVER%.lst"
|
|
if %errorlevel%==1 GOTO EINDE
|
|
|
|
findstr /C:"ORA-" /C:"PLS-" "diffwork_%DBVER%.lst" | cscript emailerror.js %DBVER% %mailall% >> %0.log 2>>&1
|
|
@TITLE ORA-Errors found, e-mail sent
|
|
::PAUSE
|
|
|
|
:EINDE
|
|
|
|
move *.lst %OUTPUT% |