Check log files - free space in SQL Server

DBCC SQL Perf :

 
   DBCC SQL Perf function is used for the following purposes,
 
        1. To list down the percentage of log file used.  
        2. Clear the OS waits information (sys.dm_os_wait_stats)
        3. Clear the Latch waits information ( sys.dm_os_latch_stats )

 
Considering the database VenkatDB is having 1 MB for the log file,
 
          DBCC SQLPERF(LOGSPACE)
 
      -- This command is used to list down the spaces available for the database + How much % of log file is used  + status of the log file(either its available and working or not) - 0 indicates, there is no potenition issue with the database.
 


Clearing OS wait/Latch statistics:
 
  Below is the command to clear all the statistics collected for OS wait and Latch wait.

     DBCC SQLPERF("sys.dm_os_wait_stats",CLEAR);
     DBCC SQLPERF("sys.dm_os_latch_stats ",CLEAR);

Cheers,
Ebook Download
View all
Learn
View all