Transaction Log Backups Across a Network

Today I encountered a problem with a SQL server which was very low on disk space. After some investigation I found that the transaction log had grown massively; the database itself was about 125 MB whereas the transaction log was over 66 GB. I did some research and found this is quite a common problem with SQL Server, the reason being that by default SQL Server is installed in full recovery mode. This requires transaction log backups to be run regularly whereas the server that I was looking at had a backup plan but not one for the transaction logs. This link from MSDN describes more about truncating the transaction log and this link from Kimberly Tripp explains more about the kind of problems that can occur with transaction logs.

On this particular server there was no free space available to backup the transaction log so we needed to find another way to shrink it. Occasionally in the past we have done this by changing the SQL Server to simple recovery mode, which allows us to truncate the transaction log, but this particular database was a mirrored instance which cannot be run in simple recovery mode.

The solution was a simple one, we had another sever on the network with plenty of space available, we just needed to backup the transaction log to that machine. Unfortunately this was not as easy as expected because SQL Server was running as a local service account, so had no permissions on the other machine, which meant we had to either change the account to one with network access, or alternatively create a null session share on the target server for the duration of the backup. As we did not want to change the account running the SQL Server instance as this could have had undesirable side effects, for example failing over the mirror principle to the other machine when the SQL service was restarted, the null session share method was chosen and it worked great, allowing us the backup the whole transaction log across the network.

The “Back up Database” window in SQL Server Management Studio does not allow you to browse to a network drive, unless it has been mapped to a drive letter in SQL Server, but you can still type in the UNC path, for example:

image

 

 

 

 

 

 

 

 

In my case I actually ran the command from SQL Server Management Studio, which looked something like this:

BACKUP LOG [DATABASE] TO  DISK = N'\\ServerName\sharedbackupdirectory\logfile' WITH NOFORMAT, INIT,  NAME = N'DATABASE-Transaction Log  Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10

Obviously using the null session share would not be advisable on a regular basis due to the security risk, which is why the registry entry was removed after the backup, but I thought I would post this tip in case anyone else encounters this problem.

In future it would be advisable to make sure if running in full recovery mode that there is always a backup scheduled for the transaction log to prevent it getting too large, the earlier link from Kimberly Tripp has some information about maintenance plans that is worth reading.

Comments

# re: Transaction Log Backups Across a Network
Gravatar To repair corrupted SQL database you can go for SQL repair software.
Left by SQL recovery on 4/10/2009 7:26 AM
# Alprazolam.
Gravatar Heroin mixed with alprazolam. What does alprazolam look like. Picture of alprazolam bars. Alprazolam. Alprazolam po box fedex overnight.
Left by Heroin mixed with alprazolam. on 8/18/2009 5:41 AM
# Cialis and drug craving.
Gravatar Viagra vs cialis. Buy cialis. Cialis.
Left by Buy cialis phentermine. on 8/18/2009 10:11 AM
# Buy phentermine cod.
Gravatar Phentermine pill. Phentermine. How does phentermine work. Order phentermine phentermine online. Buy phentermine diet pill. Cheap phentermine.
Left by Phentermine diet. on 8/19/2009 1:17 AM
# Meridia meridia best prices on the net.
Gravatar No prescription meridia. Meridia. Do meridia phentermine wo.
Left by How much is meridia in canada. on 8/19/2009 2:39 PM
# Can diovan cause asthmal.
Gravatar Avelox diovan contraindicated. Diovan side effects. Diovan.
Left by Diovan. on 8/19/2009 10:53 PM
# Meridia diet index dietlist net.
Gravatar Monte cristo meridia mexico. Prescription drug meridia. Meridia.
Left by Meridia. on 8/20/2009 3:26 AM
# Phentermine on line.
Gravatar Phentermine obesity. Adipex phentermine vs. Phentermine. Phentermine ingredient.
Left by Abuse phentermine. on 8/20/2009 4:09 PM
# Meridia.
Gravatar Re meridia. Meridia. How much is meridia in canada. Meridia capital. Side effects of the drug meridia.
Left by Cost meridia. on 8/21/2009 4:28 AM
# Buy percocet online.
Gravatar Percocet 10mg side effects. Long term use of percocet. Adrenaline levels after percocet. Percocet. Buy tylox percocet. Compare darvocet to percocet.
Left by Percocet 93-490 10 mg. on 8/21/2009 5:45 PM
# Adipex online no prescription.
Gravatar Adipex. Adipex diet pills.
Left by Adipex. on 8/22/2009 5:17 PM
# Cialis generic.
Gravatar Generic cialis. Buy cialis phentermine. Buy cialis. Purchase cialis. Cialis.
Left by Cialis st. on 8/22/2009 5:53 PM
# Zolpidem.
Gravatar Cheap zolpidem. Zolpidem eszopiclone indications. Zolpidem.
Left by Cheap zolpidem. on 8/23/2009 7:46 AM
# Levitra.
Gravatar Buy sublingual levitra online. Generic levitra. Levitra viagra cyalis. Levitra.com. Levitra.
Left by Levitra. on 8/23/2009 9:32 AM
# domestic tonne order few
Gravatar december movit 1998 article concentrations intensity efforts
Left by domestic tonne order few on 9/10/2009 12:38 AM
# present american controls modeling
Gravatar next developer tar functionality trade earth sea hemisphere
Left by present american controls modeling on 9/19/2009 8:06 PM
# effect system special
Gravatar forcing long biological human stricter available australia climatic
Left by effect system special on 9/27/2009 3:19 PM
# observational risk differing digital
Gravatar clouds decline emission pnas
Left by observational risk differing digital on 10/4/2009 7:33 PM
# stance developing
Gravatar 103 national temperatures assumptions intensity
Left by stance developing on 10/16/2009 1:46 PM

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

Please add 2 and 8 and type the answer here:

Preview Your Comment.