Showing posts with label retention. Show all posts
Showing posts with label retention. Show all posts

Thursday, March 22, 2012

Backup retention problem

Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
..BAK files older than 1 day ?
Thanks
http://support.microsoft.com/default...b;en-us;303292
-- Log files don't delete --
http://support.microsoft.com/default...;en-us;Q303292
This is likely to be either a permissions problem or a sharing violation
problem. The maintenance plan is run as a job, and jobs are run by the
SQLServerAgent service.
Permissions:
1. Determine the startup account for the SQLServerAgent service
(Start|Programs|Administrative tools|Services|SQLServerAgent|Startup). This
account is the security context for jobs, and thus the maintenance plan.
2. If SQLServerAgent is started using LocalSystem (as opposed to a domain
account) then skip step 3.
3. On that box, log onto NT as that account. Using Explorer, attempt to
delete an expired backup. If that succeeds then go to Sharing Violation
section.
4. Log onto NT with an account that is an administrator and use Explorer to
look at the Properties|Security of the folder (where the backups reside)
and ensure the SQLServerAgent startup account has Full Control. If the
SQLServerAgent startup account is LocalSystem, then the account to consider
is SYSTEM.
5. In NT, if an account is a member of an NT group, and if that group has
Access is Denied, then that account will have Access is Denied, even if
that account is also a member of the Administrators group. Thus you may
need to check group permissions (if the Startup Account is a member of a
group).
6. Keep in mind that permissions (by default) are inherited from a parent
folder. Thus, if the backups are stored in C:\bak, and if someone had
denied permission to the SQLServerAgent startup account for C:\, then
C:\bak will inherit access is denied.
Sharing violation:
This is likely to be rooted in a timing issue, with the most likely cause
being another scheduled process (such as NT Backup or Anti-Virus software)
having the backup file open at the time when the SQLServerAgent (i.e., the
maintenance plan job) tried to delete it.
1. Download filemon and handle from www.sysinternals.com.
2. I am not sure whether filemon can be scheduled, or you might be able to
use NT scheduling services to start filemon just before the maintenance
plan job is started, but the filemon log can become very large, so it would
be best to start it some short time before the maintenance plan starts.
3. Inspect the filemon log for another process that has that backup file
open (if your lucky enough to have started filemon before this other
process grabs the backup folder), and inspect the log for the results when
the SQLServerAgent agent attempts to open that same file.
4. Schedule the job or that other process to do their work at different
times.
5. You can use the handle utility if you are around at the time when the
job is scheduled to run.
If the backup files are going to a \\share or a mapped drive (as opposed to
local drive), then you will need to modify the above (with respect to where
the tests and utilities are run).
Finally, inspection of the maintenance plan's history report might be
useful.
Thanks,
Bill Hollinshead
Microsoft, SQL Server
Andrew J. Kelly SQL MVP
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's
> folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete
> the
> .BAK files older than 1 day ?
> Thanks
|||Hi,
If you have a mapi e-mail you can have a notification when the job fails.
Probably your status is that the job failed. You can install outlook 2000 or
outlook 2003 and create a new account for sending mails as f.e Database Admin.
Additionally, you can go to the maintenance plan properties and in the
Reporting tab you can tick the check box Write report a text file in
directory or any other option.
Hope that helped
Andreas
"Psa555" wrote:

> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete the
> .BAK files older than 1 day ?
> Thanks
|||Because 1 day = 24 hours, exactly. If you job is off schedule or takes a
little longer to run than the prior day, even if by 1 minute, the time
stamps are only 23 hours, 59 minutes, etc., which is NOT 1 day.
I usually code mine to delete anything older than 3 hours. When it runs, it
will run the backup or reorg operation first, then it will check for files
to delete.
Sincerely,
Anthony Thomas

"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
..BAK files older than 1 day ?
Thanks
sql

