Tuesday, October 26, 2010

How to Rebuilding index or Reindex SQL Server 2005,2008

How to Rebuilding index or Reindex SQL Server 2005,2008

Hi,Friend. I'd like to display step for work about Rebuilding index or Reindex SQL Server 2005,2008 . I have created that to two method for that Capture Screen and Command Line.

Capture Screen

1. Log in to SQL Server .


2. Click the Database Folder and then select the Database Name for reindex and select Table Name and choose the Indexs same picture below.







3. Right Click at Indexs picture below





4.Waiting untill the Reindexs Forms display.


5. Click OK

Finish to Rebuild the index or Reindex sql 2005 , Easy Right ?

May be peple need to command line for Rebuild the index or Reindex sql 2005 because That is very fast for work . I think so . you can follow by below.

Command Line or SQL Script


use demo -- Change Database name
--All first DBCC CHECKDB
exec sp_dboption N'demo', N'single', N'true' --Set database option to single user
DBCC DBREINDEX ('tpstsalhd', '', 70) -- Select the Table name for that.

exec sp_dboption N'demo', N'single', N'False' --Set database option to Multi user

--Finally Check Result Run Sql Script Below.

dbcc showcontig(tpstsalhd)

Thank you for your visit my blog.

การ Reindex คืออะไร ทำไปทำไม นั้นผมอธิบายไงดี อันดีในความเข้าใจจากประสบการณ์
ผม ว่ามันก็เหมือนกับครั้งหนึ่งเรามีการจัดหนังสือในห้องสมุดไว้เป็นหมวดหมู่ อย่างดีแต่เปิดไปนานก็มีทั้งหนังสือใหม่ และหนังสือเก่าที่อ่านแล้วเก็บไม่เรียบร้อยฉะนั้นก็ต้องกมีการจัดเรียงกัน ใหม่เพื่อให้เวลาที่เราคนหา(Query) ทำได้เร็วขึ้นครับ นั้นก็เหมือนกันกับ ฐานข้อมูลเราต้องมีการจัดข้อมูลให้เป็นหมวดหมู่เหมือนกัน
ฉะนั้น เราจำเป็นต้องทำถ้าเราอยากให้การค้นหาข้อมูลเร็วขึ้น ครับ
สามารถหาข้อมูลเพิ่มเติมได้ จาก SQL Programming หัวข้อเรือง Database Turning.


No comments:

Post a Comment