Because of the way we frequently copy sqla databases around, it would be very handy if the log file did not exist. For instance, many of our customers will frequently "refresh test" with production. What is the benefit of keeping a log file? What is the downside of not having a log file and forcing sqla to "maintain the log" automatically? Thanks, Doug P.S. It would be very handy for us if we could, for instance copy "Production.db" to "Test.db" and not worry about the log file.
asked 15 Sep '11, 09:17
Having a transaction log offers several benefits. For one thing, it allows you to do forward recovery to a particular log operation/offset. Secondly, it provides additional protection from media failure if the database file becomes corrupt (assuming, of course, that you have a backup). But possibly the most important reason is that if the database does not have a transaction log, then each and every COMMIT operation causes an implicit CHECKPOINT, flushing all modified database pages to disk. That can be very, very expensive and you will notice the performance degradation even with "test" workloads.
If a database has been shutdown cleanly, and you don't care about retaining the log, then you can delete the log file (or copy the database file without the log). In that case, the SQL Anywhere server will happily create a new log file in the same directory as the database file, and off you go.
answered 15 Sep '11, 10:03