Kbase 19254: How to truncate a log file when a database running
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/31/2000 |
|
Because PROLOG is not an on-line utility, sites where the databases
are never stopped do not have the ability to truncate the log file
without shutting down the database.
If it is not possible to stop the database server (24x7 database),
then you'll find below the description of a possible solution. That
solution is not supported as the Progress recomendation is still to
shut down the database before truncating the log file.
To truncate the log file without using PROLOG, use the following
Unix commands:
$ mv yourdb.lg yourdb-save.lg
$ tail -50 yourdb-save.lg > yourdb.lg
Note that "-50" in the tail command indicates 50 lines. You can
substitute any number of lines you want, however you must prefix
the line count with a hyphen (i.e. -1000 for 1000 lines).
Please also note that the tail command is only available under Unix.
The same operation could be accomplished under Windows by using
PROLOG on the saved log file, and then renaming the saved log file
back to the original name, as follows:
$ rename yourdb.lg yourdb-save.lg
$ prolog yourdb-save.lg
$ rename yourdb-save.lg yourdb.lg
The only drawback here is that PROLOG does not allow you to specify
the number of lines left in the log file (it will always be 50).
Also, be aware that this could result in lost entries within the log
file; however we did not see lost message while testing a program
with a loop that connected and disconnected from the running database.