Category Archives: DBA

Category containing DBA Scripts

SQL Script to find the database & their files details on a SQL Server

By | March 30, 2018

SQL Script to find database details Sometimes we need a SQL Script which can give the below information about the databases created on a SQL Server for house keeping purpose: -1) Database Name 2) Database ID 3) Database Files name with their physical location 4) Database Creation Time 5) Users access type for Database 6)… Read More »

SQL Script: – How to find the database restoring history of SQL Server databases

By | March 30, 2018

SQL Script to find database restoring history Sometime we need to find out the history of database restoration to get the answers of following questions: -1) Do we need to restore the database again as there is a possibility that it is restored recently? 2) Which backup file (with location information) is used for database restoration?… Read More »

SQL Script: – How to find the last access date of a database

By | March 29, 2018

SQL Script to find database last access date Sometime we create databases on Test/ Development database servers for temporary uses for short duration and  forgot to delete them after the work got completed. As a part of house keeping activity, we need to find out when a database is last accessed in order to find… Read More »

Learn How to Recover Deleted Records from SQL Server 2014

By | August 8, 2017

Problem Sometimes users may have numerous of databases in their SQL Server. However, while managing their database sometimes by mistake their records are deleted due to which they face a lot of issues. To maintain the workflow they need to recover deleted records from SQL Server 2014. This could be possible only with successful SQL… Read More »

How to Resume Suspended Database Mirroring in SQL Server ?

By | September 3, 2016

Resuming Suspended Database Mirroring in SQL Overview Database mirroring is a feature in SQL Server which is creating and maintaining the redundant copies of the database. The purpose behind database mirroring is continuous data availability and minimizes the loss of the data. Redundancy ensures that there is always a one backup copy of the database… Read More »

Category: DBA

SQL Script to find the missing indexes

By | January 25, 2015

Script to find the missing indexes Performance tuning in SQL is important exercise and index creation is an important part of it. Below script will help in finding the missing indexes. Once you create these indexes, it will help in improving the Performance.SELECT db_name(d.database_id) dbname , object_name(d.object_id) tablename , d.equality_columns , d.inequality_columns , d.included_columns ,’CREATE INDEX [missing_index_’ +… Read More »