Introduction
This question is explicitly asking for answers based on experience to allow me to make a decision based on the experience of fellow database administrators in similar situations. This question has been revised to remove irrelevant information.
I am asking the following questions, because I believe there can be reasons which support using a SIMPLE recovery model in a SQL Server test environment and reasons that support using the FULL recovery model for databases, even in a pure test environment.
Questions
- Would you recommend using the SIMPLE Recovery Model in a pure test environment?
- Without pseudo-backup?
- With pseudo-backup 1)?
- What reasons support using the FULL Recovery Model in a test environment?
- With pseudo-backup 1)?
1): Pseudo-backup: Backup to NUL or backup to disk with a retention time of max 24 hours. Advantage: Transaction Log is CHECKPOINT-ed
Similar Questions
A number of questions I have already read which popped up in the between-bar/sidebar while I was typing this question:
- Reasons to Backup (or not backup) QA and Dev Databases
- Switch from full to simple recovery
- Full backup of Simple recovery model - how much log is backed up if there is an open transaction
- Why does my database using the simple recovery model have such a large transaction log?
- Transaction Log is big! But simple recovery mode is chosen!
- Why is my transaction file growing when db is in simple mode and there are no waiting transactions
The answers provided in those questions do not provide any answers to my actual question of implementing either a FULL or SIMPLE Recovery Model in a test environment.
The Environment
The environment consists of the following types of serves, databases and backup procedures.
Server Types
- Productive servers
- includes some Dev/Quality servers
- Test servers
Database Types
- Test databases
- Quality / Developemnt databases
- Production databases
Database options
All user databases are currently in the FULL recovery model.
Combinations of Servers and Databases
- The productive and development/quality databases are running on productive servers.
- The test databases are running on test servers.
Backup Procedure
Backups of productive databases are performed on a regular basis.
- Weekly Full (SA 20:00)
- Daily Differential (SO-FR 20:00)
- Hourly Transaction Log (xx:30)
Backups of test databases were performed on the same basis, but have recently been removed from the standard backup procedure for monetary reasons.
Optimising Test Environment
Modifications to data in the test environment will tend to be minor and will normally not have an impact on the size/growth of the transaction log file. Test databases are normally used for quick tests while implementing new versions of a given software. No need for them to be backed up really, as they can/are restored from productive backups of the the productive databases should the need arise.
Reasons for optimising the test environment are to keep the Transaction Log files at bay.
Simple Recovery Model
In order to keep the transaction log files small and because we are no longer performing backups, I at first decided to switch all user databases in the test environment to the SIMPLE Recovery Model.
Pros
- Committed data is automatically written to the database
- No transaction log backups required
- No disk space required on server
Cons
- Long running transactions will still have an impact on the size/growth of the transaction log file. (This is an issue for the FULL recovery model too)
Reference: Recovery Models (SQL Server) (Microsoft | SQL Docs)
Reference: Complete Database Restores (Simple Recovery Model) (Microsoft | SQL Docs)
Full Recovery Model with Pseudo Backup1)
In the process of implementing the SIMPLE Recovery Model in our test environment I thought about implementing a pseudo-backup1) procedure similar to the production environment. The idea would be to keep the user databases in the FULL Recovery Model and perform backups (preferably using Ola Hallengren's backup script) similar to the productive environment, which would retain the backup files for a maximum of 24 to 48 hours on some disk.
Pros
- Restore to Point-in-Time possible
Cons
- Disk space required for Transaction Log (possibly) and backup files (evidently)
- Long running transactions will still have an impact on the size/growth of the transaction log file.
- Transaction Log backup required.
Reference: The Transaction Log (SQL Server) (Microsoft | SQL Docs)
Questions
- Would you recommend using the SIMPLE Recovery Model in a pure test environment?
- Without pseudo-backup?
- With pseudo-backup?
- What reasons support using the FULL Recovery Model in a test environment?
- With pseudo-backup?
CREATE TABLE
, etc scripts.