Share via


May I delete TRN files created by transaction log shipping jobs?

Question

Friday, July 3, 2009 5:46 PM

We have transaction log shipping set up in our SS2005 environment. I was wondering if it would be okay to delete the TRN files on the primary database and/or the secondary database? We keep our TRN files for 3 days then they're deleted as part of the jobs.

A couple of questions:

  1. If i delete the TRN files on the primary database, am i essentially removing my ability to restore the database back to a certain point in time? Does creating the TRN files from the LDF file move those logs out of the LDF file?

  2. When the secondary database gets the TRN files and applies them to the secondary database, may i delete the TRN files (since they're automatically deleted in 3 days anyways?).

  3. The few times that we had to failover to the secondary database, i've just restored using the most current TRN file and all is good.

I'd just like to know the implications. We have weekly indexing job that creates a 8-10gb TRN file and although it has only happened once where space became an issue (which we resolved and have preparations in place to never see that day again), i'd like to know more.

Thanks!

If you keep doing the same thing, you'll always get the same thing...

All replies (2)

Saturday, July 4, 2009 11:56 AM ✅Answered

1. Yes, transaction logs allow you to do point in time recovery to a specific datetime or to a marked transaction.  Assuming you're doing full backups or differential backups at least every 3 days then your data is safe, but deleting the logs means you will lose the ability to recover to specific points in time between the log backup dates. 
2.Yes, if you don't need a backup of the logs
3.In doing this you may run the risk of losing transactions that have been run on your primary.  What you should be doing is a tail log backup & restoring this on your secondary, or at least putting your primary into read-only & waiting for  the LS job to take another backup.


Saturday, July 4, 2009 10:39 PM

I've yet to learn about doing a tail log backup. I will read up on this for a better understanding... Thanks for the answers!If you keep doing the same thing, you'll always get the same thing...