Ridewaan Hanslo ridewaanhanslo MS SQL SERVER: Re-engineering legacy SQL Server Radius Accounting Processor Archiving solution. Ridewaan Hanslo ridewaanhanslo
Thank You Sponsors
Overview Problem Statement Optimization Archiving Configuration Monitoring Scaling/Availability Demo (Code)
Problem Statement
ISSUES IDENTIFIED Issue 1: SPROC’s for archiving. Issue 2: Lack or bad indexing. Issue 3: Table Reads/Writes configuration. Issue 4: Badly configured Agent Jobs. Issue 5: Lack of Monitoring/Validation. Issue 6: Lack of Documentation.
Optimization
INDEXES Add/Remove/Update Indexes on the tables that forms part of the processing. Add indexes – prevent unnecessary full table scan/heaped approach. Remove indexes – saved 60GB of HDD space. sp_BlitzIndex
Indexes (continued…)
Indexes (continued…) * To be deprecated
Tables Optimised tables mostly used for querying purposes as reading tables (faster reads). Optimized tables mostly used for writing to purposes as write tables (faster writes).
Tables (continued…)
Archiving
ARCHIVING (continued…) Old Way - raw selects (no caching), to gather data and looping through them slowly causing frequent crashes of the archiving jobs. New Way – Cached-Incremental Data Load method was used with the SSIS packages.
ARCHIVING (continued…) The Project has 2 project sets. SQL Server 2012 SQL Server 2014
ARCHIVING (continued…)
ARCHIVING (continued…)
CONFIGURATION
SSIS CATALOG Publish packages to the Server
SQL AGENT JOBS Usage Processing – runs every 4 mins. Job 2: Archiving – runs once a month.
Monitoring
Monitoring Monitor 1: SQL Agent Job – Execution Date Monitor 2: SQL log history. Monitor 3: Email Notifications. Monitor 4: Live/Staging Tables.
SCALING & Availability
SCALING & Availability Vertical Scaling Horizontal Scaling e.g. Table partitions Availability e.g. Database Mirroring
Demo (CODE)
REFERENCES [1] https://www.brentozar.com/
Questions Thank you!