|
1 | 1 | --- |
2 | 2 | title: SQL Transaction log grows continuously |
3 | 3 | description: This article helps you resolve the problem where you notice continuous transaction log growth for a CDC enabled database. |
4 | | -ms.date: 03/16/2020 |
| 4 | +ms.date: 04/23/2025 |
5 | 5 | ms.custom: sap:Replication, Change Tracking, Change Data Capture, Synapse Link |
6 | 6 | --- |
7 | 7 | # SQL Transaction log grows when you use Change Data Capture for Oracle by Attunity |
@@ -37,10 +37,10 @@ DBCC execution completed. If DBCC printed error messages, contact your system ad |
37 | 37 |
|
38 | 38 | You may have a non-distributed LSN because CDC for Oracle uses CDC for SQL stored procedures, and that, in turn, uses the replication log reader. This non-distributed LSN corresponds to the log entries to add the mirrored table in the Attunity CDC database. |
39 | 39 |
|
40 | | -If you run this query, the `log_reuse_wait_desc` option returns a value of `REPLICATION`, indicating the cause. Select the `log_reuse_wait_desc` name from `sys.databases`, where the name is \<your_cdc_database\>: |
| 40 | +If you run this query, the `log_reuse_wait_desc` option returns a value of `REPLICATION`, indicating the cause. |
41 | 41 |
|
42 | 42 | ```sql |
43 | | -REPLICATION <your_cdc_database> |
| 43 | +SELECT log_reuse_wait_desc FROM sys.databases WHERE name = '<your_cdc_database>' |
44 | 44 | ``` |
45 | 45 |
|
46 | 46 | ## Resolution |
@@ -78,23 +78,23 @@ REPLICATION <your_cdc_database> |
78 | 78 | DBCC execution completed. If DBCC printed error messages, contact your system administrator. |
79 | 79 | ``` |
80 | 80 |
|
81 | | -4. To make sure that the transaction log can be reused, confirm that there is no other reuse reason indicated on the database: |
| 81 | +4. To make sure that the transaction log can be reused, confirm that there's no other reuse reason indicated on the database: |
82 | 82 | |
83 | 83 | ```sql |
84 | | - SELECT log_reuse_wait_desc, NAME FROM sys.databases WHERE NAME = 'your_cdc_database' |
| 84 | + SELECT log_reuse_wait_desc, NAME FROM sys.databases WHERE NAME = '<your_cdc_database>' |
85 | 85 | ``` |
86 | 86 |
|
87 | 87 | This returns output that resembles the following: |
88 | 88 |
|
89 | 89 | ```output |
90 | 90 | log_reuse_wait_desc name |
91 | | - NOTHING your_cdc_database |
| 91 | + NOTHING <your_cdc_database> |
92 | 92 | ``` |
93 | 93 |
|
94 | 94 | 5. Now you should be able to truncate the Transaction log by using log backups. You should also be able to shrink the transaction log file to reduce the disk space that's consumed. For example, run the following: |
95 | 95 |
|
96 | 96 | ```sql |
97 | | - BACKUP LOG your_cdc_database TO DISK='c:\folder\logbackup.trn' |
| 97 | + BACKUP LOG <your_cdc_database> TO DISK='c:\folder\logbackup.trn' |
98 | 98 | DBCC SHRINKFILE (yourcdcdatabase_log, 1024) |
99 | 99 | ``` |
100 | 100 |
|
|
0 commit comments