Sunday, February 12, 2012

Backup in a file and retention

Hi,
I backup a database SQL 2005 Express Edition, with this command :
BACKUP DATABASE [mSuite] TO DISK = N'E:\BackupSQL\Backup-mSuite.bak' WITH
RETAINDAYS = 21, NOFORMAT, NOINIT, NAME = N'mSuite-Full Database Backup',
SKIP, NOREWIND, NOUNLOAD, STATS = 10
I would like to know if one option can erase old backup (expired backup ) in
the backup file ?
Thanks in advance,
Gilles
> I would like to know if one option can erase old backup (expired backup )
> in
> the backup file ?
You can overwrite the entire backup file by specifying INIT instead of
NOINIT. You will also need to specify FORMAT instead of NOFORMAT if the
target backup file contains unexpired backups.
If you objective is to keep a rolling set of the most recent backups, you'll
need create a new backup each day and delete the oldest backup file.
Hope this helps.
Dan Guzman
SQL Server MVP
"Gilles" <Gilles@.discussions.microsoft.com> wrote in message
news:139F95E2-6005-47BF-974D-56612F8110BF@.microsoft.com...
> Hi,
> I backup a database SQL 2005 Express Edition, with this command :
> BACKUP DATABASE [mSuite] TO DISK = N'E:\BackupSQL\Backup-mSuite.bak' WITH
> RETAINDAYS = 21, NOFORMAT, NOINIT, NAME = N'mSuite-Full Database Backup',
> SKIP, NOREWIND, NOUNLOAD, STATS = 10
> I would like to know if one option can erase old backup (expired backup )
> in
> the backup file ?
> Thanks in advance,
> --
> Gilles
|||Hi Dan,
Thanks for this information.
Gilles
"Dan Guzman" wrote:

> You can overwrite the entire backup file by specifying INIT instead of
> NOINIT. You will also need to specify FORMAT instead of NOFORMAT if the
> target backup file contains unexpired backups.
> If you objective is to keep a rolling set of the most recent backups, you'll
> need create a new backup each day and delete the oldest backup file.
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Gilles" <Gilles@.discussions.microsoft.com> wrote in message
> news:139F95E2-6005-47BF-974D-56612F8110BF@.microsoft.com...
>

No comments:

Post a Comment