Backup retention problem

Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
.BAK files older than 1 day ?
Thankshttp://support.microsoft.com/defaul...kb;en-us;303292
-- Log files don't delete --
http://support.microsoft.com/defaul...b;en-us;Q303292
This is likely to be either a permissions problem or a sharing violation
problem. The maintenance plan is run as a job, and jobs are run by the
SQLServerAgent service.
Permissions:
1. Determine the startup account for the SQLServerAgent service
(Start|Programs|Administrative tools|Services|SQLServerAgent|Startup). This
account is the security context for jobs, and thus the maintenance plan.
2. If SQLServerAgent is started using LocalSystem (as opposed to a domain
account) then skip step 3.
3. On that box, log onto NT as that account. Using Explorer, attempt to
delete an expired backup. If that succeeds then go to Sharing Violation
section.
4. Log onto NT with an account that is an administrator and use Explorer to
look at the Properties|Security of the folder (where the backups reside)
and ensure the SQLServerAgent startup account has Full Control. If the
SQLServerAgent startup account is LocalSystem, then the account to consider
is SYSTEM.
5. In NT, if an account is a member of an NT group, and if that group has
Access is Denied, then that account will have Access is Denied, even if
that account is also a member of the Administrators group. Thus you may
need to check group permissions (if the Startup Account is a member of a
group).
6. Keep in mind that permissions (by default) are inherited from a parent
folder. Thus, if the backups are stored in C:\bak, and if someone had
denied permission to the SQLServerAgent startup account for C:\, then
C:\bak will inherit access is denied.
Sharing violation:
This is likely to be rooted in a timing issue, with the most likely cause
being another scheduled process (such as NT Backup or Anti-Virus software)
having the backup file open at the time when the SQLServerAgent (i.e., the
maintenance plan job) tried to delete it.
1. Download filemon and handle from www.sysinternals.com.
2. I am not sure whether filemon can be scheduled, or you might be able to
use NT scheduling services to start filemon just before the maintenance
plan job is started, but the filemon log can become very large, so it would
be best to start it some short time before the maintenance plan starts.
3. Inspect the filemon log for another process that has that backup file
open (if your lucky enough to have started filemon before this other
process grabs the backup folder), and inspect the log for the results when
the SQLServerAgent agent attempts to open that same file.
4. Schedule the job or that other process to do their work at different
times.
5. You can use the handle utility if you are around at the time when the
job is scheduled to run.
If the backup files are going to a \\share or a mapped drive (as opposed to
local drive), then you will need to modify the above (with respect to where
the tests and utilities are run).
Finally, inspection of the maintenance plan's history report might be
useful.
Thanks,
Bill Hollinshead
Microsoft, SQL Server
Andrew J. Kelly SQL MVP
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's
> folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete
> the
> .BAK files older than 1 day ?
> Thanks|||Hi,
If you have a mapi e-mail you can have a notification when the job fails.
Probably your status is that the job failed. You can install outlook 2000 or
outlook 2003 and create a new account for sending mails as f.e Database Admi
n.
Additionally, you can go to the maintenance plan properties and in the
Reporting tab you can tick the check box Write report a text file in
directory or any other option.
Hope that helped
Andreas
"Psa555" wrote:

> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folde
r
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete th
e
> .BAK files older than 1 day ?
> Thanks|||Because 1 day = 24 hours, exactly. If you job is off schedule or takes a
little longer to run than the prior day, even if by 1 minute, the time
stamps are only 23 hours, 59 minutes, etc., which is NOT 1 day.
I usually code mine to delete anything older than 3 hours. When it runs, it
will run the backup or reorg operation first, then it will check for files
to delete.
Sincerely,
Anthony Thomas
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
.BAK files older than 1 day ?
Thanks

