禁用 ssh agent

This article explains how we can fix SQL Server error “Agent XPs Disabled”. Before we dive into troubleshooting and methods for fixing the error, let me explain about Microsoft SQL Server Agent and the Agent XPs configuration parameter.

本文介绍了如何解决SQL Server错误“已禁用Agent XP”。 在我们深入研究故障排除和纠正错误的方法之前,让我解释一下Microsoft SQL Server代理代理XPs配置参数。

SQL Server代理和SQL Server代理XP (SQL Server Agent and SQL Server Agent XPs)

The SQL Server Agent is used to create automated database maintenance and database administration tasks that are called SQL jobs. SQL Server agent has the following components:

SQL Server代理用于创建自动数据库维护和数据库管理任务,这些任务称为SQL作业 。 SQL Server代理具有以下组件:

  • Jobs 工作
  • Schedules 时间表
  • Alerts 警报
  • Operators 经营者

工作 (Jobs)

Jobs are a specific set of tasks performed on the specific schedule by the SQL Server Agent. SQL jobs can execute once, or multiple times based on the defined schedule. You can also run a job by executing the system stored procedure named sp_start_job. The execution status of the SQL jobs is monitored by the SQL Server agent.

作业是SQL Server代理按特定计划执行的一组特定任务。 根据定义的时间表,SQL作业可以执行一次或多次。 您还可以通过执行名为sp_start_job的系统存储过程来运行作业。 SQL作业的执行状态由SQL Server代理监视。

SQL jobs can have multiple steps, and each step can perform different tasks. The SQL job executes at a specific schedule configured by the user. Apart from administrative tasks, we can use it to perform the following tasks:

SQL作业可以包含多个步骤,并且每个步骤可以执行不同的任务。 SQL作业按用户配置的特定计划执行。 除了管理任务,我们还可以使用它执行以下任务:

  1. Execute SQL Server integration services packages 执行SQL Server集成服务包
  2. Execute the T-SQL Query, Operating system commands (CmdExec), and PowerShell commands 执行T-SQL查询,操作系统命令(CmdExec)和PowerShell命令
  3. The execute SQL Server analysis service command or the query 执行SQL Server分析服务命令或查询
    1. Replication distributor 复制分发服务器
    2. Replication Merge 复制合并
    3. Replication queue reader 复制队列读取器
    4. Replication Snapshot 复制快照
    5. Replication Transactional-Log reader 复制事务日志读取器

时间表 (Schedules)

The schedule is a specific time when the SQL job will run. One or multiple jobs can run at the same time or we can apply the same schedule to multiple jobs. The SQL job execution can be scheduled under the following conditions:

该计划是运行SQL作业的特定时间。 一个或多个作业可以同时运行,或者我们可以将相同的时间表应用于多个作业。 可以在以下条件下安排SQL作业的执行:

  1. Recurring schedule (Daily, Weekly, Monthly) 定期计划(每天,每周,每月)
  2. Executes only once at a specific date and time (One Time) 在特定的日期和时间仅执行一次(一次)
  3. When the CPU becomes idle 当CPU空闲时
  4. Start at the job when the SQL Server agent service started 在SQL Server代理服务启动时从作业开始

警报 (Alerts)

Alert is an automated response to the specific event that occurred during the execution of the SQL job. For example, if we are running a job that executes an SSIS package that inserts a lot of data in the table and during the execution of the job, if the CPU utilization reaches the specific threshold, then we can notify the operators. Alerts can be configured on the following events:

警报是对在SQL作业执行期间发生的特定事件的自动响应。 例如,如果我们正在运行一个执行SSIS包的作业,并且该作业在执行过程中在表中插入了很多数据,则如果CPU利用率达到特定阈值,则可以通知操作员。 可以在以下事件上配置警报:

  1. SQL Server performance condition SQL Server性能条件
  2. A specific WMI event occurs on the computer where the SQL job is running 在运行SQL作业的计算机上发生特定的WMI事件
  3. Any SQL server condition occurs 发生任何SQL Server条件

经营者 (Operators)

An operator defines contact information for a person who is responsible for the maintenance of one or more instances of SQL Server. For instance, in some enterprises, the responsibility of managing the production databases and development database servers to separate teams of database admins. In these cases, we can create two separate operators for better manageability of alerts. Operators do not contain any security information and do not define a security principal.

操作员为负责维护一个或多个SQL Server实例的人员定义联系信息。 例如,在某些企业中,管理生产数据库和开发数据库服务器以使数据库管理员团队分开的责任。 在这些情况下,我们可以创建两个单独的运算符,以提高警报的可管理性。 操作员不包含任何安全信息,也没有定义安全主体。

