Sharepoint backup and LDF files
Hello,
I am running WSS 3.0 on W2K3 box. I am using stsadm to do a full backup that is scheduled in System Tasks. I then backup the .bak file with 3rd party to tape.
I have noticed that the sharepoint_config.ldf and WSS_content.ldf log files are 17 and 1GB respectively. I thought that doing a full backup clears the LDF files. Isn't this the case? If not, how can they be reduced?
And based on my backup method mentined above, can I assume we're safe for failure, and all I'll need to do is restore the .bak file?
Thanks in advance.
Mike
October 24th, 2010 3:26am
Hi Mike,
The issue is the databases are using full recovery model, this allows you to restore your Db to the point in time of a failure instead of just the point in time of the last backup. Using STSAdm the logs are not being truncated after the
backup and your logs will continue to grow. In order to Truncate the logs you have two choices. 1) To set the recovery model to Simple.. 2) Backup and Shrink the Logs
The following SQL Query copied from a maintenance plan will check the db for consistency, perform a backup of the Log and Db file, Shrinks the Db, Cleans up the Histsory from a point in time (1 month) and leaves 3 days of BAKs and TRNs
on the server...
--check Db integrity
USE [WSS_Content_TREX-SI-10]
GO
DBCC CHECKDB(N'WSS_Content_TREX-SI-10') WITH NO_INFOMSGS
--Backup Log
BACKUP LOG [WSS_Content_v4] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup\WSS_Content_v4_backup_2010_10_23_174819_4374485.trn' WITH NOFORMAT, NOINIT, NAME = N'WSS_Content_v4_backup_2010_10_23_174819_4354313', SKIP, REWIND, NOUNLOAD, COMPRESSION, STATS = 10
--Backup Db
BACKUP DATABASE [WSS_Content_v4] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup\WSS_Content_v4_backup_2010_10_23_174851_9153771.bak' WITH NOFORMAT, NOINIT, NAME = N'WSS_Content_v4_backup_2010_10_23_174851_9123513', SKIP, REWIND, NOUNLOAD, COMPRESSION, STATS = 10
--Shrink Db
DBCC SHRINKDATABASE(N'WSS_Content_v4', 10, TRUNCATEONLY)
--Clean Up Log
declare @dt datetime select @dt = cast(N'2010-09-25T17:50:36' as datetime) exec msdb.dbo.sp_delete_backuphistory @dt
GO
EXEC msdb.dbo.sp_purge_jobhistory @oldest_date='2010-09-25T17:50:36'
GO
EXECUTE msdb..sp_maintplan_delete_log null,null,'2010-09-25T17:50:36'
--Keep three days of Backups
EXECUTE master.dbo.xp_delete_file 0,N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup',N'bak',N'2010-10-09T17:50:57'
-Ivan
Ivan Sanders My LinkedIn Profile,
My Blog,
@iasanders.
Free Windows Admin Tool Kit Click here and download it now
October 24th, 2010 4:06am
Thanks again, Ivan.
Really appreciate the timely responses.
Just doing some research, but can't really find a clear explanation. What is the difference between 'Site Collection backup' and 'Catstrophic backup'? We appear to be doing the 'Site Collection' backup based on the script that we're running.
Thanks
Mike
October 25th, 2010 6:03am