Sunteți pe pagina 1din 2

1.

Full --> full at 10 am


2. Differential
3. Log --> after every 5 mins

Special case of log backup:


---------------------------
Tail log backup:

Restore fullbackup with norecovery


Restore log backup with norecovery
backup log [mydb] to disk ='D:\tempbkp\log01.trv' with notruncate ( tail log
backup)
resore log backup with recovery

Restore backup incase of cash

Tail Log Backup in SQL Server


=============================
--Tail log backup is a last transaction log backup prior to recover the database.
--Recovery purpose....
--not force checkpoint and not turncate the log file
Scenario
--Every Sunday Full backup 12am..
--Daily Differentail backups ....12am
--Every 1hr T.log backups...

Database was crashed on Friday 10:30pm................

Recovery Steps:
===============
--Errorlog .......... Data file was damaged ... 10:30pm....
--Error No. 17204 (.mdf) .... 17207 (.ndf) ....
--Confirm
--Tail Log........
--To take backup of 30m transactions...10--10:30pm..
--Plan for restoration...
--Check the backup plan
--Start Restoration
--Restore last Sunday ...full backup WITH NORECOVERY
--Restore Thurday...12am differential backup ( latest) WITH NORECOVERY
--Apply all log backups...1am,2am.... 10pm WITH NORECOVERY
--Apply tail log backup WITH RECOVERY
backup log <dbname> to disk='......TRN' WITH NO_TRUNCATE
( it will not checkpiont and truncate backup)
For recovery purpose tail log backup required, If log file courrput then have to
resore the last avaiable backup
Normal log backup force checkpoint

How to take tail log backup


===========================
--Tail Log backup when server is running ( instance is running but
database is down) Simple
--Tail Log backup when server is down... ( instance plus database down)
hack-attached-tail log backup ( other instance
required to take the tail log backup)
--Copy the .LDF file int differnet Server ( having the same
version and patch level)
--Go to another instance ... test instance ....
--Create new database with the name MyDB
--Take db offline
--Delete all the db files...
--Copy the .LDF file into that path
--Try to bring database online....ERROR 17204

sp_readerrorlog
sp_helpdb <dbname>

alter database mydb set offline (Waits for user to logoff)


alter database mydb set offline with rollback immediate (kill all the session
immediatly )

alter database mydb set online


select DATABASEPROPERTYEX('MyDB','status')
----Suspect (mode returne)
dbcc traceon(3605,3004,-1) -- enable full trace of backup process

backup log MyDB to disk ='e:\mssql\backup\mydb_tail.trn' with no_truncate ---


SafeCheckpoiny skipped show in log

manually kill the session with


kill <spid>

S-ar putea să vă placă și