Showing posts with label plan. Show all posts
Showing posts with label plan. Show all posts

Wednesday, March 21, 2012

many problems, fixed?

Hi All-
SQL7.0 SP0 NT4. I was brought in to help fix this database, backups are
there, but corruption has been in the maintenance plan log for over a year.
I made backup of db and restored as different name on different disk array.
I ran DBCC CHECKDB on database, it reported 17,000+ consistency errors. I
next rebuilt indexes and ran CHECKDB again. Dropped errors to 202. Ran
CHECKDB with repair_rebuild option. This corrected some errors, now I am
down to 94. Since it was a copy I gave it a shot and ran CHECKDB with
repair_allow_data_loss option. After this ran, CHECKDB reports 0 errors. I
have compared row count on corrupt tables before and after the data_loss
option ran and my row count is the same before and after.
What else do I need to look at to see what data was loss with the
repair_data_loss option?
After ths is correct I will be working with the owner and app vendor to get
the sql and os at least patched to current levels if not upgraded.
Thanks!
I suppose you could check the size of the database and the number of indexes
in it. It doesn't sound like you have much of a choice but to go with the
repaired database anyway.
Good luck...
Ben
"Ryan Sanders" <rsanders> wrote in message
news:108nd8uapvjvbb2@.corp.supernews.com...
> Hi All-
>
> SQL7.0 SP0 NT4. I was brought in to help fix this database, backups are
> there, but corruption has been in the maintenance plan log for over a
year.
> I made backup of db and restored as different name on different disk
array.
> I ran DBCC CHECKDB on database, it reported 17,000+ consistency errors. I
> next rebuilt indexes and ran CHECKDB again. Dropped errors to 202. Ran
> CHECKDB with repair_rebuild option. This corrected some errors, now I am
> down to 94. Since it was a copy I gave it a shot and ran CHECKDB with
> repair_allow_data_loss option. After this ran, CHECKDB reports 0 errors.
I
> have compared row count on corrupt tables before and after the data_loss
> option ran and my row count is the same before and after.
>
> What else do I need to look at to see what data was loss with the
> repair_data_loss option?
>
> After ths is correct I will be working with the owner and app vendor to
get
> the sql and os at least patched to current levels if not upgraded.
>
> Thanks!
>
|||Can anyone provide any guidance?
Thanks!
Ryan
"Ryan Sanders" <rsanders> wrote in message news:<108nd8uapvjvbb2@.corp.supernews.com>...
> Hi All-
>
> SQL7.0 SP0 NT4. I was brought in to help fix this database, backups are
> there, but corruption has been in the maintenance plan log for over a year.
> I made backup of db and restored as different name on different disk array.
> I ran DBCC CHECKDB on database, it reported 17,000+ consistency errors. I
> next rebuilt indexes and ran CHECKDB again. Dropped errors to 202. Ran
> CHECKDB with repair_rebuild option. This corrected some errors, now I am
> down to 94. Since it was a copy I gave it a shot and ran CHECKDB with
> repair_allow_data_loss option. After this ran, CHECKDB reports 0 errors. I
> have compared row count on corrupt tables before and after the data_loss
> option ran and my row count is the same before and after.
>
> What else do I need to look at to see what data was loss with the
> repair_data_loss option?
>
> After ths is correct I will be working with the owner and app vendor to get
> the sql and os at least patched to current levels if not upgraded.
>
> Thanks!

many problems, fixed?

