Home » Posts tagged 'Dynamic Management View'

Tag Archives: Dynamic Management View

Restrict user to login from single Host

Restricting user to login from single host may be sometimes required from security point and other business requirements. We can achieve it through SERVER LEVEL LOGON TRIGGER. ALTER TRIGGER TR_CHECK_LOGIN_TEST_HOST ON ALL SERVER FOR LOGON AS BEGIN DECLARE @HOSTNAME VARCHAR(48) DECLARE @PROGNAME VARCHAR(100) SELECT @HOSTNAME = HOST_NAME FROM SYS.DM_EXEC_SESSIONS WHERE SESSION_ID = @@SPID IF ORIGINAL_LOGIN() … Continue reading

DMV-15 : Pending I/O requests……..sys.dm_io_pending_io_requests

sys.dm_io_pending_io_requests DMV (Dynamic Management View), described by BOL as follows: http://msdn.microsoft.com/en-us/library/ms188762.aspx Returns a row for each pending I/O request in SQL Server. It’s a very simple DMV used to see all pending I/O requests & there description. You can combine this DMV with DMF – sys.dm_io_virtual_file_stats to see I/O pending requests with database files. You … Continue reading

DMV-14 : Which Table has Max. rows & Size……..sys.dm_db_partition_stats

sys.dm_db_partition_stats DMV (Dynamic Management View), described by BOL as follows: http://msdn.microsoft.com/en-us/library/ms187737.aspx Returns page and row-count information for every partition in the current database. This DMV gives useful information about rowcount, free & reserved space of each table in database. It can be used for analysis purpose while adding new indexes, doing index Maintenance or checking … Continue reading

DMV-13 : Finding locking & blocking……..sys.dm_tran_locks

sys.dm_tran_locks DMV (Dynamic Management View), described by BOL as follows: http://msdn.microsoft.com/en-us/library/ms190345.aspx Returns information about currently active lock manager resources. 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: … Continue reading

DMV-12 : Retaion in Session & Transaction……..sys.dm_tran_session_transactions

sys.dm_tran_session_transactions DMV (Dynamic Management View), described by BOL as follows: http://msdn.microsoft.com/en-us/library/ms188739.aspx Returns correlation information for associated transactions and sessions. This DMV helps in correlating the relation between session & transaction. We can get several details about transaction by correcting it will other DMVs & system catalogs. Query 1 : Query to check Transaction & Session … Continue reading

%d bloggers like this: