Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 18,284 of 19,505    |
|    Erland Sommarskog to mat    |
|    Re: How can I check out the reason a db     |
|    28 Apr 11 23:58:02    |
      From: esquel@sommarskog.se              mat (mat@notarealdotcom.adr) writes:       > CHECKDB found 0 allocation errors and 0 consistency errors in database       > 'mydb'.       >       > I guess that means it's a healthy database? Nothing in the check output       > looked like a report of problems.              Nevertheless, you had some serious problem with a copy of the database       on your machine. Of course, it may been due to some damage that happened       when you copied the database.              I have actually run DBCC on a database, backed it up, restored it, and       ran DBCC again - to see new errors appear. But that was with SQL 6.0       which had quite a different architecture.              So the database looks clean on that level.              > Is there a way to 'rebuild' a database, as if one was importing from       > scratch with a sql script? Even with the production db I have the       > ability to take it offline in the evening for hours. Because the db       > seems kind of not right, I'd like to at least consider doing this.       > Another reason I'd like to do it is because the db has had shrink run on       > it many times. Apparently that can cause index fragmentation, and a       > performance hit as a result.              Yes, you should not shrink your database but in very exceptional cases.              If you are on SQL 2008, you can script a database including data from       SSMS. For SQL 2005, you can use the Database Publishing Wizard.              But it's better to just ALTER INDEX REBUILD on the tables if all you       want to do is to defragment. Scripting and recreating is more risky -       those tools are not 100% robust.                            --       Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se              Links for SQL Server Books Online:       SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx       SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca