Is there any way to get windows task manager details through tsql?(有没有办法通过tsql获取windows任务管理器的详细信息?)
问题描述
我无权访问客户端的 Windows 远程机器,我仅通过 tsql 连接他们的数据库服务器.我需要检查哪些进程占用了更多内存并通知他们.是否有任何 tsql 查询来获取 Windows 进程?
I do not have access to the client's windows remote machine,I connect their database server through tsql only.I need to check what processes taking more memory and inform them. Is there any tsql query to get windows processes?
推荐答案
是的,这是可能的.您可以通过 xp_cmdshell:
Yes, it is possible. You can call TASKLIST command via xp_cmdshell:
exec master..xp_cmdshell 'TASKLIST'
输出:
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
System Idle Process 0 0 4 K
System 4 0 140 K
smss.exe 212 0 956 K
csrss.exe 332 0 5,560 K
.....
sqlservr.exe 1492 0 92,012 K
sqlservr.exe 1532 0 95,928 K
.....
注意:您应该具有正确的权限和服务器配置选项才能运行 xp_cmdshell.阅读 MSDN 中的备注部分以了解如何启用 xp_cmdshell
Note: you should have the correct permissions and Server configuration options to run xp_cmdshell. Read the remarks section in MSDN to understand how to enable xp_cmdshell
这篇关于有没有办法通过tsql获取windows任务管理器的详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有没有办法通过tsql获取windows任务管理器的详细信
基础教程推荐
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 无法解决整理冲突 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 在 SQL 中连接多个表 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
