Some TSQL queries used by SQL DBA in day to day activities

Table of Contents

Database log file full. How to find log file used and free space?

Low disk space. How to find free space on the disk?

To get the SQL Server version installed in your server?

How to get when your SQL Server was last restarted?

How to check User database size in SQL Server?

How to check free space and space used by database data files and log files in SQL Server?

How to get session details in SQL Server?


How to get a blocking query in SQL Server?

How to get the list of databases which are offline in SQL Server?

How to get database backup history details in SQL Server?


How to get all indexes of a table in SQL Server?

How to get the last index statistics updated date in SQL Server?

How to get statistics of all objects of an entire database in SQL Server?

How to get table/index fragmentation in SQL Server?

How to get indexes with column on which index is created in SQL Server?

How to get % completion of a currently running job in SQL Server?

How to get jobs and respective owner details in SQL Server?

To get job run history –run_duration column(HHMMSS format) in SQL Server?

How to know whether a job is running slow in SQL Server?

How to manage Tempdb issue in SQL Server?


How to get unused indexes in SQL Server?

How find DB wise open connection?

How check the active connection in SQL Server?

How to check connections for a particular DB in SQL Server?

How to get maximum user connection settings in SQL Server?

To know current actual connection settings in SQL Server?

To get table name having particular data type in SQL Server?

How to get DB Users and their role privileges in SQL Server?

How to Rename a database in SQL Server?

How to Rename logical data file/log file name in SQL Server?

How to get Query from currently running session in SQL Server?

How get SQL Text using session-id in SQL Server?

How to get expensive queries in the database in SQL Server?

How to get currently running query in SQL Server?

How to get long-running Query in SQL Server?

How to get SQL Text of recently executed queries in SQL Server?

How to Move Data files or log files to the different physical locations in SQL Server?

How to get from which backup database was restored in SQL Server?

How to know memory usage in SQL Server?

How to get some insight of Locking and blocking sessions in SQL Server?

How to reset of login in SQL Server?

How to get statistics collection date in SQL Server?

How to find dependent objects based on columns name in SQL Server?

How to Add data file or log file in SQL Server?

How to identify an object using some code SQL txt in SQL Server?

Searching database name by data files in SQL Server?

How to check DB features enabled in your SQL server instance?

How to take the database offline immediately in SQL Server?

Schema authorization change in SQL Server?

How to get DB isolation level in SQL Server?

How to Change the transaction level in SQL Server?

How to see the Isolation level enabled or not using T-SQL?

How to generate a script for killing multiple sessions in SQL Server?

How to check SQL Server restart time in SQL Server?

How to generate a script to take multiple databases offline in SQL Server?

Ref. himanshusqldbaposts.blogspot.com


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *