Параметр конфигурации agent xps изменен с 1 на 0 выполните инструкцию reconfigure для установки

Khanja

0 / 0 / 0

Регистрация: 15.09.2023

Сообщений: 6

16.09.2023, 12:20. Показов 4620. Ответов 11

Метки recovery (Все метки)


Здравствуйте.

Помогите, пожалуйста, разобраться.

При старте службы Агент SQL Server в его журнале ошибок наблюдается такие записи:

Code
1
2
3
4
5
6
7
8
9
10
11
12
13
[09/15/2023 12:08:29,,Предупреждение,[396] An idle CPU condition has not been defined - OnIdle job schedules will have no effect
09/15/2023 12:08:29,,Предупреждение,[475] Database Mail is not enabled for agent notifications.
09/15/2023 12:08:29,,Сведения,[129] SQLSERVERAGENT starting under Windows NT service control
09/15/2023 12:08:29,,Сведения,[432] There are 7 subsystems in the subsystems cache
09/15/2023 12:08:29,,Сведения,[339] Local computer is ***** running Windows NT 6.2 (9200)
09/15/2023 12:08:29,,Сведения,[310] 8 processor(s) and 65311 MB RAM detected
09/15/2023 12:08:29,,Сведения,[103] NetLib being used by driver is DBNETLIB; Local host server is
09/15/2023 12:08:29,,Сведения,[102] SQL Server ODBC driver version 13.00.1601
09/15/2023 12:08:29,,Сведения,[101] SQL Server ***** version 13.00.1601 (0 connection limit)
09/15/2023 12:08:29,,Сведения,[000] Параметр конфигурации "show advanced options" изменен с 0 на 1. Выполните инструкцию RECONFIGURE для установки. [SQLSTATE 01000] (Message 15457)  Параметр конфигурации "Agent XPs" изменен с 0 на 1. Выполните инструкцию RECONFIGURE для установки. [SQLSTATE 01000] (Message 15457)  Параметр конфигурации "show advanced options" изменен с 1 на 0. Выполните инструкцию RECONFIGURE для установки. [SQLSTATE 01000] (Message 15457)
09/15/2023 12:08:29,,Сведения,[393] Waiting for SQL Server to recover database 'msdb'...
09/15/2023 12:08:29,,Сведения,[495] The SQL Server Agent startup service account is NT AUTHORITY\LOCAL SERVICE.
09/15/2023 12:08:29,,Сведения,[100] Microsoft SQLServerAgent version 13.0.1601.5 (X64 unicode retail build) : Process ID 18192[

Как видим, пишет, что системная база msdb ожидает восстановления. И вот здесь пошли странности. Сам агент успешно запускается, но планы обслуживания не выполняет. Планы можно добавлять, редактировать и все, что угодно душе с ними делать.

В логах самого сервера SQL тоже ничего нет ни при запуске агента, ни при запуске сервера.

Смотрю состояние:

T-SQL
1
2
SELECT user_access, user_access_desc, state, state_desc 
FROM sys.databases where name = 'msdb'
user_access user_access_desc state state_desc
0 MULTI_USER 0 ONLINE

Базу уже пробовал восстанавливать из архива, переводя в single режим. Пробовал файл mdf и log подменять из шаблона установки. Брал вообще с другого сервера. Пробовал создавать заново msdb. Удалял все журналы. Пересоздавал планы обслуживания и их расписания. Менял пользователя, под которым запускается агент. Танцевал с бубном в полнолуние.

В отчаянье уже деинсталировал весь MS SQL 2016 и установил заново. И первое, что я там посмотрел и увидел в логах опять эту ошибку и отсутствие реакции агента на планы задач.

Скажите, куда еще можно копать и что смотреть кроме переустановки операционки?



0



5637 / 4481 / 1087

Регистрация: 29.08.2013

Сообщений: 27,958

Записей в блоге: 3

16.09.2023, 13:57

а после переустановки сервера в чем проблема?



0



0 / 0 / 0

Регистрация: 15.09.2023

Сообщений: 6

16.09.2023, 14:06

 [ТС]

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



0



qwertehok

5637 / 4481 / 1087

Регистрация: 29.08.2013

Сообщений: 27,958

Записей в блоге: 3

16.09.2023, 14:16

сомневаюсь что проблема в строке

Code
1
09/15/2023 12:08:29,,Сведения,[393] Waiting for SQL Server to recover database 'msdb'...

если бы система не восстановила — она бы написала

Сообщение от Khanja

Такая же ошибка в логах и также агент не выполняет задания по расписанию.

у вас 16 версия сервера?
на него уже 3SP вышли для исправления ошибок — попробуйте поставить
https://support.microsoft.com/en-us/help/5003279



0



0 / 0 / 0

Регистрация: 15.09.2023

Сообщений: 6

16.09.2023, 14:59

 [ТС]

Спасибо, вечером попробую и отпишусь по результатам.



0



Khanja

0 / 0 / 0

Регистрация: 15.09.2023

Сообщений: 6

17.09.2023, 00:13

 [ТС]

Обновление не помогло. В логах все тоже, только версия теперь посвежее. При чем, опять снес SQL, поставил и на свежую накатил это обновление.

Code
1
2
3
4
5
6
7
8
9
10
11
12
13
09/16/2023 22:58:46,,Предупреждение,[396] Не определено условие простоя процессора - расписания заданий типа OnIdle использоваться не будут
09/16/2023 22:58:46,,Предупреждение,[475] Компонент Database Mail не включен для уведомлений агента.
09/16/2023 22:58:46,,Сведения,[129] SQLSERVERAGENT запущена с помощью средства управления службами NT Windows
09/16/2023 22:58:46,,Сведения,[432] В кэше подсистем находится 7 подсистем
09/16/2023 22:58:46,,Сведения,[339] Локальный компьютер **** работает с Windows NT 6.2 (9200)
09/16/2023 22:58:46,,Сведения,[310] Обнаружено 8 процессоров и 65311 МБ ОЗУ
09/16/2023 22:58:46,,Сведения,[103] В качестве библиотеки NetLib драйвером используется DBNETLIB; локальный сервер узла:
09/16/2023 22:58:46,,Сведения,[102] ODBC-драйвер для SQL Server версии 13.00.6300
09/16/2023 22:58:46,,Сведения,[101] SQL Server **** версии 13.00.6300 (с ограничением на 0 соединений)
09/16/2023 22:58:46,,Сведения,[000] Параметр конфигурации "show advanced options" изменен с 0 на 1. Выполните инструкцию RECONFIGURE для установки. [SQLSTATE 01000] (Сообщение 15457)  Параметр конфигурации "Agent XPs" изменен с 0 на 1. Выполните инструкцию RECONFIGURE для установки. [SQLSTATE 01000] (Сообщение 15457)  Параметр конфигурации "show advanced options" изменен с 1 на 0. Выполните инструкцию RECONFIGURE для установки. [SQLSTATE 01000] (Сообщение 15457)
09/16/2023 22:58:44,,Сведения,[393] Ожидается восстановление баз данных "msdb" SQL Server...
09/16/2023 22:58:44,,Сведения,[495] Учетная запись службы запуска агента SQL Server равна ****\Administrator.
09/16/2023 22:58:44,,Сведения,[100] Microsoft SQLServerAgent версии 13.0.6300.2 (сборка X64 unicode коммерческая): идентификатор процесса 6024



0



5637 / 4481 / 1087

Регистрация: 29.08.2013

Сообщений: 27,958

Записей в блоге: 3

17.09.2023, 07:56

выполните @@version и скиньте сюда



0



3613 / 2134 / 756

Регистрация: 02.06.2013

Сообщений: 5,164

17.09.2023, 10:12

Сообщение от Khanja

увидел в логах опять эту ошибку

Это не ошибка.

Сообщение от Khanja

Скажите, куда еще можно копать и что смотреть

Логи джоба, запускающего план обслуживания

ЗЫ: Учетка, под которой работает SQL Server Agent должна входить в роль sysadmin



1



0 / 0 / 0

Регистрация: 15.09.2023

Сообщений: 6

17.09.2023, 13:59

 [ТС]

Сообщение от qwertehok

выполните @@version и скиньте сюда

Microsoft SQL Server 2016 (SP3) (KB5003279) — 13.0.6300.2 (X64) Aug 7 2021 01:20:37 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: )



0



5637 / 4481 / 1087

Регистрация: 29.08.2013

Сообщений: 27,958

Записей в блоге: 3

17.09.2023, 16:15

Khanja, попробуйте что-то совсем простое в планировщике сделать — строку вставить например
нужно проверить вообще запускается ли



0



Khanja

0 / 0 / 0

Регистрация: 15.09.2023

Сообщений: 6

17.09.2023, 17:15

 [ТС]

Сообщение от invm

Логи джоба, запускающего план обслуживания

Вот кажется мне что я сильно тупанул, пытаясь посмотреть логи задач в журнале ошибок агента. Как только уважаемый invm направил на путь истинный, сразу до меня дошло, что не там смотрю. И действительно, в логах джоба есть результаты, которые я так стремился увидеть.

Огромное спасибо и респект!

Code
1
2
09/16/2023 22:58:46,,Сведения,[000] Параметр конфигурации "show advanced options" изменен с 0 на 1. Выполните инструкцию RECONFIGURE для установки. [SQLSTATE 01000] (Сообщение 15457)  Параметр конфигурации "Agent XPs" изменен с 0 на 1. Выполните инструкцию RECONFIGURE для установки. [SQLSTATE 01000] (Сообщение 15457)  Параметр конфигурации "show advanced options" изменен с 1 на 0. Выполните инструкцию RECONFIGURE для установки. [SQLSTATE 01000] (Сообщение 15457)
09/16/2023 22:58:44,,Сведения,[393] Ожидается восстановление баз данных "msdb" SQL Server...

Но вопрос, что означают эти записи у агента?



0



3613 / 2134 / 756

Регистрация: 02.06.2013

Сообщений: 5,164

17.09.2023, 18:13



0



Problem

The other day we found that SQL Server Agent was stopped with the following message in SSMS “SQL Server Agent (Agent XPs disabled)” for one of our SQL Server instances, but the service was running according to the services console.  I tried to start the service from SQL Server Management Studio, but this did not work.  What is the issue and how do I fix this?

Solution

The other day I changed an implementation on one of our SQL Server instances. After the change, I started all of the SQL Server services from the services.msc console and everything started successfully. But when I launched SQL Server Management Studio, SQL Server Agent showed that is was not running with ‘Agent XPs disabled’ message as shown below. I tried to restart the service from SSMS, but it did not work. The interesting thing was that the service showed as ‘started’ when I was looking at it in the services.msc console.

As SQL Server Agent was not running in SSMS, we were not able to access any of the contents like jobs, error logs, etc… 

It appears, that this issue appears when ‘Agent XPs’ advance configuration option is disabled and set to 0 for the SQL Server configuration..

Agent XPs is an advanced configuration option which enables the SQL Server Agent extended stored procedures on the server.  When this is not enable SQL Server Agent will not be active in SSMS. Most of the time when you start the SQL Server services it automatically enables ‘Agent XPs’, but sometime it fails to enable or sets the value to 0 and then this issue will appear.

To fix this issue we should first set the ‘Agent XPs’ to 1 and then run RECONFIGURE to bring it into effect.

Step 1. 
Run sp_configure to check ‘Agent XPs’ value.

EXEC SP_CONFIGURE ‘Agent XPs’

Run SP_configure to check Agent XPs value

Step 2
The above screenshot shows that advanced options is not enabled on this instance, so we must first enable advanced option to see all of the advanced configuration values.

EXEC SP_CONFIGURE ‘show advanced options’,1
GO
RECONFIGURE
GO
EXEC SP_CONFIGURE ‘show advanced options’

Enable all advanced options in sp_configure

You can see ‘show advanced options’ is set to 1 this means that advanced options are enabled and we can see and change the values.

Step 3
Run sp_configure again to check the value for Agent XPs. Here we can see the run value is set to 0.

Now we need to change this setting from 0 to 1 to run SQL Server Agent in SQL Server Management Studio.

EXEC SP_CONFIGURE ‘Agent XPs’,1
GO
RECONFIGURE

Enable Agent XPs advanced options in sp_configure

Step 4
Now restart your SQL Server Agent service from SQL Server Configuration Manager. This time the service should come up and we can successfully access all of the content for SQL Server Agent.

Next Steps
  • Always use SQL Server Configuration Manager to start SQL Server services
  • If you get this message in SQL Server, check the configuration settings to enable the Agent XPs
  • Read the additional articles on SQL Server Agent

If you encounter error Msg 15123, Level 16, reading “The configuration option ‘Agent XPs’ does not exist“, you were probably trying to execute EXEC SP_CONFIGURE 'Agent XPs' while advanced options are hidden.

This error is easily fixed.

Example of the Error

Here’s an example of code that causes this error.

EXEC SP_CONFIGURE 'Agent XPs';

Result:

Msg 15123, Level 16, State 1, Procedure SP_CONFIGURE, Line 62
The configuration option 'Agent XPs' does not exist, or it may be an advanced option.

As mentioned, this means that show advanced options are set to 0.

Solution

We can fix the above error by running the following code:

EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO

Result:

Started executing query at Line 18
Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.

Started executing query at Line 20
Commands completed successfully.
Total execution time: 00:00:00.126

After the first line ran, it advised us to run RECONFIGURE, which we did.

Now when we run the previous code, we no longer get an error.

EXEC SP_CONFIGURE 'Agent XPs';

Result:

 +-----------+-----------+-----------+----------------+-------------+
 | name      | minimum   | maximum   | config_value   | run_value   |
 |-----------+-----------+-----------+----------------+-------------|
 | Agent XPs | 0         | 1         | 0              | 0           |
 +-----------+-----------+-----------+----------------+-------------+ 

Change a Setting

Probably the reason you were trying to do this in the first place, was that you wanted to change an advanced option (such as to enable the Agent XPs).

Here’s an example of enabling the Agent XPs.

EXEC SP_CONFIGURE 'Agent XPs', 1;
GO
RECONFIGURE;
GO

Result:

Started executing query at Line 23
Configuration option 'Agent XPs' changed from 0 to 1. Run the RECONFIGURE statement to install.

Started executing query at Line 25
Commands completed successfully.
Total execution time: 00:00:00.142

Now we can check the setting again.

EXEC SP_CONFIGURE 'Agent XPs';

Result:

 +-----------+-----------+-----------+----------------+-------------+
 | name      | minimum   | maximum   | config_value   | run_value   |
 |-----------+-----------+-----------+----------------+-------------|
 | Agent XPs | 0         | 1         | 1              | 1           |
 +-----------+-----------+-----------+----------------+-------------+ 

Hide Advanced Options

Once finished whatever it is you need to do, it’s a good idea to hide advanced options again.

EXEC sp_configure 'show advanced options', 0;
GO
RECONFIGURE;
GO

Recently, one of my clients encountered an error while trying to create a maintenance plan in SQL Server. They received the following error message:

‘Agent XPs’ component is turned off as part of the security configuration for this server. A system administrator can enable the use of ‘Agent XPs’ by using sp_configure. For more information about enabling ‘Agent XPs’, see “Surface Area Configuration” in SQL Server Books Online.

This error occurs when the SQL Server Agent service is not running or when the ‘Agent XPs’ component is disabled. In order to fix this error, there are two possible solutions:

Solution 1: Start SQL Server Agent Service

The first solution is to start the SQL Server Agent service. This can be done using the SQL Server Configuration Manager or by running the following command in the SQL Server Management Studio query window:

EXEC sp_configure 'show advanced options', 1;
RECONFIGURE WITH OVERRIDE;
EXEC sp_configure 'Agent XPs', 1;
RECONFIGURE WITH OVERRIDE;

By executing these commands, you will enable the ‘Agent XPs’ component and allow the creation of maintenance plans.

Solution 2: Enable Agent XPs using sp_configure

If you prefer not to start the SQL Server Agent service, you can enable the ‘Agent XPs’ component directly using the sp_configure command. Run the following commands in the SQL Server Management Studio query window:

EXEC sp_configure 'show advanced options', 1;
RECONFIGURE WITH OVERRIDE;
EXEC sp_configure 'Agent XPs', 1;
RECONFIGURE WITH OVERRIDE;

Enabling ‘Agent XPs’ using this method allows you to create maintenance plans without starting the SQL Server Agent service. This can be useful if you want to avoid running scheduled jobs that may be affected by starting the service.

It’s important to note that if you encounter any issues starting the SQL Server Agent service, you should check the SQLAgent.out and event log for further troubleshooting. These logs can provide valuable information to help resolve the problem.

Have you ever encountered the ‘Agent XPs Component is Turned Off’ error in your SQL Server environments? If so, please share your experience in the comments below.

One of my clients has installed a new instance of SQL Server and then wanted to create maintenance plan. They were complaining about getting some error and we’re looking forward for my help to solve the same. As soon as he did right click on a Maintenance Plan under “Management” node and selected “New Maintenance Plan Wizard” using SQL Server Management Studio as shown below. Let us learn how to fix Agent XPs Component is Turned Off as Part of the Security Configuration for this Server error.

It gave below error.

SQL SERVER - FIX - Agent XPs Component is Turned Off as Part of the Security Configuration for this Server MP-Error-02

Here is the text of the message.

TITLE: Microsoft SQL Server Management Studio
——————————
Cannot show requested dialog.
——————————
ADDITIONAL INFORMATION:
Unable to execute requested command.
——————————
‘Agent XPs’ component is turned off as part of the security configuration for this server. A system administrator can enable the use of ‘Agent XPs’ by using sp_configure. For more information about enabling ‘Agent XPs’, see “Surface Area Configuration” in SQL Server Books Online. (Microsoft.SqlServer.Management.MaintenancePlanWizard)
——————————
BUTTONS:
OK
——————————

There are two ways to fix the problem.

  1. Start SQL Server Agent Service.
    SQL SERVER - FIX - Agent XPs Component is Turned Off as Part of the Security Configuration for this Server MP-Error-03

    You can also start SQL Server Agent service by using the SQL Server Configuration Manager on start>run>services.msc applet.

  1. Enable Agent XPs under sp_configure using below command in SQL Server Management Studio query window.
SP_CONFIGURE 'SHOW ADVANCE',1
GO
RECONFIGURE WITH OVERRIDE
GO
SP_CONFIGURE 'AGENT XPs',1
GO
RECONFIGURE WITH OVERRIDE
GO

Here is the output

Configuration option ‘show advanced options’ changed from 0 to 1. Run the RECONFIGURE statement to install.
Configuration option ‘Agent XPs’ changed from 0 to 1. Run the RECONFIGURE statement to install.

Once any of the above is followed, you should be able to create maintenance plan. You might ask, why someone would need use # 2 instead of # 1. It is important to remember that if you want to create maintenance plan without starting SQL Agent service (as it might cause jobs to run which are scheduled) then you would choose option 2. A very uncommon but possible scenario.

If you are not able to start SQL Server Agent service, then you may want to look at below blog

SQL SERVER – Unable to start SQL Server Agent – Failed to Initialize SQL Agent log

There might be some other error but SQLAgent.out and event log is a good place to start troubleshooting the issue. Do let me know if you encountered this error ever in your environments. Do leave a comment.

Reference: Pinal Dave (https://blog.sqlauthority.com)

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

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Амлодипин боримед таблетки инструкция по применению
  • Витаон инструкция по применению при насморке взрослым бальзам караваева
  • Требования производственной инструкции по эксплуатации котлов
  • Весы редмонд кухонные rs m723 инструкция
  • Должностная инструкция слесаря вдго 5 разряда