SQL Server notifies operators of alerts using the following methods:

SQL Server使用以下方法通知操作员警报:

  • E-mail 电子邮件
  • Pager (through e-mail) 传呼机(通过电子邮件)

We can also configure the fail-safe operator, which is used if all other operator notifications fail. We can configure the fail-safe operator after you configure one or more operators.

我们还可以配置故障保护运算符,如果所有其他运算符通知均失败,则使用该运算符。 配置一个或多个操作员后,我们可以配置故障保护操作员。

When we install the SQL Server, by default, the agent service does not start automatically, and the service startup type is “Manual”. We must start it manually and set the service startup type to “Automatic”.

默认情况下,当我们安装SQL Server时,代理服务不会自动启动,并且服务启动类型为“手动”。 我们必须手动启动它,并将服务启动类型设置为“自动”。

In order to create a new SQL Server maintenance plan or SQL Server job, the SQL Server Agent service must be running, and we must enable the SQL Server Agent XPs configuration parameter. When we enable Agent XPs, it enables the specific extended stored procedure that is used by SQL Server Agent services to create maintenance plans and SQL jobs. The Agent XPs allow the SQL Server Agent to perform the privileged actions which execute externally to the SQL Server under the security context of the SQL Server Agent service account.

为了创建新SQL Server维护计划或SQL Server作业,SQL Server代理服务必须正在运行,并且我们必须启用SQL Server代理XPs配置参数。 当我们启用代理XP时,它将启用由SQL Server代理服务用来创建维护计划和SQL作业的特定扩展存储过程。 代理XP允许SQL Server代理执行特权操作,这些特权操作在SQL Server代理服务帐户的安全上下文下在SQL Server外部执行。

Two possible values of the Agent XPs configuration parameter are as following:

Agent XPs配置参数的两个可能值如下:

  • Zero (0): This value indicates that SQL Server extended stored procedure OR Agent XPs are disabled 零(0) :此值表示已禁用SQL Server扩展存储过程或代理XP
  • One (1): This value indicates that the SQL Server extended stored procedure OR Agent XPs is enabled 一(1) :此值表示已启用SQL Server扩展存储过程或代理XP

We can change the configuration settings without restarting the SQL Server services or SQL Server Agent service.

我们可以更改配置设置,而无需重新启动SQL Server服务或SQL Server代理服务。

问题陈述 (Problem statement)

After installation of SQL Server on new servers, users were unable to create the maintenance plans or SQL jobs. When they try to create a maintenance plan or SQL Server job, they were facing the error: Agent XPs Disabled. See the following image:

在新服务器上安装SQL Server之后,用户将无法创建维护计划或SQL作业。 当他们尝试创建维护计划或SQL Server作业时,他们遇到以下错误: Agent XPs Disabled 。 见下图:

There are two possible root causes of the issue:

此问题可能有两个根本原因:

  1. The SQL Server Agent service is not running SQL Server代理服务未运行
  2. The SQL Server Agent job is running, but the configuration parameter Agent XPs is disabled SQL Server代理作业正在运行,但是配置参数“代理XP”已禁用

SQL Server代理服务未运行 (SQL Server Agent service is not running)

You might face this when the SQL Server service is not running. See the following image:

当SQL Server服务未运行时,您可能会遇到此问题。 见下图:

To fix the issue, you must start the Agent service from the SQL Server Configuration Manager.

要解决此问题,必须从SQL Server配置管理器启动代理服务。

To do that, open SQL Server Configuration Manager, select SQL Server Services, right-click on SQL Server Agent (MSSQLSERVER), and choose Start. See the following image:

为此,请打开“ SQL Server配置管理器” ,选择“ SQL Server服务” ,右键单击“ SQL Server代理(MSSQLSERVER)” ,然后选择“ 启动” 。 见下图:

Alternatively, you can start the agent service from services. To do that, open Control Panel | Administrative tools locate and open Services, then in the Services window select the SQL Server Agent (MSSQLSERVER) service and click on Start. See the following image:

或者,您可以从服务启动代理服务。 为此,请打开控制面板 |。 管理工具找到并打开“ 服务” ,然后在“ 服务”窗口中选择“ SQL Server代理(MSSQLSERVER)”服务,然后单击“ 启动” 。 见下图:

You can start from SQL Server Management Studio as well. To do that, from Object Explorer, expand Integration Services Catalogs, right-click on SQL Server Agent and select Start. See the following image:

您也可以从SQL Server Management Studio开始。 为此,在Object Explorer中,展开Integration Services Catalogs ,右键单击SQL Server Agent,然后选择Start 。 见下图:

Once the SQL Server Agent service is started, you will be able to create the maintenance plan and SQL jobs.

