Personal Notes of Edwin Eu

SQL Server – Restore a database

In Microsoft SQL Server on 06/12/2012 at 8:55 AM

Recently I was assigned to move the Dynamics SQL Server production database into a development environment.  In addition, I setup , install, and configure the Microsoft DYNAMICS.

  • Installed, Setup, Configure Window Server 2008 R2
  • Jointed the Window Server 2008 R2 to Domain Controller
  • Installed, Setup, and Configured Microsoft Dynamics 2009
  • Installed, Setup, and Configured Microsoft SQL Server 2008 R2
  • Copy the DYNAMICS production backup
  • Then, restored the database:

 — 03/22/2012 RESTORE AX2009-LIVE and CONVERT INTO AX2009-DEV
 — RESTORING DYNAMIC AX2009-LIVE DATABASE DATED 3/21/2012 12:00 AM
 RESTORE DATABASE [AX2009-DEV]
 FROM DISK = ‘C:\Temp4All\AX2009-Live Backup\AX2009-Live_backup_2012_03_21_010001_8246391.bak’
 WITH MOVE ‘AX2009-Dev’ TO ‘F:\SQL_Data\AX2009-Dev.mdf’,
 MOVE ‘AX2009-Dev_Log’ TO ‘G:\SQL_Log\AX2009-Dev.ldf’,
RECOVERY
GO
—- RESTORING DYNAMIC AX2009-LIVE LOG DATED 3/21/2012 4:00 AM
RESTORE DATABASE [AX2009-DEV]
 FROM DISK = ‘C:\Temp4All\AX2009-Live Backup\AX2009-Live_backup_2012_03_21_050001_5114638.trn’
 WITH MOVE ‘AX2009-Dev’ TO ‘F:\SQL_Data\AX2009-Dev.mdf’,
 MOVE ‘AX2009-Dev_Log’ TO ‘G:\SQL_Log\AX2009-Dev.ldf’,
NORECOVERY
GO

—- RESTORING DYNAMIC AX2009-LIVE LOG DATED 3/21/2012 5:00 AM
RESTORE DATABASE [AX2009-DEV]
 FROM DISK = ‘C:\Temp4All\AX2009-Live Backup\AX2009-Live_backup_2012_03_21_060001_7013047.trn’
 WITH MOVE ‘AX2009-Dev’ TO ‘F:\SQL_Data\AX2009-Dev.mdf’,
 MOVE ‘AX2009-Dev_Log’ TO ‘G:\SQL_Log\AX2009-Dev.ldf’,
NORECOVERY
GO

—- RESTORING DYNAMIC AX2009-LIVE LOG DATED 3/21/2012 6:00 AM
RESTORE DATABASE [AX2009-DEV]
 FROM DISK = ‘C:\Temp4All\AX2009-Live Backup\AX2009-Live_backup_2012_03_21_070001_5084996.trn’
 WITH MOVE ‘AX2009-Dev’ TO ‘F:\SQL_Data\AX2009-Dev.mdf’,
 MOVE ‘AX2009-Dev_Log’ TO ‘G:\SQL_Log\AX2009-Dev.ldf’,
NORECOVERY
GO

—- RESTORING DYNAMIC AX2009-LIVE LOG DATED 3/21/2012 7:00 AM
RESTORE DATABASE [AX2009-DEV]
 FROM DISK = ‘C:\Temp4All\AX2009-Live Backup\AX2009-Live_backup_2012_03_21_080001_9615089.trn’
 WITH MOVE ‘AX2009-Dev’ TO ‘F:\SQL_Data\AX2009-Dev.mdf’,
 MOVE ‘AX2009-Dev_Log’ TO ‘G:\SQL_Log\AX2009-Dev.ldf’,
RECOVERY
GO

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: