30.06.2013 Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

121<br />

Chapter 4: Transactions<br />

• resource_database_id – ID of the database on which the locked resource resides.<br />

This column can be used to join to the dbid column in sys.sysdatabases, as well<br />

as to several other system views and DMVs.<br />

• resource_associated_entity_id – depending upon the resource_type, this<br />

value is either:<br />

• the object_id of the target object, if resource_type = OBJECT<br />

• the object_id of the parent object (courtesy of sys.partitions), if the<br />

resource_type is a KEY, PAGE, or RID.<br />

• Returning the name of the object is possible via the OBJECT_ID() system function,<br />

by passing in both the object_id and the database_id (respectively).<br />

The remaining columns offer a means to determine the nature, status, and owner of the<br />

lock request, and to relate this locking information to that available from other DMVs,<br />

regarding the sessions or transactions <strong>with</strong> which the locks are associated.<br />

• request_mode – type of lock that is being held, or has been requested, such as Shared<br />

(S), Update (U), Exclusive (X), Intent Exclusive (IX), and so on. Discussed in more detail<br />

shortly.<br />

• request_status – status of the lock:<br />

• GRANT –indicates the lock has been taken<br />

• CONVERT – the request is in the process of being fulfilled<br />

• WAIT – the resource is not locked, but is trying to lock the resource.<br />

• request_owner_type – type of owner of the transaction:<br />

• TRANSACTION<br />

• CURSOR<br />

• SESSION

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!