sys.dm_tran_locks (Transact-SQL)sys.dm_tran_locks (Transact-SQL)

适用对象: 是SQL Server 是Azure SQL 数据库 是Azure Synapse Analytics (SQL DW) 是并行数据仓库 APPLIES TO: yesSQL Server yesAzure SQL Database yesAzure Synapse Analytics (SQL DW) yesParallel Data Warehouse

返回 SQL Server 2019SQL Server 2019 中有关当前活动的锁管理器资源的信息。Returns information about currently active lock manager resources in SQL Server 2019SQL Server 2019. 向锁管理器发出的已授予锁或正等待授予锁的每个当前活动请求分别对应一行。Each row represents a currently active request to the lock manager for a lock that has been granted or is waiting to be granted.

结果集中的列大体分为两组:资源组和请求组。The columns in the result set are divided into two main groups: resource and request. 资源组说明正在进行锁请求的资源,请求组说明锁请求。The resource group describes the resource on which the lock request is being made, and the request group describes the lock request.

备注

若要从 Azure Synapse Analytics (SQL DW)Azure Synapse Analytics (SQL DW)并行数据仓库Parallel Data Warehouse 调用此项,请使用名称 _pdw_nodes_tran_locksTo call this from Azure Synapse Analytics (SQL DW)Azure Synapse Analytics (SQL DW) or 并行数据仓库Parallel Data Warehouse, use the name sys.dm_pdw_nodes_tran_locks.

列名Column name 数据类型Data type 描述Description
resource_typeresource_type nvarchar(60)nvarchar(60) 表示资源类型。Represents the resource type. 该值可以是下列值之一:DATABASE、FILE、OBJECT、PAGE、KEY、片区、RID、APPLICATION、METADATA、HOBT 或 ALLOCATION_UNIT。The value can be one of the following: DATABASE, FILE, OBJECT, PAGE, KEY, EXTENT, RID, APPLICATION, METADATA, HOBT, or ALLOCATION_UNIT.
resource_subtyperesource_subtype nvarchar(60)nvarchar(60) 表示resource_type的子类型。Represents a subtype of resource_type. 从技术角度而言,可以在未持有父类型的非子类型化锁的情况下获取子类型锁。Acquiring a subtype lock without holding a nonsubtyped lock of the parent type is technically valid. 不同的子类型之间以及与非子类型化的父类型之间都不会发生冲突。Different subtypes do not conflict with each other or with the nonsubtyped parent type. 并非所有资源类型都有子类型。Not all resource types have subtypes.
resource_database_idresource_database_id intint 此资源位于其范围之内的数据库的 ID。ID of the database under which this resource is scoped. 由锁管理器处理的所有资源均按该数据库 ID 划分范围。All resources handled by the lock manager are scoped by the database ID.
resource_descriptionresource_description nvarchar(256)nvarchar(256) 资源的说明,其中只包含从其他资源列中无法获取的信息。Description of the resource that contains only information that is not available from other resource columns.
resource_associated_entity_idresource_associated_entity_id bigintbigint 数据库中与资源相关联的实体的 ID。ID of the entity in a database with which a resource is associated. 该值可以是对象 ID、Hobt ID 或分配单元 ID,具体视资源类型而定。This can be an object ID, Hobt ID, or an Allocation Unit ID, depending on the resource type.
resource_lock_partitionresource_lock_partition IntInt 已分区锁资源的锁分区 ID。ID of the lock partition for a partitioned lock resource. 对于未分区锁资源,该值为 0。The value for nonpartitioned lock resources is 0.
request_moderequest_mode nvarchar(60)nvarchar(60) 请求的模式。Mode of the request. 对于已授予的请求,为已授予模式;对于等待请求,为正在请求的模式。For granted requests, this is the granted mode; for waiting requests, this is the mode being requested.
request_typerequest_type nvarchar(60)nvarchar(60) 请求类型。Request type. 该值为 LOCK。The value is LOCK.
request_statusrequest_status nvarchar(60)nvarchar(60) 该请求的当前状态。Current status of this request. 可能的值有 GRANTED、CONVERT、WAIT、LOW_PRIORITY_CONVERT、LOW_PRIORITY_WAIT 或 ABORT_BLOCKERS。Possible values are GRANTED, CONVERT, WAIT, LOW_PRIORITY_CONVERT, LOW_PRIORITY_WAIT, or ABORT_BLOCKERS. 有关低优先级等待和中止阻塞程序的详细信息,请参阅ALTER INDEX (transact-sql)low_priority_lock_wait部分。For more information about low priority waits and abort blockers, see the low_priority_lock_wait section of ALTER INDEX (Transact-SQL).
request_reference_countrequest_reference_count smallintsmallint 返回同一请求程序已请求该资源的近似次数。Returns an approximate number of times the same requestor has requested this resource.
request_lifetimerequest_lifetime intint 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
request_session_idrequest_session_id intint 当前拥有该请求的会话 ID。Session ID that currently owns this request. 对于分布式事务和绑定事务,拥有请求的会话 ID 可能不同。The owning session ID can change for distributed and bound transactions. 该值为 -2 时,指示该请求属于孤立的分布式事务。A value of -2 indicates that the request belongs to an orphaned distributed transaction. 该值为 -3 时,指示请求属于延迟的恢复事务,例如因其回滚未能成功完成而延迟恢复该回滚的事务。A value of -3 indicates that the request belongs to a deferred recovery transaction, such as, a transaction for which a rollback has been deferred at recovery because the rollback could not be completed successfully.
request_exec_context_idrequest_exec_context_id intint 当前拥有该请求的进程的执行上下文 ID。Execution context ID of the process that currently owns this request.
request_request_idrequest_request_id intint 当前拥有该请求的进程的请求 ID(批处理 ID)。Request ID (batch ID) of the process that currently owns this request. 每当事务的多个活动的结果集 (MARS) 连接更改时,该值便会更改。This value will change every time that the active Multiple Active Result Set (MARS) connection for a transaction changes.
request_owner_typerequest_owner_type nvarchar(60)nvarchar(60) 拥有请求的实体类型。Entity type that owns the request. 锁管理器请求可由各种实体所拥有。Lock manager requests can be owned by a variety of entities. 可能的值有:Possible values are:

