Here is an example of a Windows batch file that displays the current status of queued jobs in a Runtime Repository.
@echo off::setlocalset DB_HOST=strs-550set DB_PORT=1433set DB_INST=set DB_NAME=StrsDataset DB_USER=StrsDataAndQueuesset DB_PASS=Passw0rdrem * * Oraclerem set DB_BIN=sqlplus.exe -S %DB_USER%/%DB_PASS%@%DB_HOST%:%DB_PORT%/%DB_INST%rem * * MSSQLset DB_BIN=C:\Progra~1\Micros~1\100\Tools\Binn\sqlcmd.exe -S %DB_HOST%\%DB_INST%,%DB_PORT% -d %DB_NAME% -U %DB_USER% -P %DB_PASS%set EXITCODE=0echo %DATE% %TIME% %0 %1 %2 %3 %4 %5 %6 %7 %8 %9echo %DB_HOST%:%DB_PORT%/%DB_INST% %DB_NAME% %DB_USER%echo.echo This script examines queued jobs in the StreamServe Runtime Repository schema. echo.echo. set STRTYPEID='AB04C620-0668-400A-B78B-7139722AA194'set DB_QRY0=set NOCOUNT ON; ::echo Events waiting for processing::set DB_QUERY=select count(*), StatusCodeEvent from QStatusReport group by StatusCodeEvent;::rem echo %DB_QUERY% | %DB_BIN%::%DB_BIN% -Q"%DB_QRY0%%DB_QUERY%" | findstr [0-9]::echo.echo TOTAL number of Jobs in queue:set DB_QUERY=select count(*) from Part where StructureTypeID=%STRTYPEID%;rem echo %DB_QUERY% | %DB_BIN% | findstr [0-9]%DB_BIN% -Q"%DB_QRY0%%DB_QUERY%" | findstr [0-9]echo Number of Jobs in queue that are N/A (or still Processing):set DB_QUERY=select count(*) from Part where StructureTypeID=%STRTYPEID% and ProcessingStatus=0;rem echo %DB_QUERY% | %DB_BIN% | findstr [0-9]%DB_BIN% -Q"%DB_QRY0%%DB_QUERY%" | findstr [0-9]echo Number of Jobs in queue that COMPLETED OK:set DB_QUERY=select count(*) from Part where StructureTypeID=%STRTYPEID% and ProcessingStatus=1 and ErrorCode=0;rem echo %DB_QUERY% | %DB_BIN% | findstr [0-9]%DB_BIN% -Q"%DB_QRY0%%DB_QUERY%" | findstr [0-9]echo Number of Jobs in queue that COMPLETED WITH ERRORS OR WARNINGS:set DB_QUERY=select count(*) from Part where StructureTypeID=%STRTYPEID% and ProcessingStatus=1 and ErrorCode!=0;rem echo %DB_QUERY% | %DB_BIN% | findstr [0-9]%DB_BIN% -Q"%DB_QRY0%%DB_QUERY%" | findstr [0-9]echo Number of Jobs in queue that CANCELLED (Failed):set DB_QUERY=select count(*) from Part where StructureTypeID=%STRTYPEID% and ProcessingStatus=2;rem echo %DB_QUERY% | %DB_BIN% | findstr [0-9]%DB_BIN% -Q"%DB_QRY0%%DB_QUERY%" | findstr [0-9]echo Number of Jobs in queue that were ABORTED (Failed):set DB_QUERY=select count(*) from Part where StructureTypeID=%STRTYPEID% and ProcessingStatus=3;rem echo %DB_QUERY% | %DB_BIN% | findstr [0-9]%DB_BIN% -Q"%DB_QRY0%%DB_QUERY%" | findstr [0-9]echo Number of Jobs in queue that are REMOVING (Marked for Deletion):set DB_QUERY=select count(*) from Part where StructureTypeID=%STRTYPEID% and ProcessingStatus=4;rem echo %DB_QUERY% | %DB_BIN% | findstr [0-9]%DB_BIN% -Q"%DB_QRY0%%DB_QUERY%" | findstr [0-9]echo Number of Jobs in queue that are FAILED OVER (Heartbeat Event reached):set DB_QUERY=select count(*) from Part where StructureTypeID=%STRTYPEID% and ProcessingStatus=5;rem echo %DB_QUERY% | %DB_BIN% | findstr [0-9]%DB_BIN% -Q"%DB_QRY0%%DB_QUERY%" | findstr [0-9]echo.:END::echo Exit code is %EXITCODE%.exit /b %EXITCODE%endlocal
I like the truncate idea on both Runtime and WebContent db's. I would like a drop feature. Reason being is that I have seen a number of time sync issues of DocumentTypes between RT and WC. No matter what I have done in the past, being update the DocumentTemplate version in ER, increase the comp center version via ST process, or unpublish re-publish still get errors like "Cannot get document definition from Composition Center service". Customer then has to drop and recreate these via some external SQL tool and re-create via Control Center resulting in confusion a lot of times. This resolves the sync problem however if DBAT could perform the truncate, customer would never have to leave CC/DBAT .
Mike