Database check
After a "hard" system failure, a situation when the system start cannot be executed without any service intervention can occur. The intervention usually handles a damaged LOG file of some of the databases used. The proposed solution provides the system start with such damage of the database log file.
Implementation method
Databases must be checked before starting process D2000 Server or D2000 Archiv, because Engine (Server) Sybase may freeze.
The utility checksql.exe is intended for checking databases.
Declaration | checksql DBF=path [PWD=password] [UID=name] [VER=version] |
||||||||
Parameters |
|
||||||||
Description |
The utility checksql attempts to connect to the database. Unless it is successful,
the NAME.LOG in the database directory will be deleted and the engine will be started using the
switch -f that forces the database to start without a transaction log and
an attempt to
connect to the database is repeated. Return code is the following:
|
To provide the database check before the system start, the program D2Start was modified, in order to start the file even before starting the process D2000 Server, if the check.cmd command file is placed in the application directory. It allows to check the databases and the particular actions, e.g. the database backup and start in safe mode with template.
Before the start of the process D2000 Server the command file "check.cmd" will be started with parameter /RESTART. Now, the situation mentioned above can be serviced separately.
Example: check.cmd file
D:\D2000_EAGLE4\Bin\checksql.exe DBF=d:\D2000.V45\test\archiv\Archiv.db IF %ERRORLEVEL% EQU 0 GOTO OK1 ECHO Unable to repair the database Archiv.db rename d:\D2000.V45\test\archiv\Archiv.db Archiv.bad copy D:\D2000_EAGLE4\Templates\Archiv.db d:\D2000.V45\test\archiv\Archiv.db :OK1 D:\D2000_EAGLE4\Bin\checksql.exe DBF=d:\D2000.V45\test\LogTrezor\LogTrezor.db PWD=sql IF %ERRORLEVEL% EQU 0 GOTO OK2 ECHO Unable to repair the database LogTrezor.db :OK2 D:\D2000_EAGLE4\Bin\checksql.exe DBF=d:\D2000.V45\test\Logfile\Logfile.db IF %ERRORLEVEL% EQU 0 GOTO OK3 ECHO Unable to repair the database Logfile.db :OK3 D:\D2000_EAGLE4\Bin\checksql.exe DBF=d:\D2000.V45\test\Syscfg\Syscfg.db IF %ERRORLEVEL% EQU 0 GOTO OK4 ECHO Unable to repair the database Syscfg.db :OK4 IF NOT EXIST d:\D2000.V45\test\Trezor\Trezor.db GOTO NEXT1 D:\D2000_EAGLE4\Bin\checksql.exe DBF=d:\D2000.V45\test\Trezor\Trezor.db PWD=sql IF %ERRORLEVEL% EQU 0 GOTO OK4 ECHO Unable to repair the database Trezor.db :OK4 :NEXT1 IF NOT EXIST d:\D2000.V45\test\Trezor\Prev\TrezorP.db GOTO NEXT2 D:\D2000_EAGLE4\Bin\checksql.exe DBF=d:\D2000.V45\test\Trezor\Prev\TrezorP.db PWD=sql IF %ERRORLEVEL% EQU 0 GOTO OK4 ECHO Unable to repair the database TrezorP.db :OK4 :NEXT2
0 komentárov