Hi All-
SQL7.0 SP0 NT4. I was brought in to help fix this database, backups are
there, but corruption has been in the maintenance plan log for over a year.
I made backup of db and restored as different name on different disk array.
I ran DBCC CHECKDB on database, it reported 17,000+ consistency errors. I
next rebuilt indexes and ran CHECKDB again. Dropped errors to 202. Ran
CHECKDB with repair_rebuild option. This corrected some errors, now I am
down to 94. Since it was a copy I gave it a shot and ran CHECKDB with
repair_allow_data_loss option. After this ran, CHECKDB reports 0 errors. I
have compared row count on corrupt tables before and after the data_loss
option ran and my row count is the same before and after.
What else do I need to look at to see what data was loss with the
repair_data_loss option?
After ths is correct I will be working with the owner and app vendor to get
the sql and os at least patched to current levels if not upgraded.
Thanks!I suppose you could check the size of the database and the number of indexes
in it. It doesn't sound like you have much of a choice but to go with the
repaired database anyway.
Good luck...
Ben
"Ryan Sanders" <rsanders> wrote in message
news:108nd8uapvjvbb2@.corp.supernews.com...
> Hi All-
>
> SQL7.0 SP0 NT4. I was brought in to help fix this database, backups are
> there, but corruption has been in the maintenance plan log for over a
year.
> I made backup of db and restored as different name on different disk
array.
> I ran DBCC CHECKDB on database, it reported 17,000+ consistency errors. I
> next rebuilt indexes and ran CHECKDB again. Dropped errors to 202. Ran
> CHECKDB with repair_rebuild option. This corrected some errors, now I am
> down to 94. Since it was a copy I gave it a shot and ran CHECKDB with
> repair_allow_data_loss option. After this ran, CHECKDB reports 0 errors.
I
> have compared row count on corrupt tables before and after the data_loss
> option ran and my row count is the same before and after.
>
> What else do I need to look at to see what data was loss with the
> repair_data_loss option?
>
> After ths is correct I will be working with the owner and app vendor to
get
> the sql and os at least patched to current levels if not upgraded.
>
> Thanks!
>|||Can anyone provide any guidance?
Thanks!
Ryan
"Ryan Sanders" <rsanders> wrote in message news:<108nd8uapvjvbb2@.corp.supernews.com>...
> Hi All-
>
> SQL7.0 SP0 NT4. I was brought in to help fix this database, backups are
> there, but corruption has been in the maintenance plan log for over a year.
> I made backup of db and restored as different name on different disk array.
> I ran DBCC CHECKDB on database, it reported 17,000+ consistency errors. I
> next rebuilt indexes and ran CHECKDB again. Dropped errors to 202. Ran
> CHECKDB with repair_rebuild option. This corrected some errors, now I am
> down to 94. Since it was a copy I gave it a shot and ran CHECKDB with
> repair_allow_data_loss option. After this ran, CHECKDB reports 0 errors. I
> have compared row count on corrupt tables before and after the data_loss
> option ran and my row count is the same before and after.
>
> What else do I need to look at to see what data was loss with the
> repair_data_loss option?
>
> After ths is correct I will be working with the owner and app vendor to get
> the sql and os at least patched to current levels if not upgraded.
>
> Thanks!

many problems, fixed?

Hi All-
SQL7.0 SP0 NT4. I was brought in to help fix this database, backups are
there, but corruption has been in the maintenance plan log for over a year.
I made backup of db and restored as different name on different disk array.
I ran DBCC CHECKDB on database, it reported 17,000+ consistency errors. I
next rebuilt indexes and ran CHECKDB again. Dropped errors to 202. Ran
CHECKDB with repair_rebuild option. This corrected some errors, now I am
down to 94. Since it was a copy I gave it a shot and ran CHECKDB with
repair_allow_data_loss option. After this ran, CHECKDB reports 0 errors. I
have compared row count on corrupt tables before and after the data_loss
option ran and my row count is the same before and after.
What else do I need to look at to see what data was loss with the
repair_data_loss option?
After ths is correct I will be working with the owner and app vendor to get
the sql and os at least patched to current levels if not upgraded.
Thanks!I suppose you could check the size of the database and the number of indexes
in it. It doesn't sound like you have much of a choice but to go with the
repaired database anyway.
Good luck...
Ben
"Ryan Sanders" <rsanders> wrote in message
news:108nd8uapvjvbb2@.corp.supernews.com...
> Hi All-
>
> SQL7.0 SP0 NT4. I was brought in to help fix this database, backups are
> there, but corruption has been in the maintenance plan log for over a
year.
> I made backup of db and restored as different name on different disk
array.
> I ran DBCC CHECKDB on database, it reported 17,000+ consistency errors. I
> next rebuilt indexes and ran CHECKDB again. Dropped errors to 202. Ran
> CHECKDB with repair_rebuild option. This corrected some errors, now I am
> down to 94. Since it was a copy I gave it a shot and ran CHECKDB with
> repair_allow_data_loss option. After this ran, CHECKDB reports 0 errors.
I
> have compared row count on corrupt tables before and after the data_loss
> option ran and my row count is the same before and after.
>
> What else do I need to look at to see what data was loss with the
> repair_data_loss option?
>
> After ths is correct I will be working with the owner and app vendor to
get
> the sql and os at least patched to current levels if not upgraded.
>
> Thanks!
>|||Can anyone provide any guidance?
Thanks!
Ryan
"Ryan Sanders" <rsanders> wrote in message news:<108nd8uapvjvbb2@.corp.supernews.com>...[vbco
l=seagreen]
> Hi All-
>
> SQL7.0 SP0 NT4. I was brought in to help fix this database, backups are
> there, but corruption has been in the maintenance plan log for over a year
.
> I made backup of db and restored as different name on different disk array
.
> I ran DBCC CHECKDB on database, it reported 17,000+ consistency errors. I
> next rebuilt indexes and ran CHECKDB again. Dropped errors to 202. Ran
> CHECKDB with repair_rebuild option. This corrected some errors, now I am
> down to 94. Since it was a copy I gave it a shot and ran CHECKDB with
> repair_allow_data_loss option. After this ran, CHECKDB reports 0 errors.
I
> have compared row count on corrupt tables before and after the data_loss
> option ran and my row count is the same before and after.
>
> What else do I need to look at to see what data was loss with the
> repair_data_loss option?
>
> After ths is correct I will be working with the owner and app vendor to ge
t
> the sql and os at least patched to current levels if not upgraded.
>
> Thanks![/vbcol]

