Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

A Script A Day - Day 7 - Memory Queries

Today's script is a collection of a few memory queries I've collected from various sources over the years.  These queries are by no means comprehensive but are ones I have certainly used the most.


/*
      -----------------------------------------------------------------
      Memory Queries
      -----------------------------------------------------------------
     
      For more SQL resources, check out SQLServer365.blogspot.com

      -----------------------------------------------------------------

Read more

0 comments, 1,049 reads

Posted in SQL Server 365 on 7 February 2012

A Script A Day - Day 6 - Drop and Create Database Snapshots

Today's Script will drop all database snapshots and create a database snapshot for all online read writeable user databases. I create this script for use in a database mirroring partnership so that the snapshots could be used on the mirroring partner so to impact the mirroring principal less. As such…

Read more

0 comments, 1,169 reads

Posted in SQL Server 365 on 6 February 2012

A Script A Day - Day 5 - Database Owner Permissions

Today's script will list all principals with membership in the db_owner fixed database role.


/*
      -----------------------------------------------------------------
      Database Owner Permissions
      -----------------------------------------------------------------
     
      For more SQL resources, check out SQLServer365.blogspot.com

      -----------------------------------------------------------------

      You may alter this code for your own purposes.
      You may republish altered code as long…

Read more

0 comments, 551 reads

Posted in SQL Server 365 on 5 February 2012

A Script A Day - Day 4 - Estimated Time Left

Today's script allows you to keep track of how long left a statement has before it completes.  I find this useful for example when restoring databases.  All you need to do is simply change the der.command  = as required.



/*
      -----------------------------------------------------------------
      Estimated Time to Complete
      -----------------------------------------------------------------
     
     …

Read more

1 comments, 283 reads

Posted in SQL Server 365 on 4 February 2012

A Script A Day - Day 3 - Live Change Data Edit Template

Today's script is a template I use for the occasions when a data edit is required to be run against a live environment.  It has 8 steps to give you as DBA's control over what is being run and the safety of recording results before and after the modifications.  The…

Read more

0 comments, 309 reads

Posted in SQL Server 365 on 3 February 2012

A Script A Day - Day 2 - Database Mail Troubleshooting

Today's script is a collection of simple queries I have saved for a time when I need to troubleshoot database mail problems.



/*
      -------------------------------------
      Summary:                      Database Mail Troubleshooting
      SQL Server Versions:          2005 onwards
      Written by:                   Chris McGowan
      -------------------------------------
     
      For more SQL resources,…

Read more

2 comments, 230 reads

Posted in SQL Server 365 on 2 February 2012

A Script A Day - Day 1 - Database File To Volume Mapping

Today is the 1st February 2012 and as promised here is the first of script in my "A Script A Day" series.  There will be 29 scripts (yes this year is a leap year:) which I will also roll-up into a single document and make available to you some time in…

Read more

1 comments, 357 reads

Posted in SQL Server 365 on 1 February 2012

Database 101

I had an interesting phone call this morning from our professional services team.  They are carrying out what I can only call extreme testing on one of our products to see just how much data we can process in a given time window.  The issue they ran into was a…

Read more

0 comments, 381 reads

Posted in SQL Server 365 on 26 January 2012

Venting Frustration

We as DBA’s face an ever growing list of things to do and services to support.  We work in high pressure environments where time is of the essence and there is little to no room for error.  The very nature of our roles mean we have to work unsociable hours…

Read more

0 comments, 325 reads

Posted in SQL Server 365 on 25 January 2012

A Script a Day

In February I will be starting a series of Blog Posts I'm calling a "A Script a Day".  Each day throughout February I will post a script which I have used in my various DBA roles and a description of what it is and how / where I have used…

Read more

0 comments, 398 reads

Posted in SQL Server 365 on 24 January 2012

Determining Active Directory Group Membership

As discussed in my previous post I prefer to use Windows authentication over SQL authentication on my SQL Servers.  There are however two things that I would recommend controlling which is Active Directory Group membership and correct Active Directory design.

Let’s say you have a tiered Active directory group structure…

Read more

2 comments, 817 reads

Posted in SQL Server 365 on 24 January 2012

Security - SQL vs Windows

Security is a very important part of every DBA’s role.   If you are not clued up on security best practices or don’t secure your SQL Servers, you should be concerned as it could end up costing you your job!

I have worked in organisations where the painstaking task of managing…

Read more

1 comments, 448 reads

Posted in SQL Server 365 on 23 January 2012

Database uplevel Restores Follow On

Today's post is a follow on from one earlier this month Database uplevel Restores.  I got round to testing restoring a SQL Server 2000 backup to a SQL Server 2008 R2 server and it worked!  Details Below;

-- Restore command
RESTORE DATABASE [SQL2000Test] FROM DISK = 'D:\SQL2000TestBackup.bak'

Read more

0 comments, 663 reads

Posted in SQL Server 365 on 20 January 2012

Don’t Be a Balloon!

I had a problem just before the festive period where one of our production SQL Servers was randomly grinding to a halt, queries which usually returned in milliseconds where running for minutes.  It took 4 days of performance monitoring / troubleshooting and some help from the SQL Community (when I…

Read more

2 comments, 680 reads

Posted in SQL Server 365 on 18 January 2012

Moving Database Files and Replication

Today’s post is a quick one as I am a bit under the cosh.

There are many ways to move database files, detach and attach, backup and restore, alter database.  But what can you do if the files you want to move belong to a database being used in replication? …

Read more

2 comments, 419 reads

Posted in SQL Server 365 on 13 January 2012

System Stored Procedures

I've been using 4 alerts for corruption now for about 2 years for Errors 823, 824, 825 and 9100.  Basically I would create an operator via SSMS, the four alerts via T-SQL then manually add the operator to the response through SSMS.  Now given that I only did this during the…

Read more

2 comments, 571 reads

Posted in SQL Server 365 on 11 January 2012

Server Name and SQL Server Name

I have, in the past had the need to rename a server, either because the server has been named incorrectly or because it has been created as a clone from an image.  There is a documented process which I have used in the past to rename SQL Server once the…

Read more

0 comments, 390 reads

Posted in SQL Server 365 on 10 January 2012

Database uplevel Restores

Today I've been reading Paul Randal's collection of Blogs from a series called A SQL Server DBA myth a day. If you haven't yet read it I recommend it there are a couple of misconceptions in there that I have fallen foul of in the past.  You can…

Read more

4 comments, 294 reads

Posted in SQL Server 365 on 6 January 2012

SQL Server Error Logs

I read a blog post this morning on SQLServerCentral by Tim Radney about SQL Server Error Logs.  Tim talks about increasing the number of error logs in SQL Server.  One thing that came to mind to take this one step further and is just as simple to do is to…

Read more

10 comments, 589 reads

Posted in SQL Server 365 on 4 January 2012

Dropping a Database

I came across an issue on a server this morning where a drive had run out of free space.  Now given I still haven't got a full list of servers which I should be managing I'm not going to kick myself over this.


The issue came to light by the fact the previous DBA had set-up an email…

Read more

0 comments, 209 reads

Posted in SQL Server 365 on 3 January 2012

Newer posts

Older posts