Groups | Blog | Home
all groups > sql server (microsoft) > june 2007 >

sql server (microsoft) : Transaction logs


Andy
6/14/2007 5:26:31 AM
Hi,

I have a database, recovery model full.

I have a maintenance plan that does a full backup everyday at 6:00
PM. I also have another plan that does only transaction log backups
every hour during business hours.

My question is, when is it safe to delete the old logs? Never? After
the full backup? I think it would be safe to delete logs older than
the last full backup, but I want to be sure.

Thanks
Andy
RoadRaat
6/14/2007 11:27:56 AM
[quoted text, click to view]

I'll take a stab at this one. I think you might be confusing the
transaction log with SQL Server logs located under the Management node
in Enterprise Manager.

Transaction log. This is a system file. You never delete it. It is not
a user-readable file. It interacts with the data file. There are no
successive generations of transaction logs. There is just one (or as
many as you have defined as administrator). The simple description is
that through this file the database is able to roll back transactions
that you don't want to commit.

SQL Server log (under Management node). This is an event log. You can
read it and see database events. I think you can configure how long
you want those logs to be retained, but I don't know exactly how.
Suffice to say that even in this case, you still don't need to
administer the physical files by hand yourself.

RoadRaat
RoadRaat
6/14/2007 11:45:44 AM
[quoted text, click to view]

Bet I misread your post. You asked when it is safe to delete your old
logs. Maybe you meant your old transaction log backups.

The question of when you can delete ANY backup depends on what point
in time you want to be able to recover to.

1. You can always restore your last full backup.
2. Then you can always restore the latest subsequent differential
backup.
3. Then you can restore any number of subsequent transaction log
backups, SO LONG as the chain is complete.
4. Now, if you take another full backup, yes you could delete all of
those other backup files, but then you would not be able to go back
and restore to any of those prior points in time if you ever needed
to. You have to figure out whether or not you care.

RoadRaat
Andy
6/15/2007 10:58:54 AM
[quoted text, click to view]

Yes, I wanted to know when I could delete the old transaction log
backups..

[quoted text, click to view]

I just need to be able to recover to the point of failure. Each night
the backup files are backed up to tape, and the tapes are swapped
daily.

Assuming a failure at 2:45, and the last transaction log backup was 2,
should the last full backup + all transaction log backups made since
then be sufficent? Or do I also need to add differential backups to
acomplish this?

Thanks
Andy
AddThis Social Bookmark Button