Friday, May 27, 2011

Backup and Restore commands of SQL Server 2005/2008

ü  Backup commands:

Full Backup:

Backup database <dbanme>
To disk=N’path’
With init,stats=10

Differential Backups:

Backup database <dbanme>
To disk=N’path’
With differential, init, stats=10

Log Backup:

Backup LOG <dbname>
To disk =N’path’
With init, stats=10

Tail Log Backup:

Backup LOG <dbname>
To disk =N’path’
With NO_TRUNCATE, init, stats=10

 
ü  Restore commands:

Full/Differential backup restoring:

Restore database <dbname>
From disk=N’C:\dbname.bak’
With NORECOVERY

Log restores:

Restore log <dbname>
From disk=N’C:\.. .trn’
With norecovery

Tail Log Backup Restore:

Restore log <dbname>
From disk=N’C:\.. .trn’
With recovery,
STOPAT = ‘Feb 1, 1985 3:00:00 AM’

Links

No comments:

Post a Comment