I have been tasked with administering some MS SQL Server (Express) databases. My primary DBA experience has been with DB2 LUW and Oracle Database, and I have a hard time understanding the way SQL Server is handling its transaction log.
I have a database set to "full" recovery model and a pre-allocated transaction log file of 100 MB. Using the Windows scheduler, I run daily full backups at 00:00 and log backups every 2 hours, starting at 02:00.
It was my understanding that running the log backups will automatically free up transaction log space, but this does not seem to be the case -- the output of "dbcc sqlperf(logspace)" shows that the "log space used%" figure is continually (if slowly) rising.
It is currently at 5%, so I'm not yet in a state of panic, but I am confused about the way SQL server is doing this.
The TSQL statement I use for full backups:
BACKUP DATABASE [xxx] TO DISK = N'E:\backups\xxx.bak' WITH DESCRIPTION = N'blah', RETAINDAYS = 7, NOFORMAT, NOINIT, NAME = N'blah', NOSKIP, REWIND, NOUNLOAD, STATS = 10, CHECKSUM
The TSQL statement for log backups is:
BACKUP LOG [xxx] TO DISK = N'E:\backups\xxx.trn' WITH DESCRIPTION = N'blah', RETAINDAYS = 7, NOFORMAT, NOINIT, NAME = N'blah', NOSKIP, REWIND, NOUNLOAD, STATS = 10, CHECKSUM
So, what do I have to do in order to free up log space?
Thanks in advance for your input.