Monday, March 19, 2012

Manually determine execution plan?

Hi- is it possible (and does it ever make sense), to manually determine a
query execution plan, instead of letting the optimizer do it. There are
certain times, when I think "well, I [think I] know that the best place to
start would be with choosing all matching rows from table a, because this
will narrow down the query most quickly, and because there is a perfect inde
x
available on table a..." And sometimes, what I think does not appear to be i
n
line with what the optimizer seems to think...
If it's possible and it makes sense, how does one do it?
ChrisLook up "hints" in Books Online. You can "guide" the optimizer through the
use of hints in the FROM clause.
There are plenty of details in Books Online.
You can declare which indexes to use, how to acquire locks, etc. However,
you need to be really careful there and add hints only if you think the
optimizer fails to select the most efficient execution plan for a diverse
selection of cases - e.g. if the optimizer fails to use the indexes on an
indexed view and performs data retrieval from the base tables, you could use
the NOEXPAND hint in the from clause.
This is a big issue, so read up on it in Books Online before drastically
affecting any production processes.
ML
http://milambda.blogspot.com/|||You know, I had looked at hints and thought it couldn't do what I wanted to
do; but looking again, I can see that I can do it exactly with "force order"
and "index =". Thanks a lot, I think this should make a major difference.
Chris
"ML" wrote:

> Look up "hints" in Books Online. You can "guide" the optimizer through the
> use of hints in the FROM clause.
> There are plenty of details in Books Online.
> You can declare which indexes to use, how to acquire locks, etc. However,
> you need to be really careful there and add hints only if you think the
> optimizer fails to select the most efficient execution plan for a diverse
> selection of cases - e.g. if the optimizer fails to use the indexes on an
> indexed view and performs data retrieval from the base tables, you could u
se
> the NOEXPAND hint in the from clause.
> This is a big issue, so read up on it in Books Online before drastically
> affecting any production processes.
>
> ML
> --
> http://milambda.blogspot.com/|||One more question re this; is there any way to specify in which order the
elements of the "where" clause are applied? I don't see anything like this.
Though I suppose maybe I could make a bunch of subqueries and then use the
FORCE ORDER'
Chris
"ML" wrote:

> Look up "hints" in Books Online. You can "guide" the optimizer through the
> use of hints in the FROM clause.
> There are plenty of details in Books Online.
> You can declare which indexes to use, how to acquire locks, etc. However,
> you need to be really careful there and add hints only if you think the
> optimizer fails to select the most efficient execution plan for a diverse
> selection of cases - e.g. if the optimizer fails to use the indexes on an
> indexed view and performs data retrieval from the base tables, you could u
se
> the NOEXPAND hint in the from clause.
> This is a big issue, so read up on it in Books Online before drastically
> affecting any production processes.
>
> ML
> --
> http://milambda.blogspot.com/|||AFAIK the optimizer is free to choose any order "he" sees fit as far as the
WHERE clause is concerned. I hope you're not using WHERE for joins...?
ML
http://milambda.blogspot.com/|||No there isn't. But depending on your intentions, the CASE expression
could achieve what you want.
Gert-Jan
querylous wrote:
> One more question re this; is there any way to specify in which order the
> elements of the "where" clause are applied? I don't see anything like this
.
> Though I suppose maybe I could make a bunch of subqueries and then use the
> FORCE ORDER'
> Chris
> "ML" wrote:
>|||How to use a case in this situation? Wouldn't this result in running a query
twice. Let's say I have table with a date and a value, and I want to find al
l
rows between date range x-y and values a-b. I know that there are very few
entries between dates x and y, but there are many rows with values a and b.
So, I want to make sure the query checks the date first, instead of the valu
e
(very simple example). How would I control this with a case?
"Gert-Jan Strik" wrote:

> No there isn't. But depending on your intentions, the CASE expression
> could achieve what you want.
> Gert-Jan
>
> querylous wrote:
>|||The query below will always check the date column first, and will only
check the value column if the data column is within range.
However, the query will probably not be able to use an index because of
this (complex) expression.
SELECT ...
FROM ...
WHERE CASE
WHEN my_date_column BETWEEN x AND y
THEN
CASE WHEN my_value_column BETWEEN a AND b
THEN 1
ELSE 0
END
ELSE 0
END = 1
Gert-Jan
querylous wrote:
> How to use a case in this situation? Wouldn't this result in running a que
ry
> twice. Let's say I have table with a date and a value, and I want to find
all
> rows between date range x-y and values a-b. I know that there are very few
> entries between dates x and y, but there are many rows with values a and b
.
> So, I want to make sure the query checks the date first, instead of the va
lue
> (very simple example). How would I control this with a case?
> "Gert-Jan Strik" wrote:
>|||Chris,
Assuming that the query conditions are straightfoward ranges that
indexes can be used for, the column statistics on the table will
give the optimizer enough information to make the best choice.
When the optimizer makes the wrong choice, there are
a lot of possibilities. Here are a few.
The query may have been autoparameterized. If it was first
run with ranges that made one query plan good, then run again
with changes only to the range endpoints, the query plan may
not be reevaluated. A compiled/cached plan from the earlier
execution will be used, and the query will not run efficiently.
This is a common occurrence. Search these groups for
"parameter sniffing" and "recompilation" for information.
It may not be the wrong choice. A selective index is not always
the best thing to use. If it's not a covering index, for example, using a
more selective index may incur other query processing costs (bookmark
operations, nonsequential disk access) that outweigh the selectivity.
It may be the wrong choice, but because of reasons the optimizer
is unable to evaluate (correlated columns or other questions of
the actual, not statistical, distribution of data).
Without seeing the actual query, the table and index definitions, an
idea of the data distribution, and the query plans (the optimizer's
plan and the better plan that exists), it's hard to say what might
be going on.
It's worth pointing out that in SQL Server 2005, you have
somewhat more control over this behavior. The OPTIMIZE
FOR option can be used to tell the optimizer to use statistics
for values other than the actual parameters in query ranges.
Here's an example of the same query with two different OPTIMIZE FOR
clauses, where you can see different plans:
declare @.from datetime
declare @.to datetime
set @.from = '19970101'
set @.to = '19970401'
select *
from Northwind..Orders
where OrderDate between @.from and @.to
and Freight between 10 and 20
option (optimize for (@.from='19970101', @.to='19980101'))
select *
from Northwind..Orders
where OrderDate between @.from and @.to
and Freight between 10 and 20
option (optimize for (@.from='19980101', @.to='19980101'))
Steve Kass
Drew University
querylous wrote:
>How to use a case in this situation? Wouldn't this result in running a quer
y
>twice. Let's say I have table with a date and a value, and I want to find a
ll
>rows between date range x-y and values a-b. I know that there are very few
>entries between dates x and y, but there are many rows with values a and b.
>So, I want to make sure the query checks the date first, instead of the val
ue
>(very simple example). How would I control this with a case?
>"Gert-Jan Strik" wrote:
>
>

Monday, March 12, 2012

Mantanace Plan not deleting old files

I have a maintanace Plan establishe that is working excep
for on nagging item. The plan does both full backups and
transaction log backups each day. It is supposed to
delete files older than 3 days old but does not. I have
to manually go and clear the old files on a regular basis
to keep from filling up the disk. I have not seen any
error or know what to look for to see if something is
wrong. I thought that if a full backup was done that it
emptyed the transaction logs but that dies not appear to
be the case either and is why I have the transition logs
in the mainance plan. Any information on how to get the
old fikes to delete?
Here is a good summary of the normal issues related to this by Bill from MS:
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
"Jim Abel" <jim.abel@.lmco.com> wrote in message
news:177f01c49cbe$504699e0$a301280a@.phx.gbl...
> I have a maintanace Plan establishe that is working excep
> for on nagging item. The plan does both full backups and
> transaction log backups each day. It is supposed to
> delete files older than 3 days old but does not. I have
> to manually go and clear the old files on a regular basis
> to keep from filling up the disk. I have not seen any
> error or know what to look for to see if something is
> wrong. I thought that if a full backup was done that it
> emptyed the transaction logs but that dies not appear to
> be the case either and is why I have the transition logs
> in the mainance plan. Any information on how to get the
> old fikes to delete?
|||i had the same problem. RIght-click on the maintenance plan and look at the
job history for any errors.
The problem I had was someone set up a maintenance plan to backup ALL
databases and to do transaction lo backups periodically. The trouble with
that is the system DBs (and any user DBs that are not set to FULL recovery
mode) cannot have Transaction log backups performed on them. So the Backups
were running, but the delete step was not running because the transaction log
backup step failed for some of the DBs.
hope that helps
"Andrew J. Kelly" wrote:

