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

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Detach All User Databases

By Chris McGowan,

We have recently migrated our core live SQL Server environment from SQL Server 2005 to SQL Server 2008 making use of virtualisation from VMWare and SAN storage from NetApp.  Probably the coolest feature from the SAN solution is the ability to create application consistant snapshots and present them to other servers.

 

Let me elabourate, one of our live SQL Servers we migrated has about 1TB of data files and 500GB of log files.  In our old environment to copy and restore backups of these databases even compressed ones lets say to a UAT environment, took somewhere between 6 to 8 hours.  Utilising the SAN technology that NetApp provides we can present this same 1.5TB of data in less than 10 minutes!

 

This is done in short by taking a snapshot of the source data and log volumes then mounting these as drives in VMWare, we then detach all the current databases and attach the ones on the newly presented drives followed by unmounting the original drives.

 

During the development and testing of this process when I wanted to start afresh with a server with an instance of SQL Server with no databases I put together this quick procedure to detach all the current databases prior to removing the volumes from the VM.

 

I will, when i find the time write an article with as much detail as possible and provide the SQL and Powershell scripts we use to carry out this process.  Until then if one person finds this script useful i will be happy.

 

Enjoy

 

Chris

Total article views: 883 | Views in the last 30 days: 2
 
Related Articles
FORUM

cluter server databases backup on local drive

cluter server databases backup on local drive

FORUM

Restore database from network drive

Restore database from network drive

FORUM

Backup using litespeed but database is present on another server

Backup using litespeed but database is present on another server

FORUM

Moving database files in cluster environment

Moving database files in cluster environment

BLOG

SQL Server – Maintaining different environments

A busy Database Server  and application development environment  can have – Sandbox, Dev, Test, QA, ...

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones