DZone
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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Integrating AWS With Salesforce Using Terraform
  • Structured Logging
  • Authorization: Get It Done Right, Get It Done Early
  • How To Integrate Microsoft Team With Cypress Cloud

Trending

  • Integrating AWS With Salesforce Using Terraform
  • Structured Logging
  • Authorization: Get It Done Right, Get It Done Early
  • How To Integrate Microsoft Team With Cypress Cloud
  1. DZone
  2. Data Engineering
  3. Databases
  4. Index Page Level Locking is Disable ERROR

Index Page Level Locking is Disable ERROR

Joydeep Das user avatar by
Joydeep Das
·
May. 14, 14 · Interview
Like (0)
Save
Tweet
Share
1.90K 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.

Trending

  • Integrating AWS With Salesforce Using Terraform
  • Structured Logging
  • Authorization: Get It Done Right, Get It Done Early
  • How To Integrate Microsoft Team With Cypress Cloud

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • 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

Let's be friends: