Tuesday 31 October 2023

SCCM Replication Troubleshooting

 

To replicate the data between configmgr sites, Configuration Manager uses Database Replication Service (DRS). The DRS intern uses SQL Server Service Broker (SSB) to replicate data between the sites

We can troubleshoot SQL replication issue by following below approach.
1. Replication Link Analyzer.
2. Investigating Log files.
3. Performing SQL queries
4. Re-initiating replication.

The Replication Link Analyzer can find and fix most but not all database replication problems
rcmctrl.log
replmgr.log

Run the spDiagDRS script. The resulting output contains useful information about the general status of the database replication, the current replication link status, and the last sync time for each replication group

Examine the vLogs view. These logs show more detailed information about the process. For example, when the database replication checks for changes, when it receives the BCP (bulk copy data) from the publisher, when it ProcessSyncDataXml, and when a specific table is updated.

Check the SSB log found at: C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\ErrorLog.

Manual Sync

To re-initiate the global data, run the following SQL command:
EXEC spDrsSendSubscriptionInvalid ‘SiteCode’, ‘SiteCode’, ‘Configuration Data’

Create a .PUB file in rcm inbox folder on primary site for failed global data group

The Replication Link Analyzer works by examining both sites and checking whether:
The SMS service is running
The SMS Replication Configuration Monitor component is running
The ports required for SQL replication are enabled
The SQL version is supported
The network is available between the two sites
There is enough space for the SQL database
The SSB service configuration exists
The SSB service certificate exists
There are any known errors in SQL log files
There are any replication queues disabled
Time is in sync
The transmission of data is stuck
A key conflict exists

SCCM SQL Query to get Bit-locker Recovery Key

  SELECT cm.Name, ck.RecoveryKeyId, cv.VolumeGuid, cvt.TypeName AS 'Volume Type', RecoveryAndHardwareCore.DecryptString(ck...