Showing posts with label maintance. Show all posts
Showing posts with label maintance. Show all posts

Tuesday, March 20, 2012

Bakup dosen't delete files

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

Friday, February 24, 2012

Backup/Restore Status

Very often I have to do large backup and restores. This is either done via jobs, or the SQL Maintance tools. Neither so any status of a backup/restore. Overall progress, bytes written, etc. EM when backing up or restoring does show a GUI progress bar that isn't perfect, but does show progress to some extent.
So far I can look in the sysprocesses tables and find what spid is running the command, but that doesn't tell me much. The console command line util is for tape backups. Is there anything that can monitor the progress of backups and restores.
Thanks,
ETThe native SQL Server BACKUP and RESTORE commands have a STATUS parameter,
that when specified, returns status messages, indicating the progress of the
backup/restore operation.
Here's an example:
RESTORE DATABASE YourDB FROM DISK='\\SomePath\SomeFile.BAK' WITH STATUS = 1
See, SQL Server Books Online for more information.
Note that, even after specifying the STATUS with BACKUP or RESTORE command,
you will not see any progress messages coming up, while SQL Server is
creating the file.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
What hardware is your SQL Server running on?
http://vyaskn.tripod.com/poll.htm
"Twiggy" <etwilegar@.nospamttgonline.com> wrote in message
news:D4500856-A29C-44EF-A7E8-828D7F6DDBCD@.microsoft.com...
Very often I have to do large backup and restores. This is either done via
jobs, or the SQL Maintance tools. Neither so any status of a backup/restore.
Overall progress, bytes written, etc. EM when backing up or restoring does
show a GUI progress bar that isn't perfect, but does show progress to some
extent.
So far I can look in the sysprocesses tables and find what spid is running
the command, but that doesn't tell me much. The console command line util is
for tape backups. Is there anything that can monitor the progress of
backups and restores.
Thanks,
ET|||Well I knew that EM was doing this and grabbing the results. In this case I'm not in control of the actual restore command. The command is already running, is there a way for another connection to get status on the operation. Is there a system table that information is written to?|||No Twiggy, there is not...
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Twiggy" <etwilegar@.ttgonline.com> wrote in message
news:72E2D27A-36B1-4013-94D8-04A60F0A8782@.microsoft.com...
> Well I knew that EM was doing this and grabbing the results. In this case
I'm not in control of the actual restore command. The command is already
running, is there a way for another connection to get status on the
operation. Is there a system table that information is written to?
>|||I find this really weird. I wonder how the heck their internal developers debug backup/restore issues. I guess the code for backup and restoring hasn't changed a lot since 7, but still I'm sure there is a switch that would turn on logging of some sort. I'd hate to be the guy that had to write the Enterprise manager code, parsing the text output from restore with status.
Guess I'll wait for mirroring.