Database Log FIles

From NewHaven Software Wiki

(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
*Stop the database service (SQL Anywhere) in Windows Services
*Stop the database service (SQL Anywhere) in Windows Services
 +
*Rename, compress, and/or move the .log file, ensuring that there is no longer a log file of the original name still in that directory
*Rename, compress, and/or move the .log file, ensuring that there is no longer a log file of the original name still in that directory
 +
*Run dbsrv12.exe (found in the \SA12\Bin directory in the NewHaven Software share) with the -f option to tell the database as seen here:
*Run dbsrv12.exe (found in the \SA12\Bin directory in the NewHaven Software share) with the -f option to tell the database as seen here:
[[file:DBsrv12.jpeg]]
[[file:DBsrv12.jpeg]]
-
No database server name is needed.
+
No Server Name is needed.
 +
 
 +
Once run, you will briefly see a window pop up with quite a bit of scrolling text and then it will disappear (it's done.)
*Start the database service
*Start the database service

Revision as of 00:56, 31 May 2018

Your database log file (.log) is normally found in the same directory as your database (.db) file and serves several purposes that contribute to the use and safety of your database. You can configure your database to run without a log (not recommended) or with the log file running in another drive/directory but neither is commonly done.

Every connection and transaction sent from CMS to the database is stored in the log file. This aids in recovery should the database service become inaccessible mid-transaction (e.g. power outage) or corrupted (e.g. disk failure) where the log file could be used to reconstruct all of the transactions by applying it against the most recent backup. This log file can also be very useful in tracing down particularly obscure problems where reproduction steps for an issue cannot be found.

This log file can grow over time and for optimal performance you'll want to archive a copy off and start with a new empty log file. You may only need to do this once or twice a year or monitor it and perhaps archive if the log file becomes larger than your database, as one rather arbitrary rule of thumb.

Archiving the Log File

This is an interactive log that is synchronized with your database so does require special handling. Here are the steps required to move and reset it, enabling you to start with a new 0 byte log file.

  • Stop the database service (SQL Anywhere) in Windows Services
  • Rename, compress, and/or move the .log file, ensuring that there is no longer a log file of the original name still in that directory
  • Run dbsrv12.exe (found in the \SA12\Bin directory in the NewHaven Software share) with the -f option to tell the database as seen here:

file:DBsrv12.jpeg

No Server Name is needed.

Once run, you will briefly see a window pop up with quite a bit of scrolling text and then it will disappear (it's done.)

  • Start the database service
Personal tools