Backup retention problem

Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
.BAK files older than 1 day ?
Thankshttp://support.microsoft.com/default.aspx?scid=kb;en-us;303292
-- Log files don't delete --
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q303292
This is likely to be either a permissions problem or a sharing violation
problem. The maintenance plan is run as a job, and jobs are run by the
SQLServerAgent service.
Permissions:
1. Determine the startup account for the SQLServerAgent service
(Start|Programs|Administrative tools|Services|SQLServerAgent|Startup). This
account is the security context for jobs, and thus the maintenance plan.
2. If SQLServerAgent is started using LocalSystem (as opposed to a domain
account) then skip step 3.
3. On that box, log onto NT as that account. Using Explorer, attempt to
delete an expired backup. If that succeeds then go to Sharing Violation
section.
4. Log onto NT with an account that is an administrator and use Explorer to
look at the Properties|Security of the folder (where the backups reside)
and ensure the SQLServerAgent startup account has Full Control. If the
SQLServerAgent startup account is LocalSystem, then the account to consider
is SYSTEM.
5. In NT, if an account is a member of an NT group, and if that group has
Access is Denied, then that account will have Access is Denied, even if
that account is also a member of the Administrators group. Thus you may
need to check group permissions (if the Startup Account is a member of a
group).
6. Keep in mind that permissions (by default) are inherited from a parent
folder. Thus, if the backups are stored in C:\bak, and if someone had
denied permission to the SQLServerAgent startup account for C:\, then
C:\bak will inherit access is denied.
Sharing violation:
This is likely to be rooted in a timing issue, with the most likely cause
being another scheduled process (such as NT Backup or Anti-Virus software)
having the backup file open at the time when the SQLServerAgent (i.e., the
maintenance plan job) tried to delete it.
1. Download filemon and handle from www.sysinternals.com.
2. I am not sure whether filemon can be scheduled, or you might be able to
use NT scheduling services to start filemon just before the maintenance
plan job is started, but the filemon log can become very large, so it would
be best to start it some short time before the maintenance plan starts.
3. Inspect the filemon log for another process that has that backup file
open (if your lucky enough to have started filemon before this other
process grabs the backup folder), and inspect the log for the results when
the SQLServerAgent agent attempts to open that same file.
4. Schedule the job or that other process to do their work at different
times.
5. You can use the handle utility if you are around at the time when the
job is scheduled to run.
If the backup files are going to a \\share or a mapped drive (as opposed to
local drive), then you will need to modify the above (with respect to where
the tests and utilities are run).
Finally, inspection of the maintenance plan's history report might be
useful.
Thanks,
Bill Hollinshead
Microsoft, SQL Server
--
Andrew J. Kelly SQL MVP
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's
> folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete
> the
> .BAK files older than 1 day ?
> Thanks|||Hi,
If you have a mapi e-mail you can have a notification when the job fails.
Probably your status is that the job failed. You can install outlook 2000 or
outlook 2003 and create a new account for sending mails as f.e Database Admin.
Additionally, you can go to the maintenance plan properties and in the
Reporting tab you can tick the check box Write report a text file in
directory or any other option.
Hope that helped
Andreas
"Psa555" wrote:
> Hi,
> In my full backup maintenance Plan, I configured 1 day in a box 'Remove
> files older than : "
> The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
> older than 1 day.
> Why the maintenance Plan does'nt remove those files ?
> What can cause this ?
> How can I be alert by SQL if the maintenance plan is not able to delete the
> .BAK files older than 1 day ?
> Thanks|||Because 1 day = 24 hours, exactly. If you job is off schedule or takes a
little longer to run than the prior day, even if by 1 minute, the time
stamps are only 23 hours, 59 minutes, etc., which is NOT 1 day.
I usually code mine to delete anything older than 3 hours. When it runs, it
will run the backup or reorg operation first, then it will check for files
to delete.
Sincerely,
Anthony Thomas
"Psa555" <Psa555@.discussions.microsoft.com> wrote in message
news:34A86E28-127A-4A50-B857-EF729A401790@.microsoft.com...
Hi,
In my full backup maintenance Plan, I configured 1 day in a box 'Remove
files older than : "
The problem is ... sometimes I have 3 or 4 files .BAK in my backup's folder
older than 1 day.
Why the maintenance Plan does'nt remove those files ?
What can cause this ?
How can I be alert by SQL if the maintenance plan is not able to delete the
.BAK files older than 1 day ?
Thanks

Backup retention period Setting

In sql2005 the database backup retention has been added in sql server properties in database setting.

In 2000 we had a comfortable option to set retention based on maintenance plan,files and also our space availabilty.It has helped the dba's a lot.But it has been removed in sql 2005.

Is that sql server setting is the only retention period setting or do we have to set in anyother tabs..

Thanks

There are two places where backup retention is specified:

First, as you discovered, there is an instance-wide default setting for backup media retention.

Secondly, that value can be overridden for any backup operation by using the "BACKUP DATABASE WITH EXPIREDATE = " option. or the WITH RETAINDAYS option.

Thus, you can specify for each backup, and each backup job, what the retention should be.

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:
> > 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
>

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' WI
TH
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...
>

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...
>