Try OpenEdge Now
skip to main content
Resource Monitoring
Monitoring File Resources : Creating a log file monitor : Using a bookmark : Bookmark and truncation considerations
 
Bookmark and truncation considerations
Due to the volume of data stored, some log files have the potential to grow very large. A database administrator (DBA) will typically truncate these files periodically to minimize the amount of space they occupy on a system. The existence of bookmarks within a log file ensures that regardless of what happens to your file when it is truncated, your log file monitor always has the ability to reposition itself accurately within the file.
Data can be truncated at any point within a file. Consequently, when bookmarks are not used and a file has been truncated, the log file monitor has only a limited number of options to determine its new position. Bookmarks represent your most reliable means to reposition your log file monitor accurately so that the data you use is accurate.
For example, if a DBA truncated 500 lines of data at the beginning of a log and, in the meantime, 1000 more data lines were added at the end of the file, the log file will reposition the new reference mark somewhere within the last 500 data lines; having "lost" 500 lines, the log file monitor only knows that it has to read ahead 500 lines into the new data and reposition itself. In this situation, the fact that 500 lines of data have been truncated has been obscured by the existence of the new data. Not having a bookmark to reference as a point of origin, the log file monitor repositions itself 500 lines into the "newer" data lines that have been written. Unfortunately, this approach incorrectly allows the data to be misread, since the balance of the 500 newer data lines are left unread. Had bookmarks been used in this circumstance, this error would have been avoided.
Note: Under certain circumstances, you might not be concerned with unread data. For example, if you are performing software testing activities, log files might be deleted frequently. Therefore, you might not need to set bookmarks to ensure accurate repositioning occurs after a file has been truncated.
If the monitored log file has changed since the last poll and the bookmark feature is enabled, a new bookmark is inserted.