Fix SQL Server Error 9001 (Log Not Available) in 5 Ways

9 min read

SQL Server error 9001 says the log for a database is not available. Error 9001 shows the end result only so the cause sits in the errors that came before it.

This guide explains how to check those errors and gives five fixes in the order that protects your data.

Quick SummarySQL Server error 9001 means the log for a database is not available. Check the errors before 9001 in the ERRORLOG first. Free log space when error 9002 came first. Bring the storage back when a disk error came first. Restore access to the TDE key when error 15466 came first. Restore a backup or rebuild the log when the files are damaged. Use SQL Recovery when no backup exists.

What Does SQL Server Error 9001 Say About the Log?

According to the Microsoft page for error 9001, error 9001 reports that SQL Server cannot use the transaction log of a database. The message is the end result of another failure and it names no cause.

The log for database 'OrdersDB' is not available. Check the event log for related error messages. Resolve any errors and restart the database.
  • Full log. The log has no space left and error 9002 came first.
  • Storage fault. The log sits on a failed or offline volume or the log file is damaged.
  • TDE or EKM failure. SQL Server cannot decrypt the log because the key module fails. Error 15466 comes first.

Do You Know?Microsoft lists 9002, 3313, 3314, 17204, 17053 and 823 as errors that appear next to 9001. SQL Server can restart the database at runtime and logs message 3422. Error 3449 means the instance must shut down to recover a system database or tempdb.

How to Find the Error That Came First?

Open the ERRORLOG and search for 9001. Study the lines above it and note the first error in the sequence. The path of the current file comes from this query.

SELECT SERVERPROPERTY('ErrorLogFileName') AS ErrorLogPath;

The next query shows the database state, the log reuse wait and the log file settings in one place.

SELECT d.name, d.state_desc, d.log_reuse_wait_desc,
 f.physical_name, f.state_desc AS file_state, f.size / 128 AS size_mb, f.max_size, f.growth
FROM sys.databases AS d
JOIN sys.master_files AS f ON f.database_id = d.database_id
WHERE d.name = N'OrdersDB' AND f.type_desc = N'LOG';

The column max_size counts 8 KB pages and -1 means unlimited growth. A file_state other than ONLINE or a size that equals max_size points you to the method in the table below.

Error before 9001 Cause Start with
9002 The log is full Method 1
823, 17053 or 17204 with an operating system error Storage or file access fault Method 2
15466 or an EKM error Key module cannot decrypt the log Method 3
823 or 824 with failed DBCC CHECKDB and a good backup Damaged files Method 4
Damaged files and no backup No restore source Method 5

Heads UpMicrosoft states the user action in two parts. Resolve the errors that precede 9001 first and then restart the instance so SQL Server recovers the database. A restart without the first fix repeats the failure.

How to Fix SQL Server Error 9001?

Every example uses the database OrdersDB. Copy the MDF and LDF files to another volume before you edit anything.

Method 1: Free Log Space When the Log Is Full

Use this method when error 9002 came first. Microsoft tells you to free log space, free disk space on the volume of the log or expand the log file or add a new one. Start a log backup when the log backups stopped.

BACKUP LOG OrdersDB TO DISK = N'D:\Backup\OrdersDB_Log.trn';
ALTER DATABASE OrdersDB MODIFY FILE (NAME = OrdersDB_log, SIZE = 4096MB);
ALTER DATABASE OrdersDB ADD LOG FILE (NAME = OrdersDB_log2, FILENAME = N'E:\SQLLog\OrdersDB_log2.ldf', SIZE = 2048MB, FILEGROWTH = 512MB);

The MODIFY FILE statement can only raise the size. Use the ADD LOG FILE statement when the current volume has no room. Microsoft states that you bring the database online with ALTER DATABASE SET ONLINE after the fix when the database was in recovery. Follow troubleshoot a full transaction log and transaction log is too big or growing unexpectedly to find why the log did not truncate.

Method 2: Bring the Storage Back and Restart the Database

Use this method when a disk error came first. Confirm that the volumes of the database and log files are online and that the I/O path is stable. Microsoft tells you to update drivers, firmware and BIOS in the I/O path as well.

ALTER DATABASE OrdersDB SET OFFLINE;
ALTER DATABASE OrdersDB SET ONLINE;
DBCC CHECKDB (N'OrdersDB') WITH ALL_ERRORMSGS, NO_INFOMSGS;

Restart the SQL Server service when SET ONLINE fails. DBCC CHECKDB prints nothing when it finds no errors. Move to Method 4 when it reports errors.

Method 3: Restore Access to the TDE or EKM Key

Use this method when error 15466 came first. Microsoft tells you to make sure the external EKM or HSM module is stable and up to date and to work with its maker on module faults. The query below shows which databases use encryption and the type of the encryptor.

SELECT DB_NAME(database_id) AS database_name, encryption_state, encryptor_type
FROM sys.dm_database_encryption_keys;

Expected output shows encryption_state 3 for an encrypted database that works. Follow SQL Server error 33111 when SQL Server cannot find the server certificate for the key.

Method 4: Restore the Last Known Good Backup or Rebuild the Log

Use this method when the files are damaged and a backup exists. Microsoft tells you to restore the last known good backup when the files are damaged. Verify the backup first.

RESTORE VERIFYONLY FROM DISK = N'D:\Backup\OrdersDB_Full.bak';
RESTORE DATABASE OrdersDB FROM DISK = N'D:\Backup\OrdersDB_Full.bak' WITH REPLACE, NORECOVERY;
RESTORE LOG OrdersDB FROM DISK = N'D:\Backup\OrdersDB_Log1.trn' WITH RECOVERY;

Rebuild the log only when the log file is lost and the MDF file closed cleanly. ATTACH_REBUILD_LOG creates a new log file of 1 MB and breaks the log backup chain so take a full backup at once.

CREATE DATABASE OrdersDB ON (FILENAME = N'D:\SQLData\OrdersDB.mdf') FOR ATTACH_REBUILD_LOG;

Follow SQL error 5173 when the attach fails because the files do not match.

Method 5: Recover the Data With SQL Recovery

Use this method when no backup exists and the attach fails. SQL Recovery opens the MDF file without the unavailable log. Advanced Scan targets a damaged file.

Download SQL Recovery Buy SQL Recovery

  1. Install SQL Recovery and select Add File to load the MDF file.

Add MDF file option in SQL Recovery

  1. Select Advanced Scan and confirm the SQL Server version of the file.

Advanced Scan and SQL Server version options in SQL Recovery

  1. Open the preview and confirm that the tables and stored procedures you need are present.

Preview of recovered SQL database objects in SQL Recovery

  1. Select Export and save the objects to a SQL Server database, to SQL scripts or to CSV files.

Export options in SQL Recovery

What Are the Software and System Specifications of SQL Recovery?

Check both tables before you install SQL Recovery on the server or on a separate workstation.

Software Specifications

Attribute Detail
Software name SQL Recovery
Version 14.0
File types MDF and NDF
SQL Server versions 2025, 2022, 2019, 2017, 2016, 2014, 2012, 2008 R2, 2008, 2005 and 2000
Scan modes Quick Scan and Advanced Scan
Export options SQL Server database, SQL scripts and CSV
SQL Server installation Needed only for export to a live server
Demo limit Preview of every item and export of 25 records per table and 5 other objects

System Specifications

Component Requirement
Processor Intel Core 2 Duo E4600 at 2.40 GHz or equivalent
RAM 4 GB
Hard disk space 100 MB free
Operating system Windows 7, 8 and 10 (32 or 64 bit), Windows 11 (64 bit), Windows Server 2008, 2012 R2, 2016, 2019, 2022 and 2025
Framework Microsoft .NET Framework 4.5 or later
Permission Launch SQL Recovery as administrator

What Do DBAs Ask About Error 9001?

Does Error 9001 Mean the Log File Is Corrupt?

No. Error 9001 reports the end result only. A full log, failed storage, a damaged file or a TDE failure can raise it. Check the errors that came before it.

Which Errors Appear With Error 9001?

Microsoft lists 9002, 3313, 3314, 17204, 17053 and 823 next to 9001. Open the ERRORLOG and find the first one in the sequence.

Should You Restart the Instance First?

No. Fix the preceding error first. Microsoft states to resolve the errors that precede 9001 and then restart the instance so SQL Server recovers the database.

Can ATTACH_REBUILD_LOG Fix Error 9001?

Yes, when the log file is lost and the MDF file closed cleanly. It creates a new log file and breaks the log backup chain so take a full backup at once.

Does Error 9001 Hit tempdb?

Yes. Error 3449 means SQL Server must shut down the instance to recover tempdb or a system database. SQL Server creates tempdb again at every start.

How Is Error 9001 Different From Error 9003?

Error 9003 says SQL Server received a log scan number that is not valid. Error 9001 says the log is not available at all. Open the 9003 guide for the second case.

Next Steps After Error 9001 Clears

Execute DBCC CHECKDB on the database and confirm that SQL Server reports no errors. Take a full backup at once and verify it with RESTORE VERIFYONLY.

Set an alert for error 9002 and monitor the free space on the log volume. A full log is the cause you can prevent with one alert.

Who, How and WhyAndrew Jackson, Technical Content Specialist, wrote this guide. The error text, the causes and the user actions follow the Microsoft Learn page for error 9001 and the other Microsoft pages linked above. The T-SQL was checked for syntax against Microsoft documentation and was not executed on a live server. The guide exists because error 9001 names no cause and readers need a way to match the first error to a fix.

Key Takeaways

  • SQL Server error 9001 means the log for a database is not available.
  • Error 9001 names no cause so check the errors before it in the ERRORLOG.
  • Microsoft tells you to resolve the preceding errors first and then restart the instance.
  • A full log, a storage fault and a TDE failure need three different fixes.
  • ATTACH_REBUILD_LOG breaks the log backup chain so take a full backup at once.
  • SQL Recovery exports the data when no backup exists.