When using SQLserver to take backup throw a maintance plan
i've selected to delete files older that 2 day's this
dosent hapen. Why?Thanks that solved the problem!!!
>--Original Message--
>Deleting th files is the last thing the plan does so if
your backup fails it
>won't delete the files.
>Here is a very good summary of the possible issues with
that from Bill at
>MS:
>
>-- Log files don't delete --
>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.
>
>--
>--
>Allan Mitchell (Microsoft SQL Server MVP)
>MCSE,MCDBA
>www.SQLDTS.com
>I support PASS - the definitive, global community
>for SQL Server professionals - http://www.sqlpass.org
>
>"Fredrik" <fredrik.ehrenholm@.proserva.com> wrote in
message
>news:073801c36569$dcbb26d0$a301280a@.phx.gbl...
>> When using SQLserver to take backup throw a maintance
plan
>> i've selected to delete files older that 2 day's this
>> dosent hapen. Why?
>
>.
>
Showing posts with label bakup. Show all posts
Showing posts with label bakup. Show all posts
Tuesday, March 20, 2012
Monday, February 13, 2012
BACKUP WITH RETAINDAYS
How can I delete from a bakup all expired backups.
I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still there
and the backup file grows very fast.
Sorin SanduI had a similar issue... ...although we have bags of disk space, we don't
have bags of space on our tapes.
We have full backups, differential backups and transaction log backups, the
full backup occurs once a week.. ..I have a vb script that runs before the
full backup that moves the existing .bak file to a subfolder and deletes the
previous .bak file, then the backup creates a new clean .bak file.. ..I end
up having 2 weeks on hand on the disk, and the current backup archived to
tape nightly.
"Sorin Sandu" wrote:
> How can I delete from a bakup all expired backups.
> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still ther
e
> and the backup file grows very fast.
> Sorin Sandu
>
>|||I understand that but what use has then RETAINDAYS OR EXPIREDATE '
"BenUK" <BenUK@.discussions.microsoft.com> wrote in message
news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...[vbcol=seagreen]
>I had a similar issue... ...although we have bags of disk space, we don't
> have bags of space on our tapes.
> We have full backups, differential backups and transaction log backups,
> the
> full backup occurs once a week.. ..I have a vb script that runs before the
> full backup that moves the existing .bak file to a subfolder and deletes
> the
> previous .bak file, then the backup creates a new clean .bak file.. ..I
> end
> up having 2 weeks on hand on the disk, and the current backup archived to
> tape nightly.
> "Sorin Sandu" wrote:
>|||I was under the impression retaindays and expiredate restrict sql from
overwriting the backup, not flaging the backup to be overwritten, therefore
if there's additional space it won't overwrite it by default...
"Sorin Sandu" wrote:
> I understand that but what use has then RETAINDAYS OR EXPIREDATE '
> "BenUK" <BenUK@.discussions.microsoft.com> wrote in message
> news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
>
>|||Little use. It just won't allow you to do INIT before the specified date/tim
e. Like not putting in
the wrong tape by mistake and overwrite a log backup that would break the lo
g backup chain.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Sorin Sandu" <jbilau@.yahoo.com> wrote in message news:%23XwwQMhaGHA.4060@.TK2MSFTNGP02.phx.g
bl...
>I understand that but what use has then RETAINDAYS OR EXPIREDATE '
> "BenUK" <BenUK@.discussions.microsoft.com> wrote in message
> news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
>
I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still there
and the backup file grows very fast.
Sorin SanduI had a similar issue... ...although we have bags of disk space, we don't
have bags of space on our tapes.
We have full backups, differential backups and transaction log backups, the
full backup occurs once a week.. ..I have a vb script that runs before the
full backup that moves the existing .bak file to a subfolder and deletes the
previous .bak file, then the backup creates a new clean .bak file.. ..I end
up having 2 weeks on hand on the disk, and the current backup archived to
tape nightly.
"Sorin Sandu" wrote:
> How can I delete from a bakup all expired backups.
> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still ther
e
> and the backup file grows very fast.
> Sorin Sandu
>
>|||I understand that but what use has then RETAINDAYS OR EXPIREDATE '
"BenUK" <BenUK@.discussions.microsoft.com> wrote in message
news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...[vbcol=seagreen]
>I had a similar issue... ...although we have bags of disk space, we don't
> have bags of space on our tapes.
> We have full backups, differential backups and transaction log backups,
> the
> full backup occurs once a week.. ..I have a vb script that runs before the
> full backup that moves the existing .bak file to a subfolder and deletes
> the
> previous .bak file, then the backup creates a new clean .bak file.. ..I
> end
> up having 2 weeks on hand on the disk, and the current backup archived to
> tape nightly.
> "Sorin Sandu" wrote:
>|||I was under the impression retaindays and expiredate restrict sql from
overwriting the backup, not flaging the backup to be overwritten, therefore
if there's additional space it won't overwrite it by default...
"Sorin Sandu" wrote:
> I understand that but what use has then RETAINDAYS OR EXPIREDATE '
> "BenUK" <BenUK@.discussions.microsoft.com> wrote in message
> news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
>
>|||Little use. It just won't allow you to do INIT before the specified date/tim
e. Like not putting in
the wrong tape by mistake and overwrite a log backup that would break the lo
g backup chain.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Sorin Sandu" <jbilau@.yahoo.com> wrote in message news:%23XwwQMhaGHA.4060@.TK2MSFTNGP02.phx.g
bl...
>I understand that but what use has then RETAINDAYS OR EXPIREDATE '
> "BenUK" <BenUK@.discussions.microsoft.com> wrote in message
> news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
>
BACKUP WITH RETAINDAYS
How can I delete from a bakup all expired backups.
I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still there
and the backup file grows very fast.
Sorin SanduI had a similar issue... ...although we have bags of disk space, we don't
have bags of space on our tapes.
We have full backups, differential backups and transaction log backups, the
full backup occurs once a week.. ..I have a vb script that runs before the
full backup that moves the existing .bak file to a subfolder and deletes the
previous .bak file, then the backup creates a new clean .bak file.. ..I end
up having 2 weeks on hand on the disk, and the current backup archived to
tape nightly.
"Sorin Sandu" wrote:
> How can I delete from a bakup all expired backups.
> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still there
> and the backup file grows very fast.
> Sorin Sandu
>
>|||I understand that but what use has then RETAINDAYS OR EXPIREDATE '
"BenUK" <BenUK@.discussions.microsoft.com> wrote in message
news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
>I had a similar issue... ...although we have bags of disk space, we don't
> have bags of space on our tapes.
> We have full backups, differential backups and transaction log backups,
> the
> full backup occurs once a week.. ..I have a vb script that runs before the
> full backup that moves the existing .bak file to a subfolder and deletes
> the
> previous .bak file, then the backup creates a new clean .bak file.. ..I
> end
> up having 2 weeks on hand on the disk, and the current backup archived to
> tape nightly.
> "Sorin Sandu" wrote:
>> How can I delete from a bakup all expired backups.
>> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still
>> there
>> and the backup file grows very fast.
>> Sorin Sandu
>>|||I was under the impression retaindays and expiredate restrict sql from
overwriting the backup, not flaging the backup to be overwritten, therefore
if there's additional space it won't overwrite it by default...
"Sorin Sandu" wrote:
> I understand that but what use has then RETAINDAYS OR EXPIREDATE '
> "BenUK" <BenUK@.discussions.microsoft.com> wrote in message
> news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
> >I had a similar issue... ...although we have bags of disk space, we don't
> > have bags of space on our tapes.
> > We have full backups, differential backups and transaction log backups,
> > the
> > full backup occurs once a week.. ..I have a vb script that runs before the
> > full backup that moves the existing .bak file to a subfolder and deletes
> > the
> > previous .bak file, then the backup creates a new clean .bak file.. ..I
> > end
> > up having 2 weeks on hand on the disk, and the current backup archived to
> > tape nightly.
> >
> > "Sorin Sandu" wrote:
> >
> >> How can I delete from a bakup all expired backups.
> >> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still
> >> there
> >> and the backup file grows very fast.
> >> Sorin Sandu
> >>
> >>
> >>
>
>|||Little use. It just won't allow you to do INIT before the specified date/time. Like not putting in
the wrong tape by mistake and overwrite a log backup that would break the log backup chain.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Sorin Sandu" <jbilau@.yahoo.com> wrote in message news:%23XwwQMhaGHA.4060@.TK2MSFTNGP02.phx.gbl...
>I understand that but what use has then RETAINDAYS OR EXPIREDATE '
> "BenUK" <BenUK@.discussions.microsoft.com> wrote in message
> news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
>>I had a similar issue... ...although we have bags of disk space, we don't
>> have bags of space on our tapes.
>> We have full backups, differential backups and transaction log backups, the
>> full backup occurs once a week.. ..I have a vb script that runs before the
>> full backup that moves the existing .bak file to a subfolder and deletes the
>> previous .bak file, then the backup creates a new clean .bak file.. ..I end
>> up having 2 weeks on hand on the disk, and the current backup archived to
>> tape nightly.
>> "Sorin Sandu" wrote:
>> How can I delete from a bakup all expired backups.
>> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still there
>> and the backup file grows very fast.
>> Sorin Sandu
>>
>
I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still there
and the backup file grows very fast.
Sorin SanduI had a similar issue... ...although we have bags of disk space, we don't
have bags of space on our tapes.
We have full backups, differential backups and transaction log backups, the
full backup occurs once a week.. ..I have a vb script that runs before the
full backup that moves the existing .bak file to a subfolder and deletes the
previous .bak file, then the backup creates a new clean .bak file.. ..I end
up having 2 weeks on hand on the disk, and the current backup archived to
tape nightly.
"Sorin Sandu" wrote:
> How can I delete from a bakup all expired backups.
> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still there
> and the backup file grows very fast.
> Sorin Sandu
>
>|||I understand that but what use has then RETAINDAYS OR EXPIREDATE '
"BenUK" <BenUK@.discussions.microsoft.com> wrote in message
news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
>I had a similar issue... ...although we have bags of disk space, we don't
> have bags of space on our tapes.
> We have full backups, differential backups and transaction log backups,
> the
> full backup occurs once a week.. ..I have a vb script that runs before the
> full backup that moves the existing .bak file to a subfolder and deletes
> the
> previous .bak file, then the backup creates a new clean .bak file.. ..I
> end
> up having 2 weeks on hand on the disk, and the current backup archived to
> tape nightly.
> "Sorin Sandu" wrote:
>> How can I delete from a bakup all expired backups.
>> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still
>> there
>> and the backup file grows very fast.
>> Sorin Sandu
>>|||I was under the impression retaindays and expiredate restrict sql from
overwriting the backup, not flaging the backup to be overwritten, therefore
if there's additional space it won't overwrite it by default...
"Sorin Sandu" wrote:
> I understand that but what use has then RETAINDAYS OR EXPIREDATE '
> "BenUK" <BenUK@.discussions.microsoft.com> wrote in message
> news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
> >I had a similar issue... ...although we have bags of disk space, we don't
> > have bags of space on our tapes.
> > We have full backups, differential backups and transaction log backups,
> > the
> > full backup occurs once a week.. ..I have a vb script that runs before the
> > full backup that moves the existing .bak file to a subfolder and deletes
> > the
> > previous .bak file, then the backup creates a new clean .bak file.. ..I
> > end
> > up having 2 weeks on hand on the disk, and the current backup archived to
> > tape nightly.
> >
> > "Sorin Sandu" wrote:
> >
> >> How can I delete from a bakup all expired backups.
> >> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still
> >> there
> >> and the backup file grows very fast.
> >> Sorin Sandu
> >>
> >>
> >>
>
>|||Little use. It just won't allow you to do INIT before the specified date/time. Like not putting in
the wrong tape by mistake and overwrite a log backup that would break the log backup chain.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Sorin Sandu" <jbilau@.yahoo.com> wrote in message news:%23XwwQMhaGHA.4060@.TK2MSFTNGP02.phx.gbl...
>I understand that but what use has then RETAINDAYS OR EXPIREDATE '
> "BenUK" <BenUK@.discussions.microsoft.com> wrote in message
> news:BB966444-1A6A-4CFB-9857-D79A264C7F8C@.microsoft.com...
>>I had a similar issue... ...although we have bags of disk space, we don't
>> have bags of space on our tapes.
>> We have full backups, differential backups and transaction log backups, the
>> full backup occurs once a week.. ..I have a vb script that runs before the
>> full backup that moves the existing .bak file to a subfolder and deletes the
>> previous .bak file, then the backup creates a new clean .bak file.. ..I end
>> up having 2 weeks on hand on the disk, and the current backup archived to
>> tape nightly.
>> "Sorin Sandu" wrote:
>> How can I delete from a bakup all expired backups.
>> I am using BACKUP WITH RETAINDAYS=5 but all expired backups are still there
>> and the backup file grows very fast.
>> Sorin Sandu
>>
>
Subscribe to:
Posts (Atom)