TRANSACTION = 请求由事务所有。TRANSACTION = The request is owned by a transaction.

CURSOR = 请求由游标所有。CURSOR = The request is owned by a cursor.

SESSION = 请求由用户会话所有。SESSION = The request is owned by a user session.

SHARED_TRANSACTION_WORKSPACE = 请求由事务工作区的共享部分所有。SHARED_TRANSACTION_WORKSPACE = The request is owned by the shared part of the transaction workspace.

EXCLUSIVE_TRANSACTION_WORKSPACE = 请求由事务工作区的排他部分所有。EXCLUSIVE_TRANSACTION_WORKSPACE = The request is owned by the exclusive part of the transaction workspace.

NOTIFICATION_OBJECT = 请求由内部 SQL ServerSQL Server 组件所有。NOTIFICATION_OBJECT = The request is owned by an internal SQL ServerSQL Server component. 此组件已经请求锁管理器在有其他组件等待获取锁时进行通知。This component has requested the lock manager to notify it when another component is waiting to take the lock. FileTable 功能是使用此值的一个组件。The FileTable feature is a component that uses this value.

注意: 工作空间在内部使用,用于持有登记的会话的锁。Note: Work spaces are used internally to hold locks for enlisted sessions.
request_owner_idrequest_owner_id bigintbigint 此请求的特定所有者的 ID。ID of the specific owner of this request.

当事务是请求的所有者时,此值包含事务 ID。When a transaction is the owner of the request, this value contains the transaction ID.

当 FileTable 是请求的所有者时, request_owner_id具有以下值之一。When a FileTable is the owner of the request, request_owner_id has one of the following values.



4FileTable 已获取数据库锁。-4 : A FileTable has taken a database lock.

三维空间FileTable 已获取表锁。-3 : A FileTable has taken a table lock.

其他值:该值表示文件句柄。Other value : The value represents a file handle. 此值还显示为动态管理视图sys.databases _filestream_non_transacted_handles (transact-sql)中的fcb_idThis value also appears as fcb_id in the dynamic management view sys.dm_filestream_non_transacted_handles (Transact-SQL).
request_owner_guidrequest_owner_guid uniqueidentifieruniqueidentifier 此请求的特定所有者的 GUID。GUID of the specific owner of this request. 该值仅供分布式事务使用,在该事务中,该值与事务的 MS DTC GUID 相对应。This value is only used by a distributed transaction where the value corresponds to the MS DTC GUID for that transaction.
request_owner_lockspace_idrequest_owner_lockspace_id nvarchar(32)nvarchar(32) 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed. 该值表示请求程序的锁空间 ID。This value represents the lockspace ID of the requestor. 锁空间 ID 确定两个请求程序是否相互兼容以及在两者冲突的模式下是否可以向其授予锁。The lockspace ID determines whether two requestors are compatible with each other and can be granted locks in modes that would otherwise conflict with one another.
lock_owner_addresslock_owner_address varbinary(8)varbinary(8) 用于跟踪该请求的内部数据结构的内存地址。Memory address of the internal data structure that is used to track this request. 此列可以与sys.databases _os_waiting_tasks中的resource_address列联接。This column can be joined the with resource_address column in sys.dm_os_waiting_tasks.
pdw_node_idpdw_node_id intint 适用于: Azure Synapse Analytics (SQL DW)Azure Synapse Analytics (SQL DW)并行数据仓库Parallel Data WarehouseApplies to: Azure Synapse Analytics (SQL DW)Azure Synapse Analytics (SQL DW), 并行数据仓库Parallel Data Warehouse



此分发所在的节点的标识符。The identifier for the node that this distribution is on.

权限Permissions

SQL ServerSQL Server 上,需要 @no__t 权限。On SQL ServerSQL Server, requires VIEW SERVER STATE permission.
SQL 数据库SQL Database 高级层上,需要数据库中的 @no__t 1 权限。On SQL 数据库SQL Database Premium Tiers, requires the VIEW DATABASE STATE permission in the database. 在 @no__t 标准层和基本层上,需要服务器管理员Azure Active Directory 管理员帐户。On SQL 数据库SQL Database Standard and Basic Tiers, requires the Server admin or an Azure Active Directory admin account.

