Wednesday, March 21, 2012

Maintance Plan dbcc checkdb

Hi,

When I exectue the maintance plan dbcc checkdb it doesn't do anything because it takes 1 second to do de check. Doesn't appers any error.
When I execute the command in the query analizer it takes 2 hours to do the check.

Can you help me?

Thanks,

Marta Masnou

I advice you to forget black box named "maintance plan" and develop your own maintance job. Why? Becouse, in this case you can control all processes which coded by yourself. And catch all necessary information.

For example

Code Snippet

use db_name
create table #result
(
field1,
field2
...
...
)

insert #result exec ('dbcc checkdb with tableresults')

if (select count(*) from #result where status <> 0) > 0
begin
exec master..xp_cmdshell 'net send you_computer "ahtung: db_name is corrupt. Rerun CheckDB"'
end


So, as you can see, if some errors detected, you immediately will receive message.|||Hi,

thanks a lot Alexandr.

Now the job works correctly.

See you soon.

Marta
sql

No comments:

Post a Comment