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?
推荐答案
是的,有可能.您可以通过 TASKLIST 命令调用 TASKLIST 命令msdn.microsoft.com/en-us/library/ms175046.aspx" rel="noreferrer">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 任务管理器的详细信息?


基础教程推荐
- 从字符串 TSQL 中获取数字 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01