SQL Server Error 1465: Database Not in Full Recovery
In this article
SQL Server error 1465 means you tried to perform an operation that requires the database to be in the full recovery model—such as taking a transaction log backup, enabling Change Data Capture, or configuring log shipping—but the database is currently in the simple or bulk-logged recovery model. The fix is to switch the database to the full recovery model, then take a full backup to establish the log chain. You need ALTER DATABASE permission (or sysadmin/db_owner) and enough disk space for the transaction log to grow until the first log backup is taken.
What You'll Need
- SQL Server Management Studio (SSMS) or Azure Data Studio, or command-line access via sqlcmd.
- An account with ALTER DATABASE permission on the target database (db_owner or sysadmin).
- Sufficient disk space for the transaction log—after switching to full recovery, the log will grow until you take a log backup, so monitor free space.
- A backup destination (disk or URL) for the full backup that starts the log chain.
Step-by-Step
- Confirm the current recovery model. In SSMS, right-click the database, choose Properties, and select the Options page. The Recovery model drop-down shows the current setting. Alternatively, run:
SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'YourDatabase';
The result will show SIMPLE, BULK_LOGGED, or FULL. Error 1465 appears when the operation requires FULL but the database is SIMPLE or BULK_LOGGED. - Check for any dependencies or restrictions. If the database is part of an availability group, changing the recovery model may be blocked or require the database to be removed from the group first. Also confirm you are not in the middle of a restore or a long-running transaction that could hold locks.
- Switch to the full recovery model. In SSMS Object Explorer, right-click the database, select Properties > Options, change Recovery model to Full, and click OK. Or run:
ALTER DATABASE YourDatabase SET RECOVERY FULL;
This change takes effect immediately. Note that switching to full recovery does not automatically create a log backup—you must take a full backup next. - Take a full database backup. This is the critical step: the full backup establishes the starting point for the log chain. Without it, transaction log backups will fail or be unusable. In SSMS, right-click the database, choose Tasks > Back Up, select Full as the backup type, choose a destination, and click OK. Or use T-SQL:
BACKUP DATABASE YourDatabase TO DISK = 'C:\Backups\YourDatabase_Full.bak' WITH INIT; - Take a transaction log backup (optional but recommended). To verify the log chain is working, immediately take a log backup:
BACKUP LOG YourDatabase TO DISK = 'C:\Backups\YourDatabase_Log.trn' WITH INIT;
If this succeeds, the database is correctly configured for full recovery and log backups. - Retry the original operation. Now re-run the command or wizard that produced error 1465—for example, enabling CDC, configuring log shipping, or taking a log backup. It should now succeed.
- Verify the recovery model and log chain. Re-run the query from step 1 to confirm recovery_model_desc is FULL. Check that the log file is not growing uncontrollably by reviewing free disk space and, if needed, scheduling regular log backups.
Common Mistakes
- Switching to full recovery without taking a full backup. The log chain is not valid until a full backup is taken after the switch. Log backups taken before the full backup cannot be used for point-in-time recovery.
- Assuming the change is instant for all operations. Some operations (like enabling CDC) require the database to be in full recovery at the time the operation starts; switching and then immediately retrying without a full backup may still fail if the operation checks for a valid log chain.
- Forgetting about the log file growth. In full recovery, the log grows until a log backup is taken. If you switch and forget to schedule log backups, the log can fill the disk and cause outages.
- Changing recovery model on a database in an availability group. This is often not allowed directly; you may need to remove the database from the group, change the model, take a full backup, and re-add it.
- Using the wrong database context. Running
ALTER DATABASEwithout specifying the correct database name, or running it in the wrong query window, can affect the wrong database.
Tips
- Always take a full backup immediately after switching to full recovery, even if you plan to take a log backup later.
- Schedule regular transaction log backups (for example, every 15–30 minutes) to keep the log file size manageable and to enable point-in-time recovery.
- Use
DBCC SQLPERF(LOGSPACE);to monitor log space usage after switching to full recovery. - If you are scripting the change, wrap it in a transaction and include error handling to avoid partial changes.
- Document the recovery model change and backup schedule for compliance and troubleshooting.
Troubleshooting
If error 1465 persists after switching to full recovery and taking a full backup, check the following:
- Verify the recovery model actually changed. Re-run the query from step 1. If it still shows SIMPLE, the ALTER DATABASE command may have failed silently—check for errors in the Messages tab.
- Ensure the full backup completed successfully. Check the backup history tables (
msdb.dbo.backupset) or the SSMS backup history to confirm a full backup exists after the recovery model change. - Check for open transactions or locks. Long-running transactions can prevent the recovery model change from taking effect. Use
sp_who2orsys.dm_exec_requeststo identify blocking sessions. - For availability groups: If the database is in an availability group, you may need to remove it from the group, change the recovery model, take a full backup, and then re-add it. Consult the Always On documentation for the correct procedure.
- Permissions: Ensure your account has ALTER DATABASE permission and that you are not hitting a policy-based management restriction.
- If the operation still fails, capture the full error message and check the SQL Server error log for additional details. Some operations may require additional prerequisites beyond the recovery model.
Frequently Asked Questions
What does error 1465 mean exactly?
Error 1465 is raised when an operation requires the database to be in the full recovery model, but the database is currently in the simple or bulk-logged recovery model. The operation cannot proceed until the recovery model is changed and a full backup is taken.
Can I switch back to simple recovery after fixing the error?
Yes, but doing so breaks the log chain. You will need to take a full backup after switching back to simple if you later want to return to full recovery. Only switch back if you do not need point-in-time recovery.
Do I need to take a log backup before retrying the operation?
Not necessarily, but it is strongly recommended. The full backup establishes the log chain; a log backup verifies that the chain is working and prevents the log from growing indefinitely.
Why does the error occur even after I changed the recovery model?
Because the change alone is not enough—you must also take a full backup to start the log chain. Some operations check for a valid log chain, not just the recovery model setting.
Does this affect database performance?
Switching to full recovery itself has minimal performance impact, but the transaction log will grow until you take log backups. Without regular log backups, the log file can become very large and potentially fill the disk.
Can I use this fix on Azure SQL Database?
Azure SQL Database manages recovery models differently; error 1465 is typically seen on SQL Server instances (including Azure SQL Managed Instance). For Azure SQL Database, check the specific documentation for your service tier.