Being production DBA and responsible for a dozen to 100+ SQL Servers running in your organization or datacenter, Sometimes, you must be wondering that how you can make sure you are fully aware what is going when you are not at work. There is an easy way to stay in touch with your SQL Server(s), [...]
Archive for the ‘Scripts’ Category
Get Notification as soon as SQL Services are restarted
Posted: 17th September 2010 by Deepak in Scripts, SQL DBA, SQL DevTags: alarm, DBA, email, notification, restart, sql, sql notification, sql restarted, sql service restart, sqldba
Script to find used and free space in Database files
Posted: 2nd August 2010 by Deepak in Scripts, SQL BI/DW/SSRS, SQL DBA, SQL Dev, UncategorizedTags: database, db size, dbcc, dbcc showfilestats, dbcc sqlperf, disk, logspace, shrink, shrinkfile, space, sql server
In an Enterprise world, you may be responsible to monitor 1000+ databases hosted on hundreds of SQL Server instances. On a lazy afternoon, suddenly low disk space alarm hit your inbox. What will you do, storage can not be added or expended on the fly. Here is the tested script to find used and free [...]
Audit databases – Using DDL triggers
Posted: 5th June 2010 by Deepak in Scripts, SQL DBA, UncategorizedTags: change log, DDL Triggers, DDL_DATABASE_LEVEL_EVENTS, event, event_instance, msdb, sql audit
As a DBA, do you ever wonder what is going inside your production database? Who is changing database schema during production time without informing you. Now, you need not to worry, you can setup DDL triggers to easily records all changes in table; like what was changed, when and by whom etc. Given is two [...]
How long does a SP stay in the cache?
Posted: 14th April 2010 by Deepak in Scripts, SQL BI/DW/SSRS, SQL DBA, SQL Dev, UncategorizedTags: administrator, buffer, cache, checkpoint, DBA, freeproccache, lazywriter, memory, memorystatus, sp, sqlperf, stored procedure
As a SQL Database Administrator, developer, designer you must be eager to know how long does a stored procedure execution plan stay in the cache? On what basis and parameters Microsoft SQL Server decide age of an execution plan to reside in cache? The quick answer is, it is based on the cost factor [...]
List of Undocumented DBCC command..
Posted: 10th March 2010 by Deepak in Scripts, SQL DBA, SQL Dev, UncategorizedTags: buffer, cachestats, checkalloc, checkdb, DBA, dbcc, dbcc page, shrinkfile, sql, sqldba, sqlperf, update, useplan
List of Undocumented DBCC command.. DBCC activecursors [(spid)] DBCC addextendedproc (function_name, dll_name) DBCC addinstance (objectname, instancename) DBCC adduserobject (name) DBCC auditevent (eventclass, eventsubclass, success, loginname, rolename, dbusername, loginid) DBCC autopilot (typeid, dbid, tabid, indid, pages [,flag]) DBCC balancefactor (variance_percent) DBCC bufcount [(number_of_buffers)] DBCC buffer ( {‘dbname’ | dbid} [, objid [, number [, printopt={0|1|2} ][, [...]