[转帖]System Dynamic Management Views

System Dynamic Management Views

https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/system-dynamic-management-views?view=sql-server-2017

APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data Warehouse

Dynamic management views and functions return server state information that can be used to monitor the health of a server instance, diagnose problems, and tune performance.

Important

Dynamic management views and functions return internal, implementation-specific state data. Their schemas and the data they return may change in future releases of SQL Server. Therefore, dynamic management views and functions in future releases may not be compatible with the dynamic management views and functions in this release. For example, in future releases of SQL Server, Microsoft may augment the definition of any dynamic management view by adding columns to the end of the column list. We recommend against using the syntax SELECT * FROM dynamic_management_view_name in production code because the number of columns returned might change and break your application.

There are two types of dynamic management views and functions:

  • Server-scoped dynamic management views and functions. These require VIEW SERVER STATE permission on the server.
  • Database-scoped dynamic management views and functions. These require VIEW DATABASE STATE permission on the database.

Querying Dynamic Management Views

Dynamic management views can be referenced in Transact-SQL statements by using two-part, three-part, or four-part names. Dynamic management functions on the other hand can be referenced in Transact-SQL statements by using either two-part or three-part names. Dynamic management views and functions cannot be referenced in Transact-SQL statements by using one-part names.

All dynamic management views and functions exist in the sys schema and follow this naming convention dm_*. When you use a dynamic management view or function, you must prefix the name of the view or function by using the sys schema. For example, to query the dm_os_wait_stats dynamic management view, run the following query:

SQLCopy

SELECT wait_type, wait_time_ms
FROM sys.dm_os_wait_stats;

Required Permissions

To query a dynamic management view or function requires SELECT permission on object and VIEW SERVER STATE or VIEW DATABASE STATE permission. This lets you selectively restrict access of a user or login to dynamic management views and functions. To do this, first create the user in master and then deny the user SELECT permission on the dynamic management views or functions that you do not want them to access. After this, the user cannot select from these dynamic management views or functions, regardless of database context of the user.

Note

Because DENY takes precedence, if a user has been granted VIEW SERVER STATE permissions but denied VIEW DATABASE STATE permission, the user can see server-level information, but not database-level information.

In This Section

Dynamic management views and functions have been organized into the following categories.

   
Always On Availability Groups Dynamic Management Views and Functions (Transact-SQL) Memory-Optimized Table Dynamic Management Views (Transact-SQL)
Change Data Capture Related Dynamic Management Views (Transact-SQL) Object Related Dynamic Management Views and Functions (Transact-SQL)
Change Tracking Related Dynamic Management Views Query Notifications Related Dynamic Management Views (Transact-SQL)
Common Language Runtime Related Dynamic Management Views (Transact-SQL) Replication Related Dynamic Management Views (Transact-SQL)
Database Mirroring Related Dynamic Management Views (Transact-SQL) Resource Governor Related Dynamic Management Views (Transact-SQL)
Database Related Dynamic Management Views (Transact-SQL) Security-Related Dynamic Management Views and Functions (Transact-SQL)
Execution Related Dynamic Management Views and Functions (Transact-SQL) Server-Related Dynamic Management Views and Functions (Transact-SQL)
Extended Events Dynamic Management Views Service Broker Related Dynamic Management Views (Transact-SQL)
Filestream and FileTable Dynamic Management Views (Transact-SQL) Spatial Data Related Dynamic Management Views and Functions (Transact-SQL)
Full-Text Search and Semantic Search Dynamic Management Views and Functions (Transact-SQL) SQL Data Warehouse and Parallel Data Warehouse Dynamic Management Views (Transact-SQL)
Geo-Replication Dynamic Management Views and Functions (Azure SQL Database) SQL Server Operating System Related Dynamic Management Views (Transact-SQL)
Index Related Dynamic Management Views and Functions (Transact-SQL) Stretch Database Dynamic Management Views (Transact-SQL)
I O Related Dynamic Management Views and Functions (Transact-SQL) Transaction Related Dynamic Management Views and Functions (Transact-SQL)

原文地址:https://www.cnblogs.com/jinanxiaolaohu/p/11450944.html

时间: 2024-10-12 14:58:14

[转帖]System Dynamic Management Views的相关文章

Oracle Dynamic Performance Views Version 12.2.0.1

Oracle Dynamic Performance ViewsVersion 12.2.0.1 https://www.morganslibrary.org/reference/dyn_perf_view.html General Information Library Note Coming to OpenWorld 2018? Be sure to visit the TidalScale booth in Moscone South and learn how to solve perf

MVC 无法将带 [] 的索引应用于“System.Dynamic.DynamicObject”类型的表达式

无法将带 [] 的索引应用于“System.Dynamic.DynamicObject”类型的表达式 说明: 执行当前 Web 请求期间,出现未经处理的异常.请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息. 异常详细信息: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 无法将带 [] 的索引应用于“System.Dynamic.DynamicObject”类型的表达式 解决方法: ViewBag["xxx&q

System.Dynamic.ExpandoObject 类型的简单使用

该类型可以实现的是动态添加属性和移除属性,有点类似 js 中对象的操作,非常灵活 1 static void Main(string[] args) 2 { 3 dynamic obj = new System.Dynamic.ExpandoObject(); 4 obj.name = "jj"; 5 obj.age = 10; 6 obj.gender = 1; 7 8 foreach (var item in (IDictionary<string,object>)ob

Data Dictionary and Dynamic Performance Views(数据字典和动态性能视图)

Overview of the Data Dictionary Because Oracle Database stores data dictionary data in tables, just like other data, users can query the data with SQL. Contents of the Data Dictionary The data dictionary consists of the following types of objects: Ba

Modern Operating System --- Power Management (OS Issues)

The operating system plays a key role in energy management. It controls all the devices, so it must decide what to shutdown and when to shut it down. If it shuts down a device and that device is needed again quickly, there may be an annoying delay wh

Modern Operating System --- Power Management (Hardware Issues)

The general approach most computer vendors take to battery conservation is to design the CPU, memory, and I/O devices to have multiple states: on, sleeping, hiberating, and off. To use the device, it must be on. When the device will not be needed for

Modern Operating System --- Power Management (Hard Disk)

Another major villain is the hard disk. It takes substantial energy to keep it spinning at high speed, even if there are no accesses. Many conputers, especially notebooks, spin the disk down after a certain number of seconds or minutes of inactivity.

Modern Operating System --- Power Management (CPU)

The CPU can also be managed to save energy. A notebook CPU can be put to sleep in software, reducing power usage to almost zero. The only thing it can do in this state is waking up when an interrupt occurs. Therefor, whenever the CPU goes idle, eithe

[转帖]sys.dm_exec_connections (Transact-SQL)

sys.dm_exec_connections (Transact-SQL) https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-connections-transact-sql?view=sql-server-2017 APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Wareho