> Here is a good summary of the normal issues related to this by Bill from MS:
>
> 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
>
> "Jim Abel" <jim.abel@.lmco.com> wrote in message
> news:177f01c49cbe$504699e0$a301280a@.phx.gbl...
>
>

Mantanace Plan not deleting old files

I have a maintanace Plan establishe that is working excep
for on nagging item. The plan does both full backups and
transaction log backups each day. It is supposed to
delete files older than 3 days old but does not. I have
to manually go and clear the old files on a regular basis
to keep from filling up the disk. I have not seen any
error or know what to look for to see if something is
wrong. I thought that if a full backup was done that it
emptyed the transaction logs but that dies not appear to
be the case either and is why I have the transition logs
in the mainance plan. Any information on how to get the
old fikes to delete?Here is a good summary of the normal issues related to this by Bill from MS:
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
"Jim Abel" <jim.abel@.lmco.com> wrote in message
news:177f01c49cbe$504699e0$a301280a@.phx.gbl...
> I have a maintanace Plan establishe that is working excep
> for on nagging item. The plan does both full backups and
> transaction log backups each day. It is supposed to
> delete files older than 3 days old but does not. I have
> to manually go and clear the old files on a regular basis
> to keep from filling up the disk. I have not seen any
> error or know what to look for to see if something is
> wrong. I thought that if a full backup was done that it
> emptyed the transaction logs but that dies not appear to
> be the case either and is why I have the transition logs
> in the mainance plan. Any information on how to get the
> old fikes to delete?|||i had the same problem. RIght-click on the maintenance plan and look at the
job history for any errors.
The problem I had was someone set up a maintenance plan to backup ALL
databases and to do transaction lo backups periodically. The trouble with
that is the system DBs (and any user DBs that are not set to FULL recovery
mode) cannot have Transaction log backups performed on them. So the Backups
were running, but the delete step was not running because the transaction log
backup step failed for some of the DBs.
hope that helps
"Andrew J. Kelly" wrote:
> Here is a good summary of the normal issues related to this by Bill from MS:
>
> 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
>
> "Jim Abel" <jim.abel@.lmco.com> wrote in message
> news:177f01c49cbe$504699e0$a301280a@.phx.gbl...
> > I have a maintanace Plan establishe that is working excep
> > for on nagging item. The plan does both full backups and
> > transaction log backups each day. It is supposed to
> > delete files older than 3 days old but does not. I have
> > to manually go and clear the old files on a regular basis
> > to keep from filling up the disk. I have not seen any
> > error or know what to look for to see if something is
> > wrong. I thought that if a full backup was done that it
> > emptyed the transaction logs but that dies not appear to
> > be the case either and is why I have the transition logs
> > in the mainance plan. Any information on how to get the
> > old fikes to delete?
>
>

Friday, March 9, 2012

Manintenance Plan

I've created a maintenance plan and getting the following error message in the event log. This has been working for a while problem happend a week a ago, no changes to the system. Novice SQL user, any help on this appreciated.

Event ID 208. SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan 'RSS Pro2000 DBMP'' (0xFE3D7C9C154F9E48A4AA953C88D9F97E) - Status: Failed - Invoked on: 2007-03-19 13:28:00 - Message: The job failed. The Job was invoked by Schedule 13 (Schedule 1). The last step to run was step 1 (Step 1).

Are there any changes to the recovery model during this time of execution?

Also check the password or any information pertaining to SQLAgent account used here.

http://www.sqlservercentral.com/columnists/aingold/workingaround2005maintenanceplans.asp fyi.

|||No changes made. SQLAgent using 'Local System' a/c|||

Try to execute the job as manually with your account credential.

Do you have any other databases scheduled in this database?

if so are they getting same error?

|||The Db's are being backed up (there's 4 in total). It's only the transaction log that are not running.I've changed the a/c to 'administrator' and ran another transaction log and getting the same message.|||Have you applied the service pack or any changes to the server recentlY?