TAILIEUCHUNG - Microsoft SQL Server 2008 R2 Unleashed- P87

Microsoft SQL Server 2008 R2 Unleashed- P87:SQL Server 2005 provided a number of significant new features and enhancements over what was available in SQL Server 2000. This is not too surprising considering there was a five-year gap between these major SQL Server 2008 is not as much of a quantum leap forward from SQL Server 2005 | 804 CHAPTER 25 Creating and Managing Indexes NOTE If the REBUILD option is run on a heap table that is a table with no clustered index the rebuild operation does not affect the underlying table. Only the specified nonclustered indexes are rebuilt. For added flexibility you can also specify index options as part of the REBUILD operation. The options available with the REBUILD command are the same options available when you are creating indexes. The only exception is that the DROP EXISTING option is not available with the REBUILD operation. Table earlier in this chapter provides detailed descriptions of the options. The following example rebuilds the clustered index on the table and specifies several of the available REBUILD options ALTER INDEX PK_Product_ProductID ON Production . Product REBUILD WITH PAD_INDEX OFF STATISTICS_NORECOMPUTE OFF ALLOW_ROW_LOCKS ON ALLOW_PAGE_LOCKS ON ONLINE OFF SORT_IN_TEMPDB OFF DATA_COMPRESSION NONE An alternative to the REBUILD operation is the REORGANIZE operation. The REORGANIZE operation is equivalent to the DBCC INDEX DEFRAG command. During the REORGANIZE operation the leaf-level pages of the index are physically reordered to match the logical order of the index keys. The indexes are not dropped. The REORGANIZE operation is always an online operation and does not require long-term table locks to complete. TIP The REORGANIZE operation can generate a large number of transactions during its execution. You need to be sure to carefully evaluate the amount of space available in the transaction log and monitor the free space during this operation. If the transaction log is set to AUTOGROW you need to make sure you have adequate free space on the drive where your transaction log lives. This is especially true for very large tables. Several options are available for mitigating the growth of the log during these operations such as setting the recovery model on the database to BULK-LOGGED. The REORGANIZE operation has

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.