备注Remarks

已授予请求状态指示已将资源上的锁授予请求程序。A granted request status indicates that a lock has been granted on a resource to the requestor. 等待请求指示尚未授予请求。A waiting request indicates that the request has not yet been granted. Request_status列返回以下等待请求类型:The following waiting-request types are returned by the request_status column:

  • 转换请求状态指示已向请求程序授予对资源的请求,并且请求程序当前正在等待升级到要授予的初始请求。A convert request status indicates that the requestor has already been granted a request for the resource and is currently waiting for an upgrade to the initial request to be granted.

  • 等待请求状态指示请求程序当前未持有对资源的已授予请求。A wait request status indicates that the requestor does not currently hold a granted request on the resource.

由于sys.databases _tran_locks是从内部锁管理器数据结构中填充的,因此维护此信息不会给常规处理增加额外的开销。Because sys.dm_tran_locks is populated from internal lock manager data structures, maintaining this information does not add extra overhead to regular processing. 具体化该视图需要访问锁管理器的内部数据结构。Materializing the view does require access to the lock manager internal data structures. 这可能会略微影响服务器中的常规处理。This can have minor effects on the regular processing in the server. 这些影响应该很难察觉,并且应该只会影响频繁使用的资源。These effects should be unnoticeable and should only affect heavily used resources. 由于该视图中的数据与活动的锁管理器状态相对应,因此该数据可能会随时更改,并且在获取和释放锁时会相应地添加和删除行。Because the data in this view corresponds to live lock manager state, the data can change at any time, and rows are added and removed as locks are acquired and released. 该视图不包含历史信息。This view has no historical information.

仅当所有资源组列都相等时,才对同一资源执行两个请求。Two requests operate on the same resource only if all the resource-group columns are equal.

您可以使用下列工具控制读取操作的锁定:You can control the locking of read operations by using the following tools:

使用一个会话 ID 运行的资源可以有多个已授予锁。A resource that is running under one session ID can have more than one granted lock. 在一个会话下运行的不同实体每个都可以拥有同一资源的锁,并且信息将显示在由sys.databases _tran_locks返回的request_owner_typerequest_owner_id列中。Different entities that are running under one session can each own a lock on the same resource, and the information is displayed in the request_owner_type and request_owner_id columns that are returned by sys.dm_tran_locks. 如果存在相同request_owner_type的多个实例,则使用request_owner_id列来区分每个实例。If multiple instances of the same request_owner_type exist, the request_owner_id column is used to distinguish each instance. 对于分布式事务, request_owner_typerequest_owner_guid列将显示不同的实体信息。For distributed transactions, the request_owner_type and the request_owner_guid columns will show the different entity information.

例如,会话 S1 拥有Table1上的共享锁;在 session S1 下运行的事务 T1 也拥有Table1上的共享锁。For example, Session S1 owns a shared lock on Table1; and transaction T1, which is running under session S1, also owns a shared lock on Table1. 在这种情况下, sys.databases _tran_locks返回的resource_description列将显示同一资源的两个实例。In this case, the resource_description column that is returned by sys.dm_tran_locks will show two instances of the same resource. Request_owner_type列会将一个实例显示为会话,将另一个实例显示为事务。The request_owner_type column will show one instance as a session and the other as a transaction. 此外, resource_owner_id列将具有不同的值。Also, the resource_owner_id column will have different values.

在一个会话下运行的多个游标无法区分,被视为一个实体。Multiple cursors that run under one session are indistinguishable and are treated as one entity.

与会话 ID 值没有关联的分布式事务是孤立事务,向该事务分配的会话 ID 值为 -2。Distributed transactions that are not associated with a session ID value are orphaned transactions and are assigned the session ID value of -2. 有关详细信息,请参阅 KILL (Transact-SQL)For more information, see KILL (Transact-SQL).

Locks

锁加在 SQL ServerSQL Server 资源上(如在一个事务中读取或修改的行),以防止各种事务并发使用资源。Locks are held on SQL ServerSQL Server resources, such as rows read or modified during a transaction, to prevent concurrent use of resources by different transactions. 例如,如果一个排它 (X) 锁被一个事务加在某一表的某一行上,在这个锁被释放前,其他事务都不可以修改这一行。For example, if an exclusive (X) lock is held on a row within a table by a transaction, no other transaction can modify that row until the lock is released. 尽可能少使用锁可提高并发性,从而改善性能。Minimizing locks increases concurrency, which can improve performance.

资源详细信息Resource Details

下表列出了在resource_associated_entity_id列中表示的资源。The following table lists the resources that are represented in the resource_associated_entity_id column.

资源类型Resource type 资源说明Resource description Resource_associated_entity_idResource_associated_entity_id
DATABASEDATABASE 表示数据库。Represents a database. 不适用Not applicable
FILEFILE 表示数据库文件。Represents a database file. 此文件可以是数据文件,也可以是日志文件。This file can be either a data or a log file. 不适用Not applicable
OBJECTOBJECT 表示数据库对象。Represents a database object. 此对象可以是数据表、视图、存储过程、扩展存储过程或任何具有对象 ID 的对象。This object can be a data table, view, stored procedure, extended stored procedure, or any object that has an object ID. 对象 IDObject ID
PAGEPAGE 表示数据文件中的单页。Represents a single page in a data file. HoBt ID。HoBt ID. 此值对应于hobt_idThis value corresponds to sys.partitions.hobt_id. PAGE 资源并不总是有 HoBt ID,因为 HoBt ID 是可由调用方提供的额外信息,而有些调用方不能提供该信息。The HoBt ID is not always available for PAGE resources because the HoBt ID is extra information that can be provided by the caller, and not all callers can provide this information.
KEYKEY 表示索引中的一行。Represents a row in an index. HoBt ID。HoBt ID. 此值对应于hobt_idThis value corresponds to sys.partitions.hobt_id.
EXTENTEXTENT 表示数据文件区。Represents a data file extent. 区是由八个连续页构成的组。An extent is a group of eight contiguous pages. 不适用Not applicable
RIDRID 表示堆中的物理行。Represents a physical row in a heap. HoBt ID。HoBt ID. 此值对应于hobt_idThis value corresponds to sys.partitions.hobt_id. RID 资源并不总是有 HoBt ID,因为 HoBt ID 是可由调用方提供的额外信息,而有些调用方不能提供该信息。The HoBt ID is not always available for RID resources because the HoBt ID is extra information that can be provided by the caller, and not all callers can provide this information.
APPLICATIONAPPLICATION 表示指定了应用程序的资源。Represents an application specified resource. 不适用Not applicable
METADATAMETADATA 表示元数据信息。Represents metadata information. 不适用Not applicable
HOBTHOBT 表示堆或 B 树。Represents a heap or a B-tree. 它们是基本访问路径结构。These are the basic access path structures. HoBt ID。HoBt ID. 此值对应于hobt_idThis value corresponds to sys.partitions.hobt_id.
ALLOCATION_UNITALLOCATION_UNIT 表示一组相关页,如索引分区。Represents a set of related pages, such as an index partition. 每个分配单元都包含一个索引分配映射 (IAM) 链。Each allocation unit covers a single Index Allocation Map (IAM) chain. 分配单元 ID。Allocation Unit ID. 此值对应于allocation_units. allocation_unit_idThis value corresponds to sys.allocation_units.allocation_unit_id.

下表列出了与每个资源类型相关联的子类型。The following table lists the subtypes that are associated with each resource type.

ResourceSubTypeResourceSubType 使Synchronizes
ALLOCATION_UNIT.BULK_OPERATION_PAGEALLOCATION_UNIT.BULK_OPERATION_PAGE 用于批处理操作的预先分配的页。Pre-allocated pages used for bulk operations.
ALLOCATION_UNIT.PAGE_COUNTALLOCATION_UNIT.PAGE_COUNT 在延迟删除操作期间的分配单元页计数统计信息。Allocation unit page count statistics during deferred drop operations.
DATABASE.BULKOP_BACKUP_DBDATABASE.BULKOP_BACKUP_DB 数据库备份与大容量操作。Database backups with bulk operations.
DATABASE.BULKOP_BACKUP_LOGDATABASE.BULKOP_BACKUP_LOG 数据库日志备份与大容量操作。Database log backups with bulk operations.
DATABASE.CHANGE_TRACKING_CLEANUPDATABASE.CHANGE_TRACKING_CLEANUP 更改跟踪清除任务。Change tracking cleanup tasks.
DATABASE.CT_DDLDATABASE.CT_DDL 数据库和表级更改跟踪 DDL 操作。Database and table-level change tracking DDL operations.
DATABASE.CONVERSATION_PRIORITYDATABASE.CONVERSATION_PRIORITY Service Broker 会话优先级操作,如 CREATE BROKER PRIORITY。Service Broker conversation priority operations such as CREATE BROKER PRIORITY.
DATABASE.DDLDATABASE.DDL 数据定义语言 (DDL) 操作与文件组操作(如删除)。Data definition language (DDL) operations with filegroup operations, such as drop.
DATABASE.ENCRYPTION_SCANDATABASE.ENCRYPTION_SCAN TDE 加密同步。TDE encryption synchronization.
DATABASE.PLANGUIDEDATABASE.PLANGUIDE 计划引导同步。Plan guide synchronization.
DATABASE.RESOURCE_GOVERNOR_DDLDATABASE.RESOURCE_GOVERNOR_DDL 资源调控器操作的 DDL 操作,例如 ALTER RESOURCE POOL。DDL operations for resource governor operations such as ALTER RESOURCE POOL.
DATABASE.SHRINKDATABASE.SHRINK 数据库收缩操作。Database shrink operations.
DATABASE.STARTUPDATABASE.STARTUP 用于数据库启动同步。Used for database startup synchronization.
FILE.SHRINKFILE.SHRINK 文件收缩操作。File shrink operations.
HOBT.BULK_OPERATIONHOBT.BULK_OPERATION 下列隔离级别下的优化堆大容量加载操作与并发扫描:快照、未提交读和使用行版本控制的已提交读。Heap-optimized bulk load operations with concurrent scan, under these isolation levels: snapshot, read uncommitted, and read committed using row versioning.
HOBT.INDEX_REORGANIZEHOBT.INDEX_REORGANIZE 堆或索引重组操作。Heap or index reorganization operations.
OBJECT.COMPILEOBJECT.COMPILE 存储过程编译。Stored procedure compile.
OBJECT.INDEX_OPERATIONOBJECT.INDEX_OPERATION 索引操作。Index operations.
OBJECT.UPDSTATSOBJECT.UPDSTATS 表的统计信息更新。Statistics updates on a table.
METADATA.ASSEMBLYMETADATA.ASSEMBLY 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ASSEMBLY_CLR_NAMEMETADATA.ASSEMBLY_CLR_NAME 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ASSEMBLY_TOKENMETADATA.ASSEMBLY_TOKEN 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ASYMMETRIC_KEYMETADATA.ASYMMETRIC_KEY 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.AUDITMETADATA.AUDIT 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.AUDIT_ACTIONSMETADATA.AUDIT_ACTIONS 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.AUDIT_SPECIFICATIONMETADATA.AUDIT_SPECIFICATION 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.AVAILABILITY_GROUPMETADATA.AVAILABILITY_GROUP 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CERTIFICATEMETADATA.CERTIFICATE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CHILD_INSTANCEMETADATA.CHILD_INSTANCE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.COMPRESSED_FRAGMENTMETADATA.COMPRESSED_FRAGMENT 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.COMPRESSED_ROWSETMETADATA.COMPRESSED_ROWSET 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CONVERSTATION_ENDPOINT_RECVMETADATA.CONVERSTATION_ENDPOINT_RECV 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CONVERSTATION_ENDPOINT_SENDMETADATA.CONVERSTATION_ENDPOINT_SEND 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CONVERSATION_GROUPMETADATA.CONVERSATION_GROUP 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CONVERSATION_PRIORITYMETADATA.CONVERSATION_PRIORITY 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CREDENTIALMETADATA.CREDENTIAL 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CRYPTOGRAPHIC_PROVIDERMETADATA.CRYPTOGRAPHIC_PROVIDER 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DATA_SPACEMETADATA.DATA_SPACE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DATABASEMETADATA.DATABASE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DATABASE_PRINCIPALMETADATA.DATABASE_PRINCIPAL 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DB_MIRRORING_SESSIONMETADATA.DB_MIRRORING_SESSION 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DB_MIRRORING_WITNESSMETADATA.DB_MIRRORING_WITNESS 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DB_PRINCIPAL_SIDMETADATA.DB_PRINCIPAL_SID 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ENDPOINTMETADATA.ENDPOINT 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ENDPOINT_WEBMETHODMETADATA.ENDPOINT_WEBMETHOD 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.EXPR_COLUMNMETADATA.EXPR_COLUMN 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.EXPR_HASHMETADATA.EXPR_HASH 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.FULLTEXT_CATALOGMETADATA.FULLTEXT_CATALOG 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.FULLTEXT_INDEXMETADATA.FULLTEXT_INDEX 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.FULLTEXT_STOPLISTMETADATA.FULLTEXT_STOPLIST 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.INDEX_EXTENSION_SCHEMEMETADATA.INDEX_EXTENSION_SCHEME 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.INDEXSTATSMETADATA.INDEXSTATS 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.INSTANTIATED_TYPE_HASHMETADATA.INSTANTIATED_TYPE_HASH 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.MESSAGEMETADATA.MESSAGE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.METADATA_CACHEMETADATA.METADATA_CACHE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PARTITION_FUNCTIONMETADATA.PARTITION_FUNCTION 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PASSWORD_POLICYMETADATA.PASSWORD_POLICY 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PERMISSIONSMETADATA.PERMISSIONS 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PLAN_GUIDEMETADATA.PLAN_GUIDE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PLAN_GUIDE_HASHMETADATA.PLAN_GUIDE_HASH 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PLAN_GUIDE_SCOPEMETADATA.PLAN_GUIDE_SCOPE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.QNAMEMETADATA.QNAME 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.QNAME_HASHMETADATA.QNAME_HASH 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.REMOTE_SERVICE_BINDINGMETADATA.REMOTE_SERVICE_BINDING 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ROUTEMETADATA.ROUTE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SCHEMAMETADATA.SCHEMA 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SECURITY_CACHEMETADATA.SECURITY_CACHE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SECURITY_DESCRIPTORMETADATA.SECURITY_DESCRIPTOR 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SEQUENCEMETADATA.SEQUENCE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVER_EVENT_SESSIONSMETADATA.SERVER_EVENT_SESSIONS 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVER_PRINCIPALMETADATA.SERVER_PRINCIPAL 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVICEMETADATA.SERVICE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVICE_BROKER_GUIDMETADATA.SERVICE_BROKER_GUID 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVICE_CONTRACTMETADATA.SERVICE_CONTRACT 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVICE_MESSAGE_TYPEMETADATA.SERVICE_MESSAGE_TYPE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.STATSMETADATA.STATS 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SYMMETRIC_KEYMETADATA.SYMMETRIC_KEY 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.USER_TYPEMETADATA.USER_TYPE 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.XML_COLLECTIONMETADATA.XML_COLLECTION 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.XML_COMPONENTMETADATA.XML_COMPONENT 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.XML_INDEX_QNAMEMETADATA.XML_INDEX_QNAME 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.

下表提供了每种资源类型的resource_description列的格式。The following table provides the format of the resource_description column for each resource type.

ResourceResource 格式Format 描述Description
DATABASEDATABASE 不适用Not applicable Resource_database_id列中已提供数据库 ID。Database ID is already available in the resource_database_id column.
FILEFILE <file_id><file_id> 此资源所表示的文件 ID。ID of the file that is represented by this resource.
OBJECTOBJECT <object_id><object_id> 此资源所表示的对象 ID。ID of the object that is represented by this resource. 此对象可以是sys.databases中列出的任何对象,不仅仅是表。This object can be any object listed in sys.objects, not just a table.
PAGEPAGE < file_id >: < page_in_file ><file_id>:<page_in_file> 表示此资源所表示的页的文件和页 ID。Represents the file and page ID of the page that is represented by this resource.
KEYKEY <hash_value><hash_value> 表示行中由此资源表示的键列的哈希。Represents a hash of the key columns from the row that is represented by this resource.
EXTENTEXTENT < file_id >: < page_in_files ><file_id>:<page_in_files> 表示此资源所表示的区的文件和页 ID。Represents the file and page ID of the extent that is represented by this resource. 区 ID 与区中的第一页的页 ID 相同。The extent ID is the same as the page ID of the first page in the extent.
RIDRID < file_id >: < page_in_file >: < row_on_page ><file_id>:<page_in_file>:<row_on_page> 表示此资源所表示的行的页 ID 和行 ID。Represents the page ID and row ID of the row that is represented by this resource. 请注意,如果关联的对象 ID 为 99,则此资源表示 IAM 链的第一个 IAM 页上的八个混合页槽之一。Note that if the associated object ID is 99, this resource represents one of the eight mixed page slots on the first IAM page of an IAM chain.
APPLICATIONAPPLICATION <DbPrincipalId >: <upto 32 字符 >:(< hash_value >)<DbPrincipalId>:<upto 32 characters>:(<hash_value>) 表示用于划分此应用程序锁资源范围的数据库主体的 ID。Represents the ID of the database principal that is used for scoping this application lock resource. 还包含与此应用程序锁资源相对应的资源字符串,最多包含其中的 32 个字符。Also included are up to 32 characters from the resource string that corresponds to this application lock resource. 在某些情况下,因不再提供完整字符串而只能显示 2 个字符。In certain cases, only 2 characters can be displayed due to the full string no longer being available. 只有在恢复过程中重新获取的应用程序锁处于数据库恢复期间才会发生此行为。This behavior occurs only at database recovery time for application locks that are reacquired as part of the recovery process. 哈希值表示与此应用程序锁资源相对应的完整资源字符串的哈希。The hash value represents a hash of the full resource string that corresponds to this application lock resource.
HOBTHOBT 不适用Not applicable HoBt ID 包含在resource_associated_entity_id中。HoBt ID is included as the resource_associated_entity_id.
ALLOCATION_UNITALLOCATION_UNIT 不适用Not applicable 分配单元 ID 包含为resource_associated_entity_idAllocation Unit ID is included as the resource_associated_entity_id.
METADATA.ASSEMBLYMETADATA.ASSEMBLY assembly_id = Aassembly_id = A 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ASSEMBLY_CLR_NAMEMETADATA.ASSEMBLY_CLR_NAME $qname_id = Q$qname_id = Q 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ASSEMBLY_TOKENMETADATA.ASSEMBLY_TOKEN assembly_id = A, $token_idassembly_id = A, $token_id 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ASSYMMETRIC_KEYMETADATA.ASSYMMETRIC_KEY asymmetric_key_id = Aasymmetric_key_id = A 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.AUDITMETADATA.AUDIT audit_id = Aaudit_id = A 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.AUDIT_ACTIONSMETADATA.AUDIT_ACTIONS device_id = D, major_id = Mdevice_id = D, major_id = M 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.AUDIT_SPECIFICATIONMETADATA.AUDIT_SPECIFICATION audit_specification_id = Aaudit_specification_id = A 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.AVAILABILITY_GROUPMETADATA.AVAILABILITY_GROUP availability_group_id = Aavailability_group_id = A 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CERTIFICATEMETADATA.CERTIFICATE certificate_id = Ccertificate_id = C 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CHILD_INSTANCEMETADATA.CHILD_INSTANCE $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.COMPRESSED_FRAGMENTMETADATA.COMPRESSED_FRAGMENT object_id = O , compressed_fragment_id = Cobject_id = O , compressed_fragment_id = C 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.COMPRESSED_ROWMETADATA.COMPRESSED_ROW object_id = Oobject_id = O 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CONVERSTATION_ENDPOINT_RECVMETADATA.CONVERSTATION_ENDPOINT_RECV $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CONVERSTATION_ENDPOINT_SENDMETADATA.CONVERSTATION_ENDPOINT_SEND $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CONVERSATION_GROUPMETADATA.CONVERSATION_GROUP $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CONVERSATION_PRIORITYMETADATA.CONVERSATION_PRIORITY conversation_priority_id = Cconversation_priority_id = C 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CREDENTIALMETADATA.CREDENTIAL credential_id = Ccredential_id = C 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.CRYPTOGRAPHIC_PROVIDERMETADATA.CRYPTOGRAPHIC_PROVIDER provider_id = Pprovider_id = P 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DATA_SPACEMETADATA.DATA_SPACE data_space_id = Ddata_space_id = D 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DATABASEMETADATA.DATABASE database_id = Ddatabase_id = D 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DATABASE_PRINCIPALMETADATA.DATABASE_PRINCIPAL principal_id = Pprincipal_id = P 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DB_MIRRORING_SESSIONMETADATA.DB_MIRRORING_SESSION database_id = Ddatabase_id = D 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DB_MIRRORING_WITNESSMETADATA.DB_MIRRORING_WITNESS $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.DB_PRINCIPAL_SIDMETADATA.DB_PRINCIPAL_SID $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ENDPOINTMETADATA.ENDPOINT endpoint_id = Eendpoint_id = E 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ENDPOINT_WEBMETHODMETADATA.ENDPOINT_WEBMETHOD $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.FULLTEXT_CATALOGMETADATA.FULLTEXT_CATALOG fulltext_catalog_id = Ffulltext_catalog_id = F 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.FULLTEXT_INDEXMETADATA.FULLTEXT_INDEX object_id = Oobject_id = O 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.EXPR_COLUMNMETADATA.EXPR_COLUMN object_id = O, column_id = Cobject_id = O, column_id = C 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.EXPR_HASHMETADATA.EXPR_HASH object_id = O, $hash = Hobject_id = O, $hash = H 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.FULLTEXT_CATALOGMETADATA.FULLTEXT_CATALOG fulltext_catalog_id = Ffulltext_catalog_id = F 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.FULLTEXT_INDEXMETADATA.FULLTEXT_INDEX object_id = Oobject_id = O 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.FULLTEXT_STOPLISTMETADATA.FULLTEXT_STOPLIST fulltext_stoplist_id = Ffulltext_stoplist_id = F 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.INDEX_EXTENSION_SCHEMEMETADATA.INDEX_EXTENSION_SCHEME index_extension_id = Iindex_extension_id = I 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.INDEXSTATSMETADATA.INDEXSTATS object_id = O, index_id or stats_id = Iobject_id = O, index_id or stats_id = I 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.INSTANTIATED_TYPE_HASHMETADATA.INSTANTIATED_TYPE_HASH user_type_id = U, hash = Huser_type_id = U, hash = H 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.MESSAGEMETADATA.MESSAGE message_id = Mmessage_id = M 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.METADATA_CACHEMETADATA.METADATA_CACHE $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PARTITION_FUNCTIONMETADATA.PARTITION_FUNCTION function_id = Ffunction_id = F 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PASSWORD_POLICYMETADATA.PASSWORD_POLICY principal_id = Pprincipal_id = P 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PERMISSIONSMETADATA.PERMISSIONS class = Cclass = C 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.PLAN_GUIDEMETADATA.PLAN_GUIDE plan_guide_id = Pplan_guide_id = P 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.METADATA. PLAN_GUIDE_HASHPLAN_GUIDE_HASH $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.METADATA. PLAN_GUIDE_SCOPEPLAN_GUIDE_SCOPE scope_id = Sscope_id = S 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.QNAMEMETADATA.QNAME $qname_id = Q$qname_id = Q 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.QNAME_HASHMETADATA.QNAME_HASH $qname_scope_id = Q, $qname_hash = H$qname_scope_id = Q, $qname_hash = H 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.REMOTE_SERVICE_BINDINGMETADATA.REMOTE_SERVICE_BINDING remote_service_binding_id = Rremote_service_binding_id = R 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.ROUTEMETADATA.ROUTE route_id = Rroute_id = R 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SCHEMAMETADATA.SCHEMA schema_id = Sschema_id = S 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SECURITY_CACHEMETADATA.SECURITY_CACHE $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SECURITY_DESCRIPTORMETADATA.SECURITY_DESCRIPTOR sd_id = Ssd_id = S 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SEQUENCEMETADATA.SEQUENCE $seq_type = S, object_id = O$seq_type = S, object_id = O 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVERMETADATA.SERVER server_id = Sserver_id = S 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVER_EVENT_SESSIONSMETADATA.SERVER_EVENT_SESSIONS event_session_id = Eevent_session_id = E 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVER_PRINCIPALMETADATA.SERVER_PRINCIPAL principal_id = Pprincipal_id = P 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVICEMETADATA.SERVICE service_id = Sservice_id = S 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVICE_BROKER_GUIDMETADATA.SERVICE_BROKER_GUID $hash = H1:H2:H3$hash = H1:H2:H3 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVICE_CONTRACTMETADATA.SERVICE_CONTRACT service_contract_id = Sservice_contract_id = S 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SERVICE_MESSAGE_TYPEMETADATA.SERVICE_MESSAGE_TYPE message_type_id = Mmessage_type_id = M 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.STATSMETADATA.STATS object_id = O, stats_id = Sobject_id = O, stats_id = S 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.SYMMETRIC_KEYMETADATA.SYMMETRIC_KEY symmetric_key_id = Ssymmetric_key_id = S 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.USER_TYPEMETADATA.USER_TYPE user_type_id = Uuser_type_id = U 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.XML_COLLECTIONMETADATA.XML_COLLECTION xml_collection_id = Xxml_collection_id = X 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.XML_COMPONENTMETADATA.XML_COMPONENT xml_component_id = Xxml_component_id = X 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.
METADATA.XML_INDEX_QNAMEMETADATA.XML_INDEX_QNAME object_id = O, $qname_id = Qobject_id = O, $qname_id = Q 标识为仅供参考。Identified for informational purposes only. 不提供支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed.

