Show Menu
Cheatography

SQL Server - backup manager Cheat Sheet (DRAFT) by

SQL Server - backup manager

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Creacion back up Completo

ALTER DATABASE [nombre_base] SET RECOVERY FULL
BACKUP DATABASE [nombre_base]
TO DISK = 'c:/direccion.bak' WITH FORMAT,
MEDIANAME = 'nombre_grupo_backups',
NAME = 'nombre_back_up';

Creacion back up Difere­ncial

RESTORE DATABASE  [nombre_base]
FROM DISK = 'C:\direccion.bak'
WITH DIFFERENTIAL;

Creacion back up LOG

BACKUP LOG [nombre_base] TO DISK = 'C:\direccion.bak';

Restau­racion de backup Completo

 
use master;

RESTORE DATABASE [nueva­_base]
FROM DISK = 'C:\di­rec­cio­n.bak'
WITH RECOVERY;
 

Restau­racion de backup Completo

use master;

RESTORE DATABASE [nueva_base]
FROM DISK = 'C:/direccion_full.bak'
WITH RECOVERY;

Restau­racion de backup LOG


use master;

RESTORE DATABASE [nueva_base]
FROM DISK = 'C:/direccion_full.bak'
WITH NORECOVERY;

RESTORE LOG [nueva_base]
FROM DISK = 'C:/direccion_log1.bak'
WITH NORECOVERY;


RESTORE DATABASE [nueva_base] WITH RECOVERY;
 

Modelos de recupe­racion

ALTER DATABASE [nombr­e_base] SET RECOVERY SIMPLE;
ALTER DATABASE [nombr­e_base] SET RECOVERY FULL;
ALTER DATABASE [nombr­e_base] SET RECOVERY BULK_L­OGGED;