Posts

Showing posts from June, 2018

Transaction Log File Considerations when using Change Data Capture(CDC),database log growth due to CDC

One of the most important things to watch out for with change data capture(CDC) is the transaction log I/O subsystem. As stated earlier, log file I/O significantly grows when change data capture is enabled in a database. In addition to that, log records stay active until change data capture has processed them . This means that especially in environments where a large latency builds up, the log file can grow significantly because the log space cannot be reused as long as the change data capture scan job has not processed the log records, even in simple recovery model, or even after a log backup in full recovery model. It should be noted that change data capture works with all recovery models. But when change data capture is enabled, operations that would normally be minimally logged in simple or bulk-logged recovery models are fully logged to enable change data capture to capture all changes. Be aware also that when a log disk becomes full, you cannot shrink the log fil...

SQL Server Agent Job Timings

DECLARE @Table TABLE ( JobID VARCHAR ( 2000 ), Jobname VARCHAR ( 1000 ), LastRunDatetime VARCHAR ( 100 ), TimeAlone VARCHAR ( 100 ), LastRunStatus varchar ( 100 ), LastDuration varchar ( 100 ), LastRunMessage NVARCHAR ( 4000 ), NextRundate NVARCHAR ( 4000 )) INSERT INTO @Table SELECT   [sJOB] . [job_id] AS [JobID]   , [sJOB] . [name] AS [JobName]     , CASE            WHEN [sJOBH] . [run_date] IS NULL OR [sJOBH] . [run_time] IS NULL THEN NULL         ELSE CAST (                 CAST ( [sJOBH] . [run_date] AS CHAR ( 8 ))                 + ' '                    + STUFF (                     STUFF (RIGHT( '000000' + CAST ( [sJOBH] . [run_time] AS VARCHAR ( 6 )),   6 )                         , 3 , 0 , ':' )                     , 6 , 0 , ':' )                 AS DATETIME )       END AS [LastRunDateTime] , convert ( char ( 50 ), CASE            WHEN [sJOBH] . [run_date] IS ...

The process could not execute 'sp_repldone/sp_replcounters' on 'RAMESH\DEV'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20011)

Image
I am trying to reproduce the above error with the below scenarios. PLEASE  DON’T DO THIS IN PRODUCTION ENVIRONMENT 1)         1) Stop log reader agent in SQL Server   Insert a couple of rows in a Transnational publication table. Choose one table INSERT INTO Students VALUES ( 10 , 'D' ),( 11 , 'E' ),( 12 , 'F' ) 1)        Run the below command one by one EXEC sp_replcmds GO EXEC sp_replshowcmds GO --Now this can run at distribution database in distribution server. No need to run this here,though you run this one throw error. EXEC sp_browsereplcmds  1 Now try to run the log reader agent job manually, go to replication monitor and start Log reader agent job manually. Right click on the monitor and start the job       Workaround: This error occured becuase i have opened ...