DBADiagnostics – My DBA Database

Posted by & filed under , , , , .

couple years ago I started consolidating all of my DBA scripts into a portable DBA database that I could use for diagnostics (hence the silly name) and for maintenance scripts. To help me to continue to be inspired to update the database and to get some feedback, I plan to post a number of the tables, procedures, and other database components over the next few weeks.

Hopefully others will get as much use out of these as I have. To make it easier to find these posts, you can search my blog for the tag DBADiagnostics and all of those future posts should pop right up.

For convenience sake, here’s is the script that I used to create the DBADiagnostics database:

USE [master]

GO

 

IF EXISTS(SELECT * FROM sys.databases WHERE name = 'DBADiagnostics')

    DROP DATABASE [DBADiagnostics]

GO

 

CREATE DATABASE [DBADiagnostics] ON PRIMARY (

    NAME = N'DBADiagnostics'

    ,FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\DBADiagnostics.mdf' 

    ,SIZE = 10240KB 

    ,MAXSIZE = UNLIMITED

    ,FILEGROWTH = 10240KB 

)

,FILEGROUP [Data] DEFAULT (

    NAME = N'DBADiagnostics_data'

    ,FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\DBADiagnostics_data.ndf' 

    ,SIZE = 10240KB 

    ,MAXSIZE = UNLIMITED

    ,FILEGROWTH = 10240KB 

)

LOG ON (

    NAME = N'DBADiagnostics_log'

    ,FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\DBADiagnostics_log.ldf' 

    ,SIZE = 10240KB 

    ,MAXSIZE = 2048GB 

    ,FILEGROWTH = 10240KB 

)

GO

Of course, depending on your directory structure above you may need to change those values.