SQL Server Profiler - 监视对象的权限被拒绝?
我正在使用 SQL Profiler 来观察一些数据库活动,并且我有兴趣观察数据库中各种对象的“权限被拒绝”。 “安全审核”类别中大约有 50 个不同的项目,但似乎没有一个项目显示对象的“权限被拒绝”。 我可以看到“登录失败”和其他一些失败,但在对象级别上什么也没有。
示例:用户拥有数据库的权限,但没有特定表的权限。 当他们尝试从该表中进行选择时,他们会收到一个错误 - 我可以让探查器监视这些错误吗?
I'm using SQL Profiler to watch some database activity, and I'm interested in watching "Permission Denied" for various objects in the database. There are about 50 different items in the "Security Audit" category, but none that seem to display "Permission denied" for an object. I can see Login Failed, and a few other failures, but nothing on the object level.
Example: A user has permission to a database, but not on a particular table. When they attempt to select from that table, they'll receive an error - can I have profiler watch for these errors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您想要捕获“错误和警告”部分中的“用户错误消息”事件。 您可以根据需要过滤“错误”列。 错误229表示权限被拒绝
You want to capture the "User Error Message" event in the "Errors and Warnings" section. You can filter the Error column as you see fit. Error 229 is permission denied
这可能会实现相同的效果:
回到 SQL 2000,您可以修改错误消息 229,以便将“权限被拒绝”写入 SQL 错误日志。
我不知道这是否/如何适用于 SQL 2005+ 可能不适用于,连接但Tibor Karaszi 说,也许我们现在可以。 我无法测试自己,抱歉。
编辑:这样做的优点是您不需要运行探查器或跟踪器...
This might achieve the same:
Back in SQL 2000, you could modify error message 229 so "permission denied" is written to the SQL error log.
I don't know if/how this works for SQL 2005+ probably not, says Connect but maybe we can now says Tibor Karaszi. I can't test myself, sorry.
Edit: This has the advantage that you don't need profiler or a tracer running...