Background
Scheduled tasks are processed in the early hours of the day, which can take up to 6-7 hours of normal time. It is a deadline to ensure that all data is processed before 9 o'clock every day. If not completed, the day of operation to indicate an accident, affecting the customer.
In the early days, if a database data processing failure, will send an alarm message, when the alarm mail more up, from the mail to confirm which database processing failure, is undoubtedly a difficult thing.
By writing stored procedures, all of the DB data processing is monitored, and a daily report is sent in HTML format so that the data processing status can be quickly and accurately known.
Final effect
- is a list of database servers, one database server can create multiple databases, and each profile is a db.
Implementation method
The results in the table, dependent on a table in the operations database, ProcessDurationReport
This table of records is the process of processing each database, the processing of time-consuming situation is written, we then through the SQL to calculate the table information, the final stitching into an HTML page, via SQL Server mail Service sent out.
Table structure is as follows
The related stored procedures are as follows
- Related Stored Procedure links
Written in the last
The implementation of this feature means simplifying operations, and each day you can view the report to determine the status of the data processing.
can also continue to improve on this basis, into a small web site, real-time to show the status of processing.
You can also add other features to show the history of data processing status.
SQL Server stored procedures generate and send HTML monitoring reports