Skip to content

Commit bdd609f

Browse files
authored
Update 9002 article based on feedback from peers
1 parent 551af75 commit bdd609f

1 file changed

Lines changed: 24 additions & 8 deletions

File tree

docs/relational-databases/logs/troubleshoot-a-full-transaction-log-sql-server-error-9002.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ DEALLOCATE no_truncate_db
255255
> [!IMPORTANT]
256256
> If the database was in recovery when the 9002 error occurred, after resolving the problem, recover the database by using [ALTER DATABASE *database_name* SET ONLINE.](../../t-sql/statements/alter-database-transact-sql-set-options.md)
257257
258-
### More information on LOG_BACKUP log_reuse_wait
258+
### LOG_BACKUP log_reuse_wait
259259

260260
The most common actions you can consider here is to review your database recovery model and backup the transaction log of your database.
261261

@@ -317,7 +317,7 @@ BACKUP LOG [dbname] TO DISK = 'some_volume:\some_folder\dbname_LOG.trn'
317317
318318

319319

320-
### More information on ACTIVE_TRANSACTION log_reuse_wait
320+
### ACTIVE_TRANSACTION log_reuse_wait
321321

322322
The steps to troubleshoot ACTIVE_TRANSACTION reason include discovering the long running transaction and resolving it (in some case using the KILL command to do so).
323323

@@ -336,9 +336,24 @@ This statement lets you identify the user ID of the owner of the transaction, so
336336

337337
Sometimes you just have to end the transaction; you may have to use the [KILL](../../t-sql/language-elements/kill-transact-sql.md) statement. Please use this statement very carefully, especially when critical processes are running that you don't want to kill. For more information, see [KILL (Transact-SQL)](../../t-sql/language-elements/kill-transact-sql.md)
338338

339-
### More information on AVAILABILITY_REPLICA log_reuse_wait
339+
### AVAILABILITY_REPLICA log_reuse_wait
340340

341-
When transaction changes at primary Availability replica are not yet hardened on the secondary replica, the transaction log on the primary replica cannot be truncated. This can cause the log to grow , and can occur whether the secondary replica is set for synchronous or asynchronous commit mode. For information on how to troubleshoot this type of issue see [Error 9002. The transaction log for database is full due to AVAILABILITY_REPLICA error](/troubleshoot/sql/availability-groups/error-9002-transaction-log-large)[Error 9002. The transaction log for database is full due to AVAILABILITY_REPLICA error](/troubleshoot/sql/availability-groups/error-9002-transaction-log-large)
341+
When transaction changes at primary Availability replica are not yet hardened on the secondary replica, the transaction log on the primary replica cannot be truncated. This can cause the log to grow , and can occur whether the secondary replica is set for synchronous or asynchronous commit mode. For information on how to troubleshoot this type of issue see [Error 9002. The transaction log for database is full due to AVAILABILITY_REPLICA error](/troubleshoot/sql/availability-groups/error-9002-transaction-log-large)
342+
343+
### CHECKPOINT log_reuse_wait
344+
345+
No checkpoint has occurred since the last log truncation, or the head of the log has not yet moved beyond a virtual log file (VLF). (All recovery models)
346+
347+
This is a routine reason for delaying log truncation. If delayed, consider executing the `CHECKPOINT` command on the database or examining the log [VLFs](../../relational-databases/sql-server-transaction-log-architecture-and-management-guide.md#physical_arch).
348+
349+
```TSQL
350+
USE dbname; CHECKPOINT
351+
select * from sys.dm_db_log_info(db_id('dbname'))
352+
```
353+
354+
### For more information on log_reuse_wait factors
355+
356+
For a more details see [Factors that can delay log truncation](../../relational-databases/logs/the-transaction-log-sql-server.md#FactorsThatDelayTruncation)
342357

343358
## 2. Resolve full disk volume
344359

@@ -506,10 +521,10 @@ ELSE
506521
### Increase log file size or enable Autogrow
507522

508523
If space is available on the log disk, you can increase the size of the log file. The maximum size for log files is two terabytes (TB) per log file.
509-
524+
510525
If autogrow is disabled, the database is online, and sufficient space is available on the disk, do either of these:
511526

512-
- Manually increase the file size to produce a single growth increment.
527+
- Manually increase the file size to produce a single growth increment. These are [general recommendations](../../relational-databases/logs/manage-the-size-of-the-transaction-log-file.md#Recommendations) on log size growth and size.
513528
- Turn on autogrow by using the ALTER DATABASE statement to set a non-zero growth increment for the FILEGROWTH option. See [Considerations for the autogrow and autoshrink settings in SQL Server](/troubleshoot/sql/admin/considerations-autogrow-autoshrink)
514529

515530
> [!NOTE]
@@ -521,5 +536,6 @@ If autogrow is disabled, the database is online, and sufficient space is availab
521536
[Manage the Size of the Transaction Log File](../../relational-databases/logs/manage-the-size-of-the-transaction-log-file.md)
522537
[Transaction Log Backups (SQL Server)](../../relational-databases/backup-restore/transaction-log-backups-sql-server.md)
523538
[sp_add_log_file_recover_suspect_db (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-add-log-file-recover-suspect-db-transact-sql.md)
524-
[Manage the size of the transaction log file](manage-the-size-of-the-transaction-log-file.md)
525-
[MSSQLSERVER_9002](../errors-events/mssqlserver-9002-database-engine-error.md)
539+
[MSSQLSERVER_9002](../errors-events/mssqlserver-9002-database-engine-error.md)
540+
[How a log file structure can affect database recovery time - Microsoft Tech Community](https://techcommunity.microsoft.com/t5/sql-server-support/how-a-log-file-structure-can-affect-database-recovery-time/ba-p/315780)
541+
[SQL Server: Understanding Logging and Recovery in SQL Server](../../previous-versions/technet-magazine/dd392031(v=msdn.10))

0 commit comments

Comments
 (0)