SQL Server代理服务启动后,您将能够创建维护计划和SQL作业。

禁用了配置参数Agent XPs (The configuration parameter Agent XPs is disabled)

When we start the SQL Server Agent service, by default, the component Agent XPs should be enabled automatically, but sometimes, it is not, and then we have to manually enable it by changing the values of the configuration parameter, under those circumstances, you might receive an error Agent XPs disabled.

在启动SQL Server代理服务时,默认情况下,应自动启用组件代理XP ,但有时不启用它,然后我们必须通过更改配置参数的值来手动启用它,在这种情况下,您可以可能会收到错误的Agent XPs Disabled

If SQL Service is running and you still receive the Agent XPs disabled error, then you should check the value of the Agent XPs configuration parameter. To view the value of it, execute the following query:

如果SQL服务正在运行,并且您仍然收到Agent XPs禁用错误,则应检查Agent XPs配置参数的值。 要查看其值,请执行以下查询:

use master
go
select * from sys.configurations where name='Agent XPs'

Following is the output:

以下是输出:

As you can see in the above screenshot, the value of Agent XPs is 0, which means that the Agent XPs component is disabled. You can also see the tiny red cross icon in Object Explorer of SQL Server Management Studio:

如您在上面的屏幕快照中所见, Agent XPs的值为0 ,这意味着Agent XPs组件被禁用。 您还可以在SQL Server Management Studio的“对象资源管理器”中看到微小的红叉图标:

To enable Agent XP, we must change the configuration value using the exec sp_configure command. The sp_configure is the system stored procedure, and to execute it, the user must be a member of the sysadmin fixed server role on the SQL Server instance.

要启用Agent XP,我们必须使用exec sp_configure命令更改配置值。 sp_configure是系统存储过程,要执行该过程,用户必须是SQL Server实例上sysadmin固定服务器角色的成员。

The Agent XP is an advanced configuration parameter; hence first, we must enable the advanced options. To do that, execute the following query:

Agent XP是高级配置参数。 因此,首先,我们必须启用高级选项。 为此,执行以下查询:

use master
go
exec sp_configure 'Show advanced options',1
Go
reconfigure with override
go

See the following screenshot:

请参见以下屏幕截图:

Once the advance configuration option is enabled, execute the following query to enable the Agent XP:

启用高级配置选项后,执行以下查询以启用Agent XP:

use master
go
exec sp_configure 'Agent XPs',1
Go
reconfigure with override
go

See the following screenshot:

请参见以下屏幕截图:

Execute the following query to verify that the values of the configuration parameters have been changed:

执行以下查询以验证配置参数的值已更改:

use master
go
select * from sys.configurations where name in ('Agent XPs','Show advanced options')

See the following image:

见下图:

As you can see in the above image, the value of the configuration parameters Agent XPs and Show advanced options have been changed from 0 to 1, which indicates that both configuration parameters are enabled. Once the Agent XPs option is enabled, you can see that the tiny red cross has been disappeared from Object Explorer:

如上图所示, 代理程序XPs显示高级选项的配置参数值已从0更改为1,表示这两个配置参数均已启用。 启用“代理XPs”选项后,您可以看到微小的红叉已从对象资源管理器中消失:

For security purposes, it is always advisable to keep the Show advanced options parameter disabled. Execute the following query to disable the Show advanced option configuration parameter:

为了安全起见,建议始终禁用“ 显示高级选项”参数。 执行以下查询以禁用“ 显示高级”选项配置参数:

use master
go
exec sp_configure 'Show advanced options',0
Go
reconfigure with override
go

Once the Agent XPs component is enabled, you should be able to create the SQL jobs and maintenance plans.

启用代理XPs组件后,您应该能够创建SQL作业和维护计划。

结论 (Conclusion)

In this article, I have explained about SQL Server Agent service, its components, and Agent XPs configuration parameters. Moreover, I have explained the possible root causes of the error Agent XPs disabled and how to fix them.

在本文中,我已解释了有关SQL Server代理服务,其组件和代理XPs配置参数的信息。 此外,我已经解释了禁用代理XP的错误的可能根源以及如何修复它们。

翻译自: https://www.sqlshack.com/how-to-fix-the-agent-xps-disabled-error/

禁用 ssh agent

