May 9, 2008 at 1:37 am
Hi,
As started new DBA job I found out that as DBA we need to maintain database so could someone please help me to find out solution of following issue:-
How to check database integrity and what is command for update statics , shrink database and when we need to check database integrity, update statics and shrink database.
Thanks!
May 9, 2008 at 2:04 am
Hi nkm129,
take a look at BOL for DBCC CHECKDB, for each db you can use:
EXEC sp_MSforeachdb @command1="print '?' DBCC CHECKDB ('?')"
... plz read Database Engine Administrator InfoCenter
and further Maintenance Plans
[font="Verdana"]CU
tosc[/font]
May 9, 2008 at 2:52 am
Don't shrink the database. It shuffles index pages, causing fragmentation, and generally is not necessary.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2008 at 2:57 am
GilaMonster (5/9/2008)
Don't shrink the database. It shuffles index pages, causing fragmentation, and generally is not necessary.
Gail Shaw
Could you explain what shrink will do ?
Thanks!
May 9, 2008 at 4:12 am
If moves pages as early in the file as possble (generally causing massive fragmentation in the process), then releases unused space to the OS. This depends on the settings you give it, of course.
It's no recommended, because databases need free space inside to work properly. If you shrink the file down, it will grow again, possibly causing file system fragmentation as well.
See - http://sqlinthewild.co.za/index.php/2007/09/08/shrinking-databases/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply