Red Gate forums :: View topic - ERASEFILES_ATSTART question
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup 7
SQL Backup 7 forum

ERASEFILES_ATSTART question

Search in SQL Backup 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Randy Doub



Joined: 28 Jan 2008
Posts: 19

PostPosted: Tue Oct 02, 2012 3:07 pm    Post subject: ERASEFILES_ATSTART question Reply with quote

Where does ERASEFILES_ATSTART get it's source from? The backup command that's running or the Server Options defined in the GUI? Or somewhere else?
I have a server where, due to the size of the files, I put the local backups in several different drives/folders. I changed my backup command from ERASEFILE=23h to ERASEFILES_ATSTART=23h expecting yesterday's local copy to be deleted prior to starting today's backup. But nothing on the local drive was deleted, only the remote.
Some time ago I changed the Backup command for this db to backup to local drive U:\sql_backup. In Server Options, Backup Folder still = T:\backup. Due to the size of the backup files, I can't have two files in the U:\sql_backup folder.

Here's a condensed copy of the log:
SQL Backup log file 7.1.0.72

-SQL "BACKUP DATABASE [SMSPHdsshak0] TO DISK = 'u:\sql_backup\<DATETIME mmm_dd_yyyy>_<DATABASE>_<TYPE>.sqb' WITH
COPYTO = '\\myhouse.org\dfsmis\sqlback02\Warehouse63\', COMPRESSION = 3, ERASEFILES_ATSTART = 23h, ERASEFILES_REMOTE = 30,
FILEOPTIONS = 1, MAILTO_ONERROR = 'r.doub@myhouse.org' "

----------------------- PROCESSES COMPLETED SUCCESSFULLY --------------------

10/1/2012 8:00:00 PM: Backing up SMSPHdsshak0 (full database) to:
10/1/2012 8:00:00 PM: u:\sql_backup\Oct_01_2012_SMSPHdsshak0_FULL.sqb

10/1/2012 8:00:00 PM: Deleting old backup file: \\myhouse.org\dfsmis\sqlback02\Warehouse63\Aug_31_2012_SMSPHdsshak0_FULL.sqb
10/1/2012 8:00:00 PM: BACKUP DATABASE [SMSPHdsshak0] TO VIRTUAL_DEVICE = 'SQLBACKUP_F1953AAA-55BF-41B1-9349-39A73C75B0D3' WITH BUFFERCOUNT = 6, BLOCKSIZE = 65536, MAXTRANSFERSIZE = 1048576, NAME = N'Database (SMSPHdsshak0), 10/1/2012 8:00:00 PM',
DESCRIPTION = N'Backup on 10/1/2012 8:00:00 PM Server: SQLDSS002 Database: SMSPHdsshak0', FORMAT

10/1/2012 9:18:24 PM: Database size : 469.776 GB
10/1/2012 9:18:24 PM: Compressed data size: 45.109 GB
10/1/2012 9:18:24 PM: Compression rate : 90.40%

10/1/2012 9:18:24 PM: Processed 20960 pages for database 'SMSPHdsshak0', file 'Primary_FG01_1' on file 1.
10/1/2012 9:18:24 PM: Processed 1006344 pages for database 'SMSPHdsshak0', file 'user_default_fg01_1' on file 1.
10/1/2012 9:18:24 PM: Processed 1011440 pages for database 'SMSPHdsshak0', file 'user_default_fg01_2' on file 1.
.
.
.
10/1/2012 9:18:24 PM: Processed 323472 pages for database 'SMSPHdsshak0', file 'smssr_data_fg02_1' on file 1.
10/1/2012 9:18:24 PM: Processed 322888 pages for database 'SMSPHdsshak0', file 'smssr_data_fg02_2' on file 1.
10/1/2012 9:18:24 PM: Processed 583 pages for database 'SMSPHdsshak0', file 'TransactionLog_1' on file 1.
10/1/2012 9:18:24 PM: BACKUP DATABASE successfully processed 38614911 pages in 4701.432 seconds (64.167 MB/sec).
10/1/2012 9:27:18 PM: Copied u:\sql_backup\Oct_01_2012_SMSPHdsshak0_FULL.sqb to \\myhouse.org\dfsmis\sqlback02\Warehouse63\Oct_01_2012_SMSPHdsshak0_FULL.sqb.
10/1/2012 9:27:18 PM: SQL Backup process ended.

10/1/2012 9:27:18 PM: Deleted msdb entries older than 7/3/2012 9:27:18 PM
10/1/2012 9:27:19 PM: Deleted local history entries older than 7/3/2012 9:27:18 PM
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2299

PostPosted: Wed Oct 03, 2012 3:13 am    Post subject: Reply with quote

ERASEFILES_ATSTART looks in the folders used in the backup command. However, it compares the completion timestamp of the file against the current time, not the creation timestamp.

Looking at the log you posted, it looks like your backups take about 1.5 hrs to complete. In this case, you would need to use an ERASEFILES_ATSTART value of 22h.
_________________
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
Back to top
View user's profile Send private message Send e-mail
Randy Doub



Joined: 28 Jan 2008
Posts: 19

PostPosted: Wed Oct 03, 2012 2:52 pm    Post subject: Reply with quote

Thank you very much.
Back to top
View user's profile Send private message
Randy Doub



Joined: 28 Jan 2008
Posts: 19

PostPosted: Thu Oct 04, 2012 1:35 pm    Post subject: Reply with quote

This large db has no activity at night when I run the full backup so I added THREADCOUNT = 10 (of possible 16), upped compression from 3 to 4, and knocked 45 minutes off the backup time and 16GB off the backup file. SQL Backup Pro really is a robust product.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group