禁用 ssh agent_如何修复“禁用Agent XP”错误相关推荐

  1. 【甄选靶场】Vulnhub百个项目渗透——项目十一:skytower-1(代理登录ssh,绕过shell禁用)

    Vulnhub百个项目渗透 Vulnhub百个项目渗透--项目十一:skytower-1(代理登录ssh,绕过shell禁用) ==================靶场地址============== ...

  2. 禁用 SSH 远程主机的公钥检查

    SSH 公钥检查是一个重要的安全机制,可以防范中间人劫持等黑客攻击.但是在特定情况下,严格的 SSH 公钥检查会破坏一些依赖 SSH 协议的自动化任务,就需要一种手段能够绕过 SSH 的公钥检查. 首 ...

  3. linux系统禁用ssh,怎么在Linux系统中禁用 SSH

    今天微子网络与你分享了如何在Linux系统中禁用SSH,微子网络认为这很实用,所以他分享给你学习.希望你看完这篇文章能有所收获.话不多说,让我们和微子网络一起看看 SSH是什么? Openssh叫做O ...

  4. 禁用ubuntu 摄像头_如何禁用您的网络摄像头(以及为什么要这么做)

    禁用ubuntu 摄像头 Once a concern that was the province of the paranoid, years worth of reports and revela ...

  5. 重启后网卡失效 需要禁用再起来_win2008网卡禁用后如何启动 - 卡饭网

    安装网卡驱动后开机速度变慢怎么办 安装网卡驱动后开机速度变慢怎么办 安装网卡驱动后重新启动计算机,发现启动速度明显比以前慢了很多. 故障解决:首先排除安装驱动过程中出现过错误.通常说来,当单机进行了网 ...

  6. Android禁用软键盘和取消禁用软键盘

    最近参加了一个项目,主要需要适应带有物理键盘的小屏幕机型,因为屏幕小的原因,所以不能用软件盘,而需要使用物理键盘来进行输入操作. 找了很久,终于发现了相对适当的方法: 在BaseActivity里禁用 ...

  7. Win10怎么禁用系统更新服务 Win10禁用系统更新服务教程

    win10默认开启了自动更新的功能,通过win10自动更新可以更好的完善win10系统,降低安全风险.不过有网友担心win10更新会与硬件不兼容,想禁用更新服务,因此想了解如何禁用win10自动更新. ...

  8. 禁用wifi共享精灵、禁用wifi热点、win7禁用wifi

    当前,在企业局域网中,正在悄然流行一种新的无线上网的方式,也就是随身wifi.wifi共享精灵等方式.随身wifi产品是通过和无线运营商提供的无线上网芯片(sim卡),组成一个可以移动的wifi接收发 ...

  9. Powershell批量禁用指定用户及将禁用用户移动到指定OU

    Powershell批量禁用指定用户及将禁用用户移动到指定OU 批量禁用指定用户及将禁用用户移动到指定OU 作为企业管理员,日常最基本的任务就是对每日的用户删除及创建:同样我们知道,微软系统自带Dsq ...

最新文章

  1. qdockwidget设置隐藏标题栏,重叠时tab标签位置,自动填充满整个窗口
  2. javascript rsa java,用javascript与java执行 RSA加密与解密
  3. ijkplayer-android框架详解
  4. SpringBoot中使用yml配置文件以及配置类实现文件上传下载路径的修改
  5. exchange系列(四)如何保护exchange邮件服务器的安全
  6. 架构:消息幂等(去重)如何解决?
  7. so使用原则(要么不支持,要么全部支持) 固定的运行平台 指定目录:System.load(/data/data/package-name/mydir/libmath.so);
  8. ng-model 数据不更新 及 ng-repeat【ngRepeat:dupes】错误
  9. JaxWsProxyFactoryBean调用WebService实例
  10. 阿里巴巴Java开发手册.pdf (详尽版 和 终极版)
  11. 【连载】【STM32神舟III号实验例程】SysTick实验(11)
  12. 避免360浏览器极速模式自动填充表单
  13. leetcode675. Cut Off Trees for Golf Event(Hard)
  14. 大数据学习的五大步骤
  15. 解决Could not build wheels for pikepdf which use PEP 517 and cannot be installed directly
  16. kafka consumer消费者 offset groupID详解
  17. java冒泡排序打印实时动态图(借鉴+改动)
  18. 支付宝小程序状态栏显示图片
  19. 正则表达式元字符大整理
  20. 如何让百度搜索到我的博客或者网站

热门文章

  1. layui数据表格如何获取id_LayUI之table数据表格获取行、行高亮等相关操作
  2. 设计模式之 --- 工厂模式(下)
  3. [ZJOI2008]骑士
  4. Apache 2.4 编码GB2312中文乱码的问题
  5. xxx is not in the sudoers file. This incident will be reported
  6. Log4j 与 Logback的ConversionPattern对比
  7. IOS开发 ios7适配
  8. Google、Baidu
  9. LeetCode(520)——检测大写字母(JavaScript)
  10. 【jQuery学习】—jQuery对象的串联