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 任务管理器的详细信息?
基础教程推荐
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01