{"id":3193,"date":"2015-12-01T09:32:36","date_gmt":"2015-12-01T14:32:36","guid":{"rendered":"https:\/\/academy.sqlbak.com\/?p=3193"},"modified":"2023-10-17T05:25:51","modified_gmt":"2023-10-17T09:25:51","slug":"full-recovery-model","status":"publish","type":"post","link":"https:\/\/academy.sqlbak.com\/full-recovery-model\/","title":{"rendered":"Full Recovery Model"},"content":{"rendered":"
In the full recovery model SQL Server does not truncate committed transactions until they have been backed up. It allows the creation of full, differential, and transaction log backups thus making point-in-time recovery possible.<\/p>\n
You need to keep in mind that in the full recovery model, the transaction log file would be much larger, and you have to make regular log backups to keep it small.<\/p>\n
Here are some tips on when the full recovery model is better to use:<\/p>\n
Let’s consider the following scenario:<\/p>\n
In the scenario above the failure occurs at 19:00, meaning that the changes made within the period from\u00a018:59 to 21:00 will be lost. The best way out in these circumstances is to restore the full backup (10:00) then the differential backup (16:00) plus transaction log backups (18:00 and 20:00). The transaction log\u00a0backup that was made at 20:00 allows to roll back to as far as 18:59.<\/p>\n
Here is the sequence of commands for restoring this database to 18:59:59:<\/p>\n
RESTORE DATABASE<\/span> your_database<\/em> FROM DISK<\/span> = 'full_10_00.bak'<\/span> WITH NORECOVERY<\/span>, REPLACE<\/span>\r\nRESTORE DATABASE<\/span> your_database<\/em> FROM DISK<\/span> = 'diff_16_00.bak'<\/span> WITH NORECOVERY<\/span>\r\nRESTORE<\/span> LOG<\/span> your_database<\/em> FROM DISK<\/span> = 'log_18_00.bak'<\/span> WITH NORECOVERY<\/span>\r\nRESTORE<\/span> LOG<\/span> your_database <\/em>FROM DISK<\/span> = 'log_20_00.bak'<\/span> WITH STOPAT<\/span> = '2015-11-19 18:59:59.000'<\/span>, RECOVERY<\/span><\/pre>\nThis is how you can set the Full recovery model:<\/b><\/p>\nALTER DATABASE<\/span> your_database<\/em> SET RECOVERY FULL<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"In the full recovery model SQL Server does not truncate committed transactions until they have been backed up. It allows the creation of full, differential, and transaction log backups thus making point-in-time recovery possible. You need to keep in mind that in the full recovery model, the transaction log file would be much larger, and […]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[158],"tags":[],"yoast_head":"\n
Full Recovery Model - Sql Server Backup Academy<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n