Replication status


Job details

Name: Replication status
Platform: Sqlserver
Category: Cluster and Replication
Description: The following check provides general info in regards to any replication going on in a server.
Long description: This procedure analyze MSdistribution_agents table which contains one row for each Distribution Agent running at the local Distributor. This table is stored in the distribution database.
Version: 2
Default schedule: 0 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2000′ & hasengine=‘YES’ & engine_edition = ‘Microsoft SQL Server’ & eng_inst_priv = 0]

Parameters

Name Default value Description
return code 1 Returned code (0-OK, 1-WARNING, 2-ALARM) when the replication status is “Failed”.
distribution database name distribution Name of the distribution database which stores metadata and history data for all types of replication, and transactions for transactional replication.

Job Summary

SELECT * FROM dbw_repl_status_tab;

Job Details

Tables and Procedures Created

Dependency
The job depends on itself and the replication status table and ensures its cleanup on failure which is crucial for maintaining the accuracy of logs and system stability.

SQL Implementation

The following SQL tasks are performed:

  1. Creation of temporary tables “#tempsub1″ and “#tempsub2″ to handle intermediate data.
  2. Gathering data from “msdistribution_agents” and “MSdistribution_history” tables.
  3. Manipulating and moving data between tables to format the final output into “dbw_repl_status_tab.”
  4. Exception handling to capture and log errors during execution.

Reporting
The job involves a presentation/reporting mechanism where the replication statuses are displayed:

Upgrade Notes
If upgrading from previous versions (1.4, 1.5):

  1. The table “dbw_repl_status_tab” might be recreated with possibly altered structure ensuring better handling and storage of data.
  2. Modifications in the replication status procedure to enhance efficiency and error management.

Other configurations

Monitoring and Reaction

Upon identifying a replication failure, the system:

  1. Logs detailed error messages and status.
  2. Propagates status values that can trigger alerts or warnings based on defined thresholds.

Conclusion

This dbWatch job is integral to maintaining robust SQL Server replication systems, providing administrators comprehensive insights and automated oversight of replication statuses to preemptively resolve potential issues affecting critical database operations.