以下 XEvents 与分区切换和联机索引重新生成相关。The following XEvents are related to partition SWITCH and online index rebuild. 有关语法的信息,请参阅alter (TABLE transact-sql) alter INDEX (transact-sql)For information about syntax, see ALTER TABLE (Transact-SQL) and ALTER INDEX (Transact-SQL).

  • lock_request_priority_statelock_request_priority_state

  • process_killed_by_abort_blockersprocess_killed_by_abort_blockers

  • ddl_with_wait_at_low_priorityddl_with_wait_at_low_priority

现有 XEvent progress_report_online_index_operation for online 索引操作通过添加partition_numberpartition_id进行扩展。The existing XEvent progress_report_online_index_operation for online index operations was extended by adding partition_number and partition_id.

示例Examples

A.A. 将 sys.dm_tran_locks 与其他工具一起使用Using sys.dm_tran_locks with other tools

以下示例处理更新操作被另一个事务阻塞的情况。The following example works with a scenario in which an update operation is blocked by another transaction. 通过使用 _tran_locks和其他工具,将提供有关锁定资源的信息。By using sys.dm_tran_locks and other tools, information about locking resources is provided.

USE tempdb;  
GO  
  
-- Create test table and index.  
CREATE TABLE t_lock  
    (  
    c1 int, c2 int  
    );  
