You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/relational-databases/logs/troubleshoot-a-full-transaction-log-sql-server-error-9002.md
+24-8Lines changed: 24 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,7 +255,7 @@ DEALLOCATE no_truncate_db
255
255
> [!IMPORTANT]
256
256
> 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)
257
257
258
-
### More information on LOG_BACKUP log_reuse_wait
258
+
### LOG_BACKUP log_reuse_wait
259
259
260
260
The most common actions you can consider here is to review your database recovery model and backup the transaction log of your database.
261
261
@@ -317,7 +317,7 @@ BACKUP LOG [dbname] TO DISK = 'some_volume:\some_folder\dbname_LOG.trn'
317
317
318
318
319
319
320
-
### More information on ACTIVE_TRANSACTION log_reuse_wait
320
+
### ACTIVE_TRANSACTION log_reuse_wait
321
321
322
322
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).
323
323
@@ -336,9 +336,24 @@ This statement lets you identify the user ID of the owner of the transaction, so
336
336
337
337
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)
338
338
339
-
### More information on AVAILABILITY_REPLICA log_reuse_wait
339
+
### AVAILABILITY_REPLICA log_reuse_wait
340
340
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)
342
357
343
358
## 2. Resolve full disk volume
344
359
@@ -506,10 +521,10 @@ ELSE
506
521
### Increase log file size or enable Autogrow
507
522
508
523
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
+
510
525
If autogrow is disabled, the database is online, and sufficient space is available on the disk, do either of these:
511
526
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.
513
528
- 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)
514
529
515
530
> [!NOTE]
@@ -521,5 +536,6 @@ If autogrow is disabled, the database is online, and sufficient space is availab
521
536
[Manage the Size of the Transaction Log File](../../relational-databases/logs/manage-the-size-of-the-transaction-log-file.md)
[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