Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Indexes, Fragmentation, and Locking

$
0
0

We recently moved from SQL 2008 Standard to SQL 2012 Standard when we did our ERP system upgrade (Epicor) over Thanksgiving. The database went from having a single schema (dbo) to about 4 different schema (created by Epicor). Most tables for ERP-related tasks have many indexes (most of them being non-unique, non-clustered).

We recently realized we did not setup any kind of maintenance plan in SQL 2012 to reorganize / rebuild indexes and keep the database tuned.

Well, if I go to an index that is heavily fragmented in SSMS and try to rebuild it (right-click index, select rebuild), I get errors. It looks like all of the indexes they created allow row locks but do not allow page locks. To successfully rebuild an index, I have to allow page locks. That will let me rebuild the index successfully.

So, if I create a maintenance plan to rebuild...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>