Skip to main content

Recovery models

SQL Server offer 3 recovery models


  • Simple
  • Bulk-logged
  • Full
In the case of a simple recovery model, you are essentially agreeing that it is ok to lose all changes made to your database after the last full backup. The upside of this recovery model is of course that it takes very little administration. You don’t have to worry about anything like a log chain or tons of log backups, or even when the log will be truncated. Obviously this will never be good enough for mission critical databases, but it definitely has its place and its uses.
The purpose of the bulk logged recovery model is to allow you perform bulk operations without writing each transaction to the transaction log, and as such improve the performance of your bulk operation. The downside to this is of course that not each transaction is recorded in the log, and as such it does not allow you to do a point in time restore.
In order to be able to restore to a specific point in time, you need to have your database set to use the full recovery model. This means that every event which takes place in the database gets written to the log, which is why it then makes it possible for you to restore up to a specific point. But just having the database set to the full recovery model is not enough. Unless you have a complete log chain, you will still not be able to restore your database to the point in time you require.

Comments

Popular posts from this blog

Identify the duplicates in MySQL

To identify the duplicate entries in MySQL, use below query.                      SELECT COUNT(*) as repetitions, group_concat(id, ' (', startTime, ', ', endTime, ') ' SEPARATOR ' | ') as row_data FROM GROUP BY startTime, endTime HAVING repetitions > 1 FYI, id, startTime and endTime columns should be changed based on your table schema. you can change the output format here like alias and the separator.

Exclude or Include table(s) during creating backup from MySQL

 To exclude tables when you are creating database backup from MySQL, execute below query. mysqldump -u root -p<Password> DATABASENAME --ignore-table= DATABASENAME.TABLENAME  > BACKUPFILENAME.sql  To include  tables when you are creating database backup from MySQL, execute below query. mysqldump -u root -p<Password> DATABASENAME TABLENAME1 TABLENAME2  > BACKUPFILENAME.sql Take note that there is no whitespace between -p and the password..