Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Rebuild Script Has Been Running 24 Hours Expand / Collapse
Author
Message
Posted Friday, March 7, 2014 6:20 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 7, 2014 9:17 AM
Points: 5, Visits: 34
I am using SQL Express 2005. A database has reached its maximum size and needs to be shrunk. Prior to shrinking I checked the database and found several error in the index. So I did a backed up and ran the following script to repair and rebuild

alter database sbsmonitoring set SINGLE_USER
DBCC CHECKDB (sbsmonitoring, repair_rebuild)
alter database sbsmonitoring set MULTI_USER

The script has been running for 24 hours.

Is it normal to take this long to repair and rebuild a 4 gig database?
At what point do I take some action and what steps would I take to correct the situation

Thanks

Post #1548708
Posted Friday, March 7, 2014 6:31 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:11 AM
Points: 43,013, Visits: 36,172
Check if it's blocked and if so by what and on what resource.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1548711
Posted Friday, March 7, 2014 7:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 7, 2014 9:17 AM
Points: 5, Visits: 34
Thanks for your quick response, but I am not sure how to check if it is blocked, could you please explain how I would do that?

Perry
Post #1548744
Posted Friday, March 7, 2014 8:27 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 6:47 PM
Points: 23,396, Visits: 32,229
Run sp_who2 at a minimum?



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1548762
Posted Friday, March 7, 2014 8:52 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 2:50 PM
Points: 21,744, Visits: 15,435
Most likely the alter database is waiting infinitely to complete and thus holding up your checkdb.

You should try the alter database as follows

alter database blah
set single_user WITH ROLLBACK IMMEDIATE;





Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1548772
Posted Friday, March 7, 2014 9:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 7, 2014 9:17 AM
Points: 5, Visits: 34
Thanks, I did not see any blocks. I checked and found the process had been suspended. Killed the process and was able to correct the situation by renaming my data file and log file to .bak. Then restored the database to a backup I had made when the database was created so I now have a new clean database.

Thanks for your help
Post #1548781
Posted Friday, March 7, 2014 9:31 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 2:50 PM
Points: 21,744, Visits: 15,435
Good to hear it is resolved.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1548785
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse