So I thought what a perfect time to try and get this knocked out. Put my son to sleep, my wife is out of town, I found some ice cream in the freezer and football is on TV. Sounds like the perfect blog writing atmosphere. Oh, and I had a weird issue pop up at work this week so I have something to write about.
Problem
We have a central administration server where we run data captures and alerting for our entire infrastructure. A couple weeks ago our monitoring tool Spotlight threw a low level alert about the log drive on this admin server. And being the good DBA I am, I saw the alert each morning when checking things, but did not pay too much attention since it was a DBA Team server. On Monday of this past week the alert had grown from yellow (low level alert) to a red (high level alert).
I took the following troubleshooting steps:
- Verify the Transaction Log backup job was running successfully
- Checked the recovery model for the database in question
- It is set to SIMPLE, so what is causing this log to grow
- I queried sys.databases and found that REPLICATION was the current log_reuse_wait_desc
What!!! We do not have replication on this server. Ok, someone is messing with me.
Further digging and googling pointed at CDC. Well this is not something we have used in the past. However, I did recall one of my colleagues talking about using CDC to capture table changes for auditing purposes. But I had never heard that he moved forward.
So sure enough, I queried sys.databases again and the is_cdc_enabled flag was true for this database. Further investigation found that the cdc.DBName_capture job had failed and then was disabled. Well that is not good as everything was being jammed in the transaction log waiting to be saved to the CDC tables.
Solution
I talked to my colleague who had abandoned the idea of seeing why the job was failing and using CDC all together. Needless to say he did not know that this would be a result, nor did I when it was discussed.
So I ran the command below to disable CDC for the database involved.
1 2 3 4 |
USE ElevateMetrics GO EXEC sys.sp_cdc_disable_db GO |
Once I did that I was able to shrink the transaction log back to a normal size.
Conclusion
To wrap this up I would say that if you are testing a new technology on a live server be a little more cognizant when you see things that do not look right. And stay on top of your alerts!!!