SQL Server 代理作业帐户问题 [英] SQL Server agent job account issue

查看:52
本文介绍了SQL Server 代理作业帐户问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 SQL Server 2008.我对运行 SQL Server 代理作业时将使用哪个帐户感到困惑.我的困惑是,

I am using SQL Server 2008. I am confused about which account will be used when a SQL Server agent job runs. My confusions are,

  1. SQL Server 代理作为 Windows 服务,我们可以从 Windows 服务管理控制台控制它,从那里我们可以设置帐户来运行 SQL Server 代理(我的计算机中的本地系统);
  2. 我可以设置运行 SQL Server 代理作业级帐户吗?
  3. 我能否在每个步骤中设置 SQL Server 代理作业步骤将在哪个帐户上运行?

我有上述困惑,因为可能会使用 3 个不同的帐户系统,我关心的是每个步骤将运行的实际帐户是什么,我想避免任何权限问题(即我想确保帐户有足够的权限.)有什么意见或建议吗?感谢谁能把账户的3级说清楚,搞得我很困惑.

I have above confusions because 3 different account systems may be used and my concern is what is the actual account each step will run on, and I want to avoid any permisson issues (i.e. I want to make sure the account have enough permission.). Any comments or advice? Appreciate anyone could clarify the 3 levels of accounts, which makes me very confused.

提前致谢,乔治

推荐答案

我通常会在您的应用访问数据库的同一帐户下运行 SQL Server 代理作业.

I would typically run the SQL Server Agent jobs under the same account as your app accesses the database.

如果该帐户的权限太有限(这可能是一件好事!),我会为该应用程序及其所有 SQL 作业(如果可能)创建一个帐户,并在该帐户下运行所有​​ SQL 作业.

If that account is too limited in its permissions (which might be a good thing!), I would create a single account for that app and all its SQL jobs (if that's possible) and run all SQL jobs under that account.

您可能会在不同的帐户下运行每个步骤,但我一般不会使用它(这只会让您很难知道和理解在哪个帐户下运行的内容).仅当您必须运行需要大量额外权限且这些权限仅适用于特定系统帐户或其他内容的特别敏感步骤时才使用它.

You could potentially run each step under a different account, but I wouldn't use that in general (it just makes it really hard to know and understand what is run under which account). Only use it if you have to run a particularly sensitive step that needs a bunch of extra permissions and those permissions are only available to a particular system account or something.

运行 SQL Server 代理 Windows 服务的帐户实际上不会影响您的作业步骤将在其下运行.

The account under which the SQL Server Agent windows service runs really doesn't have an impact on what your job steps will be run under.

因此归结为实际上只有两个帐户:

So it boils down to really just two accounts:

  • 运行 SQL Server 代理 Windows 服务需要一个帐户 - 这是您计算机/服务器上的一个 Windows 帐户,它需要有足够的权限来运行该服务、启动和停止它 - 使用 LocalSystem、Network服务,或您必须使用的任何其他 Windows 帐户

  • one account is needed to run the SQL Server Agent Windows service - this is a Windows account on your machine / server which needs to have enough permissions to run the service, start and stop it - either use LocalSystem, Network Service, or whatever other Windows account you have to run services with

另一个帐户将是运行 SQL Server 代理步骤的帐户 - 通常是一个 SQL Server 帐户(可能基于 Windows 帐户),并且它需要在 SQL Server 内部具有足够的权限才能执行其操作工作,例如它需要访问数据库对象和所有.我会努力为每个运行 SQL Server 作业的应用程序设置一个一个帐户 - 让生活变得更轻松!

The other account would be the account to run your SQL Server Agent steps under - that's typically a SQL Server account (which could be based on a Windows account), and it needs enough privileges inside SQL Server to do its job, e.g. it needs access to the database objects and all. I would strive to have just one account for each app that runs the SQL Server jobs - makes life a whole lot easier!

马克

PS:要设置用户在其下运行步骤,您需要使用作业步骤属性对话框中的高级"页面并从弹出窗口中选择用户:

PS: To set the user to run a step under, you need to use the "Advanced" page on the Job step property dialog and select the user from a popup window:

这篇关于SQL Server 代理作业帐户问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