"1" SQL Server Profiler is a SQL monitoring tool that can be specific to each line of SQL statements, each operation, and each connection
"2"
When doing data interaction, it is often difficult to visualize the SQL statements that were executed in the database at the end. At this point, we can only go in the database to monitor the database operation by executing some SQL statements. The following is a SQL monitoring script (for SQL Server 2005)
SELECT creation_time N ' statement compilation time '
, Last_execution_time N ' last Execution time '
, total_physical_reads N ' total number of physical reads '
, Total_logical_reads/execution_count N ' Each logical read count '
, Total_logical_reads N ' logical read total number of times '
, Total_logical_writes N ' logical write total number of times '
, Execution_count N ' execution times '
, total_worker_time/1000 N ' Total CPU time MS '
, total_elapsed_time/1000 N ' total time spent MS '
, (total_elapsed_time/execution_count)/1000 N ' Average Time MS '
, SUBSTRING (St.text, (QS.STATEMENT_START_OFFSET/2) + 1,
(Case Statement_end_offset
WHEN-1 then datalength (st.text)
ELSE Qs.statement_end_offset End
-Qs.statement_start_offset)/2) + 1) N ' execute statement '
From Sys.dm_exec_query_stats as Qs
Cross APPLY Sys.dm_exec_sql_text (qs.sql_handle) St
where SUBSTRING (St.text, (QS.STATEMENT_START_OFFSET/2) + 1,
(Case Statement_end_offset
WHEN-1 then datalength (st.text)
ELSE Qs.statement_end_offset End
-Qs.statement_start_offset)/2) + 1) Not like '%fetch% '
ORDER by Total_elapsed_time/execution_count DESC
Another article, "SQL Server 20,055 dynamic management Objects"
This article explains the object of database monitoring in detail.
"3" SELECT * From:: Fn_dblog (Default,default)
SQL Operations Logging View tool