Tuesday 6 October 2015

Backup Database

One of the most important processes for a DBA is backing up and restoring a database.  In its simplest form, a backup can be taken in the following way....


GUI


Right mouse click on the database name, choose tasks and Back up.
 


 












 
Check to confirm the backup location is correct and press OK to start the backup








TSQL

A database can be backed up using TSQL.

BACKUP DATABASE
[AdventureWorks2012]
TO  DISK =
N'C:\DatabaseBackups\[AdventureWorks2012]_FULL_20120209.BAK'
GO


Powershell


A database can be backed up using Powershell

Backup-SqlDatabase -ServerInstance localhost -Database AdventureWorks2012 -BackupFile C:\DatabaseBackups\[AdventureWorks2012]_FULL_20120209.BAK

No comments:

Post a Comment