DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Index Page Level Locking is Disable ERROR

Index Page Level Locking is Disable ERROR

Joydeep Das user avatar by
Joydeep Das
·
May. 14, 14 · Java Zone · Interview
Like (0)
Save
Tweet
1.64K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

When we are working with a production database, sometimes we find a specific message in maintenance plan log.

The index [IndexName] on table [TableName]

cannot be reorganized because page level locking is disabled. 

This will cause our Index Reorganize steps to fail. In this article, we are trying to explain it and solve it.

Why this Error Occurs

By default, the page level locks should be enabled for Index. The main cause of this error is that the Index Reorganize step has hit an Index that has page lock disabled. This somehow your Index Page Lock is disabled.

How to Solve it

Finding the Table Name and Index Name where Page Lock is Disabled

 SELECT T.Name AS [Table Name], I.Name As [Index Name]
FROM  sys.indexes I
  LEFT OUTER JOIN sys.tables T
  ON I.object_id = t.object_id
WHERE  I.allow_page_locks = 0
  AND  T.Name IS NOT NULL;
Now Use Alter Statement to Allow Page Lock On
The syntax is mentioned below
 ALTER INDEX <Index_Name> ON <Table_Name>
SET (ALLOW_PAGE_LOCKS = ON);
To generate the Alter Script Automatically
 SELECT 'ALTER INDEX ' + I.Name + ' ON ' +  T.Name +
  ' SET (ALLOW_PAGE_LOCKS = ON)' As Command
FROM  sys.indexes I
  LEFT OUTER JOIN sys.tables T
  ON I.object_id = t.object_id
WHERE  I.allow_page_locks = 0
  AND T.Name IS NOT NULL;
Hope you like it.

Lock (computer science) Database Production (computer science) Syntax (programming languages)

Published at DZone with permission of Joydeep Das, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Debugging the Java Message Service (JMS) API Using Lightrun
  • 10 Steps to Become an Outstanding Java Developer
  • How To Use Cluster Mesh for Multi-Region Kubernetes Pod Communication
  • How to Utilize Python Machine Learning Models

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo