Меню

Реорганизация индекса sql ошибка

  • Remove From My Forums
  • Question

  • Hi All,

    Index reorganize job is failing with below error stating — reorganize cannot be performed on indexes where page locks are disabled.

    What is the purpose of page locks?

    Can index reorganize be performed with page locks disabled?

    Do I need to seek permission from app team to enable the page locks?

    Thank You.

Answers

  • Hello Friend,

    This is a simple problem to solve.
    Following is a link to the problem and solution and explanation of the issue.

    Resolve
    SQL Server Database Index Reorganization Page Level Locking Problem

    complementing the friend’s message, after seeing the indices you can change the setting if you think it is best
    Here’s the example script to make the change:

    USE MSSQLTipsDemo 
    GO
    ALTER INDEX [PK_Product] ON [Production].[Product] SET ( ALLOW_PAGE_LOCKS = ON )
    ALTER INDEX [PK_Product] ON [Production].[Product] SET ( ALLOW_ROW_LOCKS = ON )

    Jefferson Clyton Pereira da Silva — [MCSA | MCP | MCTS | MTA | Analista de Banco de Dados — Sql Server e Oracle ]

    • Marked as answer by

      Tuesday, September 3, 2019 12:29 AM

  • Index reorganize job is failing with below error stating — reorganize cannot be performed on indexes where page locks are disabled.

    What is the purpose of page locks?

    A page lock locks an entire database page. For a normal operation, that is INSERT, SELECT etc, SQL Server can opt to start with page locks rather than row locks, if it estimates that using row locks will result in too many locks.

    Can index reorganize be performed with page locks disabled?

    No. What index reorganize does is to shuffle pages around to reduce fragmentation. That is, in difference to INSERT, SELECT etc, REORGNANIZE operates on the pages as units. The advantage of REORGANIZE over REBUILD is that since it works with small transaction
    the transaction log does not explode equally easily and there is no need for a lock on table level. (Although that can be avoided in Enterprise Edition with online rebuilds.)

    Do I need to seek permission from app team to enable the page locks?

    Whom you need to ask for permission is nothing we can answer, but something you will need to discuss with your boss if you don’t know how to talk to directly.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Marked as answer by
      SSG92
      Tuesday, September 3, 2019 12:29 AM

  • <<Can index reorganize be performed with page locks disabled?

    No

    By default, and in most cases, page level locking should be enabled for indexes.

    see

    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

    This query creates the necessary ALTER INDEX statements to correct the indexes we identified above. Run the generated commands to correct all of the indexes found above.


    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

    • Marked as answer by
      SSG92
      Tuesday, September 3, 2019 12:29 AM

  • Remove From My Forums
  • Question

  • Hi All,

    Index reorganize job is failing with below error stating — reorganize cannot be performed on indexes where page locks are disabled.

    What is the purpose of page locks?

    Can index reorganize be performed with page locks disabled?

    Do I need to seek permission from app team to enable the page locks?

    Thank You.

Answers

  • Hello Friend,

    This is a simple problem to solve.
    Following is a link to the problem and solution and explanation of the issue.

    Resolve
    SQL Server Database Index Reorganization Page Level Locking Problem

    complementing the friend’s message, after seeing the indices you can change the setting if you think it is best
    Here’s the example script to make the change:

    USE MSSQLTipsDemo 
    GO
    ALTER INDEX [PK_Product] ON [Production].[Product] SET ( ALLOW_PAGE_LOCKS = ON )
    ALTER INDEX [PK_Product] ON [Production].[Product] SET ( ALLOW_ROW_LOCKS = ON )

    Jefferson Clyton Pereira da Silva — [MCSA | MCP | MCTS | MTA | Analista de Banco de Dados — Sql Server e Oracle ]

    • Marked as answer by

      Tuesday, September 3, 2019 12:29 AM

  • Index reorganize job is failing with below error stating — reorganize cannot be performed on indexes where page locks are disabled.

    What is the purpose of page locks?

    A page lock locks an entire database page. For a normal operation, that is INSERT, SELECT etc, SQL Server can opt to start with page locks rather than row locks, if it estimates that using row locks will result in too many locks.

    Can index reorganize be performed with page locks disabled?

    No. What index reorganize does is to shuffle pages around to reduce fragmentation. That is, in difference to INSERT, SELECT etc, REORGNANIZE operates on the pages as units. The advantage of REORGANIZE over REBUILD is that since it works with small transaction
    the transaction log does not explode equally easily and there is no need for a lock on table level. (Although that can be avoided in Enterprise Edition with online rebuilds.)

    Do I need to seek permission from app team to enable the page locks?

    Whom you need to ask for permission is nothing we can answer, but something you will need to discuss with your boss if you don’t know how to talk to directly.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Marked as answer by
      SSG92
      Tuesday, September 3, 2019 12:29 AM

  • <<Can index reorganize be performed with page locks disabled?

    No

    By default, and in most cases, page level locking should be enabled for indexes.

    see

    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

    This query creates the necessary ALTER INDEX statements to correct the indexes we identified above. Run the generated commands to correct all of the indexes found above.


    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

    • Marked as answer by
      SSG92
      Tuesday, September 3, 2019 12:29 AM

  • Remove From My Forums
  • Question

  • Any assistance with this issue would be greatly appreciated. TIA!

    Server:                 DBServer-1

    Task Detail:        Reorganize index on Local server connection

    Databases:         dbA,dbB,dbC,dbD,dbE,master,model,msdb

    Object: Tables and views

    Compact large objects

    Error No:             -1073548784               

    Error Message:  Executing the query «ALTER INDEX [PK_Residential] ON [dbo].[Residential] REORGANIZE WITH ( LOB_COMPACTION = ON )» failed with the following error: «A severe error occurred on the current command.  The results, if any, should be discarded.». Possible failure reasons: Problems with the query, «ResultSet» property not set correctly, parameters not set correctly, or connection not established correctly.

    Windows Server 2003 Standard Edition w/ SP2

    SQL Server 2005 Standard Edition (9.0.3054)

Answers

    • Proposed as answer by

      Wednesday, April 24, 2013 12:50 PM

    • Marked as answer by
      Ed Price — MSFTMicrosoft employee
      Tuesday, April 30, 2013 3:51 AM
  • Remove From My Forums
  • Question

  • Any assistance with this issue would be greatly appreciated. TIA!

    Server:                 DBServer-1

    Task Detail:        Reorganize index on Local server connection

    Databases:         dbA,dbB,dbC,dbD,dbE,master,model,msdb

    Object: Tables and views

    Compact large objects

    Error No:             -1073548784               

    Error Message:  Executing the query «ALTER INDEX [PK_Residential] ON [dbo].[Residential] REORGANIZE WITH ( LOB_COMPACTION = ON )» failed with the following error: «A severe error occurred on the current command.  The results, if any, should be discarded.». Possible failure reasons: Problems with the query, «ResultSet» property not set correctly, parameters not set correctly, or connection not established correctly.

    Windows Server 2003 Standard Edition w/ SP2

    SQL Server 2005 Standard Edition (9.0.3054)

Answers

    • Proposed as answer by

      Wednesday, April 24, 2013 12:50 PM

    • Marked as answer by
      Ed Price — MSFTMicrosoft employee
      Tuesday, April 30, 2013 3:51 AM

SQL Server 2017 on Windows SQL Server 2019 on Windows Еще…Меньше

Проблемы

Предположим, что в таблице за SQL Server 2017 или 2019 г. имеется индекс г. При запуске сканов с версиями (например, «Изоляция моментального снимка» (SI) или Чтение зафиксированной изоляции моментального снимка (RCSI)), а если в той же таблице также запущен процесс слияния с «многояровой многоязак» или «alter index reorganize», вы получаете неправильные результаты.

Статус

Корпорация Майкрософт подтверждает наличие этой проблемы в своих продуктах, которые перечислены в разделе «Применяется к».

Решение

Эта проблема устранена в следующих накопительных обновлениях для SQL Server:

  • Накопительный итог обновления 12 SQL Server 2019 г.

  • Накопительный итог обновления 25 SQL Server 2017 г.

Ссылки

Узнайте о терминологии,используемой корпорацией Майкрософт для описания обновлений программного обеспечения.

Нужна дополнительная помощь?

  • Remove From My Forums

 none

План обслуживания — ошибка — страничная блокировка отключена?

  • Вопрос

  • Добрый день!

    Произвожу обслуживание баз данных с помощью стандартного плана обслуживания предлагаемого мастером в MS SQL Server 2008R2.

    На одну из баз ругается на шаге Реорганизация индекса, выдает вот такую ошибку:

    Индекс «IX_Time» (секция 1) для таблицы «KeyData» невозможно реорганизовать, так как страничная блокировка отключена.

    Что делать? Как с этим бороться или может не надо бороться?

Ответы

  • ALTER INDEX < Index name > ON  < Table Name >
    SET (
      ALLOW_PAGE_LOCKS = ON
    )
    GO 
    

    http://www.t-sql.ru

    • Помечено в качестве ответа

      11 апреля 2011 г. 16:02

Не работает реорганизация индексов, если есть отключенные.

Модератор: Дмитрий Юхтимовский

Не работает реорганизация индексов, если есть отключенные.

Добрый день!
С помощью клиента IndexesClient82.dt создаю предлагаемые новые индексы и отключаю редко используемые.
Но при наличии отключенных индексов перестает работать реорганизация индексов:
[img]

http://screencast.com/t/dc1SUbgOHH

[/img]
Генерируется ошибка:

