Monthly Archives: April 2014

Database Snapshot

Sample T-SQL Code for creating a database snapshot. use AdventureWorks2012 go sp_helpfile — used to get the logical database name needed for below CREATE DATABASE AWSnapshot ON ( NAME = ‘AdventureWorks2012_Data’, FILENAME=’’ ) AS SNAPSHOT OF AdventureWorks2012; –using it USE AWSnapshot; GO SELECT * FROM Sales.SalesOrderDetail WHERE ProductID = 53; –reverting from snapshot RESTORE DATABASE […]

Read More

Database Mirroring

Prefered long term solution for this suggested by Microsoft is using AlwaysOn High Availablilty. T-SQL Code for mirroring [note the port numbers have to be different. /****** Object: Endpoint [mirroring] on Server1 Script Date: 4/27/2014 3:32:37 AM ******/ CREATE ENDPOINT [mirroring] STATE=STARTED AS TCP (LISTENER_PORT = 7575, LISTENER_IP = ALL) FOR DATA_MIRRORING (ROLE = PARTNER, […]

Read More