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任务管理器的详细信


基础教程推荐
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- oracle区分大小写的原因? 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 在多列上分布任意行 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01