Сбой выполнения запроса «ALTER INDEX [_Accum19257_ByDims19274_RTRN] ON [dbo…» со следующей ошибкой: «Невозможно выполнить указанную операцию с отключенным индексом «_Accum19257_ByDims19274_RTRN» для таблица «dbo._AccumRg19257″.». Возможные причины сбоя: проблемы с этим запросом, свойство «ResultSet» установлено неправильно, параметры установлены неправильно или соединение было установлено неправильно.

Можно ли сделать чтобы задача «Реорганизация индекса» пропускала отключенные индексы?

simol
 
Сообщений: 101
Зарегистрирован: 18 фев 2013, 11:17

Re: Не работает реорганизация индексов, если есть отключенны

Сообщение Гилёв Вячеслав » 10 дек 2013, 22:39

simol писал(а):Добрый день!
С помощью клиента IndexesClient82.dt создаю предлагаемые новые индексы и отключаю редко используемые.
Но при наличии отключенных индексов перестает работать реорганизация индексов:
[img]

http://screencast.com/t/dc1SUbgOHH

[/img]
Генерируется ошибка:

Сбой выполнения запроса «ALTER INDEX [_Accum19257_ByDims19274_RTRN] ON [dbo…» со следующей ошибкой: «Невозможно выполнить указанную операцию с отключенным индексом «_Accum19257_ByDims19274_RTRN» для таблица «dbo._AccumRg19257″.». Возможные причины сбоя: проблемы с этим запросом, свойство «ResultSet» установлено неправильно, параметры установлены неправильно или соединение было установлено неправильно.

Можно ли сделать чтобы задача «Реорганизация индекса» пропускала отключенные индексы?

Для этого надо в регламенте указать список тех таблиц, которые надо обслуживать , а не всю базу целиком.

Гилёв Вячеслав
 
Сообщений: 2543
Зарегистрирован: 11 фев 2013, 15:40
Откуда: Россия, Москва

Re: Не работает реорганизация индексов, если есть отключенны

Сообщение simol » 10 дек 2013, 22:44

Гилёв Вячеслав писал(а):Для этого надо в регламенте указать список тех таблиц, которые надо обслуживать , а не всю базу целиком.

Это не удобно, могут появляться новые индексы или другие отключиться. То есть в конструкторе нельзя прописать игнорирование отключенных индексов и нужно делать свой скрипт?

simol
 
Сообщений: 101
Зарегистрирован: 18 фев 2013, 11:17

Re: Не работает реорганизация индексов, если есть отключенны

Сообщение Гилёв Вячеслав » 10 дек 2013, 22:49

simol писал(а):

Гилёв Вячеслав писал(а):Для этого надо в регламенте указать список тех таблиц, которые надо обслуживать , а не всю базу целиком.

Это не удобно, могут появляться новые индексы или другие отключиться. То есть в конструкторе нельзя прописать игнорирование отключенных индексов и нужно делать свой скрипт?

Наверное платные средства с подобным функционалом есть, но это лучше спрашивать тех кто такими инструментами пользуются.

Гилёв Вячеслав
 
Сообщений: 2543
Зарегистрирован: 11 фев 2013, 15:40
Откуда: Россия, Москва




Re: Не работает реорганизация индексов, если есть отключенны

Сообщение simol » 23 янв 2014, 11:25

Гилёв Вячеслав писал(а):расскажите что получилось

Допроведем с вами аудит и продолжу по этому вопросу.

simol
 
Сообщений: 101
Зарегистрирован: 18 фев 2013, 11:17

Re: Не работает реорганизация индексов, если есть отключенны

Сообщение simol » 03 фев 2014, 17:18

Аудит завершился, спасибо!
Теперь продолжаю исследование.
Сначала хотел сделать алгоритм:

Исполняйте инструкцию ALTER INDEX … REORGANIZE, чтобы выполнить дефрагментацию индекса, при соблюдении следующих пороговых значений: значение avg_page_space_used_in_percent в диапазоне от 60 до 75 или значение avg_fragmentation_in_percent в диапазоне от 10 до 15. Исполняйте инструкцию ALTER INDEX … REBUILD, чтобы выполнить дефрагментацию индекса, при соблюдении следующих пороговых значений: значение avg_page_space_used_in_percent меньше 60 или значение avg_fragmentation_in_percent больше 15.

Столкнулся с тем, что есть таблица, записи в которой на столько большие, что при дефрагментации 0 получается avg_page_space_used_in_percen = 68% и эта таблица каждую итерацию требует REORGANIZE.
Потом решил сделать основываясь на алгоритме как для кластеризованных так и для некластеризованных:

> 5 % и <= 30 % REORGANIZE. > 30% ALTER INDEX REBUILD WITH (ONLINE = ON)

Затем заинтересовался вопросом обновления статистики и хотел добавить обновление статики по индексам, по которым перестроил индекс. Затем встал вопрос с очисткой процедурного кеша.
В результате лазя по просторам интернета нашел такой ресурс http://ola.hallengren.com/
Осознаваясь на который настроил регламенты:
1) каждый час по правилу >5%<=30% REORGANIZE, >30% REBUILD
2) каждые 6 часов обновление статистики, которая изменялась и очистка процедурного кеша
3) каждое воскресенье тестирование баз

simol
 
Сообщений: 101
Зарегистрирован: 18 фев 2013, 11:17


Вернуться в MS SQL Server для целей 1С:Предприятие

Кто сейчас на форуме

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Рено сандеро ошибка df109
  • Рено сценик 2 ошибка df056