GO  
  
CREATE INDEX t_lock_ci on t_lock(c1);  
GO  
  
-- Insert values into test table  
INSERT INTO t_lock VALUES (1, 1);  
INSERT INTO t_lock VALUES (2,2);  
INSERT INTO t_lock VALUES (3,3);  
INSERT INTO t_lock VALUES (4,4);  
INSERT INTO t_lock VALUES (5,5);  
INSERT INTO t_lock VALUES (6,6);  
GO  
  
-- Session 1  
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;  
  
BEGIN TRAN  
    SELECT c1  
        FROM t_lock  
        WITH(holdlock, rowlock);  
  
-- Session 2  
BEGIN TRAN  
    UPDATE t_lock SET c1 = 10  

下面的查询将显示锁信息。The following query will display lock information. 应将 <dbid> 的值替换为database_id 中的值。The value for <dbid> should be replaced with the database_id from sys.databases.

SELECT resource_type, resource_associated_entity_id,  
    request_status, request_mode,request_session_id,  
    resource_description   
    FROM sys.dm_tran_locks  
    WHERE resource_database_id = <dbid>  

下面的查询使用前一个查询中的 resource_associated_entity_id 返回对象信息。The following query returns object information by using resource_associated_entity_id from the previous query. 必须在连接到包含此对象的数据库时执行此查询。This query must be executed while you are connected to the database that contains the object.

SELECT object_name(object_id), *  
    FROM sys.partitions  
    WHERE hobt_id=<resource_associated_entity_id>  

下面的查询将显示阻塞信息。The following query will show blocking information.

SELECT   
        t1.resource_type,  
        t1.resource_database_id,  
        t1.resource_associated_entity_id,  
        t1.request_mode,  
        t1.request_session_id,  
        t2.blocking_session_id  
    FROM sys.dm_tran_locks as t1  
    INNER JOIN sys.dm_os_waiting_tasks as t2  
        ON t1.lock_owner_address = t2.resource_address;  

通过回滚事务来释放资源。Release the resources by rolling back the transactions.

-- Session 1  
ROLLBACK;  
GO  
  
-- Session 2  
ROLLBACK;  
GO  

B.B. 将会话信息链接到操作系统线程Linking session information to operating system threads

下面的示例返回将会话 ID 与 Windows 线程 ID 相关联的信息。The following example returns information that associates a session ID with a Windows thread ID. 可以在 Windows 性能监视器中监视线程的性能。The performance of the thread can be monitored in the Windows Performance Monitor. 该查询不返回当前正在休眠的会话 ID。This query does not return session IDs that are currently sleeping.

SELECT STasks.session_id, SThreads.os_thread_id  
    FROM sys.dm_os_tasks AS STasks  
    INNER JOIN sys.dm_os_threads AS SThreads  
        ON STasks.worker_address = SThreads.worker_address  
    WHERE STasks.session_id IS NOT NULL  
    ORDER BY STasks.session_id;  
GO  

请参阅See Also

sys.databases _tran_database_transactions (transact-sql) sys.dm_tran_database_transactions (Transact-SQL)
动态管理视图和函数 (Transact-SQL) Dynamic Management Views and Functions (Transact-SQL)
与事务相关的动态管理视图(和函数 transact-sql) Transaction Related Dynamic Management Views and Functions (Transact-SQL)
SQL Server - Locks 对象SQL Server, Locks Object