Presentation is loading. Please wait.

Presentation is loading. Please wait.

Managing SQL Server for AX

Similar presentations


Presentation on theme: "Managing SQL Server for AX"— Presentation transcript:

1

2 Managing SQL Server for AX
Corey Vantilborg, Tigercat Industries #CollaborateCanada

3 Introduction

4 Corey Vantilborg 4 Years Dedicated AX Administrator at a Manufacturing Company Responsible for all aspects of technical implementation Acted as SME for Manufacturing group for majority of project Developer as required

5 Dynamics AX @ Tigercat Multi-Company, Multi-Site implementation
Two Primary companies are both manufacturing (1 OEM and 1 Custom) Implementation began with selection process in late 2011 Initial go-live in July 2014 Final Go-Live completing this year Many modifications including large ISV (Annata IDMS)

6 PREMIUM FORESTRY EQUIPMENT
Release date 15 April 2016 30 May 2016 – Removed South Korean distributor PREMIUM FORESTRY EQUIPMENT

7 Who we are… Privately owned Canadian corporation
Industry leader in forestry equipment design Strong engineering and manufacturing capabilities Customer-driven innovation Worldwide dealer network

8 2016 profile 9 manufacturing locations in southern Ontario
Parts facilities in Ailey, Georgia and Hede, Sweden 1,300 employees 138 dealers around the world: Canada, US, South America, Africa, Western Europe, Russia, Australia and New Zealand Complete lineup of forestry and off-road industrial equipment 17,000 machines built and counting!

9 Advanced manufacturing

10 In the field

11 In the field

12 In the field

13 Audience Dynamics AX Administrator who is either responsible for or consults on the OLTP database which hosts Dynamics AX.

14 Agenda SQL Configuration SQL Performance SQL Day to Day Activities

15 SQL Configuration Most information drawn from
x-performance-analyzing-key-sql-server-configuration- and-database-settings/

16 Specific Configuration Issues to watch out for
Database Collation Collation between the business database and modelstore database must be the same.

17 High- Availability /Redundancy Options
Always-On Availability Groups Multiple Database servers in a cluster with a single primary and multiple secondary nodes. Preferred option for AX Allows for automatic fail-over, with no AOS crash Log Shipping Automated Log backup and restore to secondary node Database mirroring Multiple server instances sharing storage and database files Depreciated -Tigercat moved away from AAG due to extra failure modes

18 SQL Performance

19 Resource Monitor / Task Manager
Basic Real-time tools for monitors server level performance and utilization Helpful for at a glance information -Note that Tigercat uses SCOM for a single window view of many performance counters. -Won’t cover full monitoring solutions -

20 Performance Monitor Able to monitor and log many counters within windows

21 PAL Performance Analysis of Logs
Downloadable Microsoft tool for analysing Performance Monitor outputs

22 SSMS : Activity Monitor
Shows information about what SQL is doing in real-time Can be filtered to determine the source of locking issues.

23 Correlating AX Sessions to SQL SPID
Microsoft blog ft.com/amitkulkarni/2011/ 08/10/finding-user- sessions-from-spid-in- dynamics-ax-2012/ Needs to be done on each AOS, and the AOS restarted select cast(context_info as varchar(128)) as ci , session_id ,host_name ,login_time ,status ,cpu_time ,reads ,writes ,last_request_start_time ,last_request_end_time from sys.dm_exec_sessions where program_name like '%Dynamics%' --Enter SQL SPID to find and session_id = 1130 -Watch for SQL to determine if a SPID is doing work, or if AX is frozen in some way

24 Monitor AAG Cluster Quick Query to monitor the health of an AAG
Investigate Log Re-Use State Investigate Replica Status Investigate Transaction Log space -Demo Live on SQLSAV01

25 General SQL Tasks

26 Item Consistency Check Prep
Certain Issues will prevent the Item Consistency check from running correctly These SQL queries will find the data to allow for easy correction

27 Missing Item Groups -- Items Missing Item Groups select
inventtable.ITEMID, inventtable.NAMEALIAS, inventtable.TCI_PLANNERCODEID, inventtable.AMITEMMAJORGROUPID from INVENTTABLE left join INVENTITEMGROUPITEM on INVENTTABLE.ITEMID = INVENTITEMGROUPITEM.ITEMID and INVENTTABLE.DATAAREAID = INVENTITEMGROUPITEM.ITEMDATAAREAID where INVENTITEMGROUPITEM.RECID is null -Demo Live on SQLSAV01

28 Missing Item Model Group
--Items Missing Item Model Groups select inventtable.ITEMID, inventtable.NAMEALIAS, inventtable.TCI_PLANNERCODEID, inventtable.AMITEMMAJORGROUPID, inventtable.DATAAREAID from INVENTTABLE left join INVENTMODELGROUPITEM on INVENTMODELGROUPITEM.ITEMID = inventtable.ITEMID and inventtable.DATAAREAID = INVENTMODELGROUPITEM.ITEMDATAAREAID where INVENTMODELGROUPITEM.RECID is null -Demo Live on SQLSAV01

29 Missing Tracking Dimension Group
select inventtable.ITEMID, inventtable.NAMEALIAS, inventtable.TCI_PLANNERCODEID, inventtable.AMITEMMAJORGROUPID, inventtable.DATAAREAID from INVENTTABLE left join ECORESTRACKINGDIMENSIONGROUPITEM on ECORESTRACKINGDIMENSIONGROUPITEM.ITEMID = inventtable.ITEMID and ECORESTRACKINGDIMENSIONGROUPITEM.ITEMDATAAREAID = inventtable.DATAAREAID where ECORESTRACKINGDIMENSIONGROUPITEM.RECID is null -Demo Live on SQLSAV01

30 Missing Storage Dimension Group
select inventtable.ITEMID, inventtable.NAMEALIAS, inventtable.TCI_PLANNERCODEID, inventtable.AMITEMMAJORGROUPID, inventtable.DATAAREAID from INVENTTABLE left join ECORESSTORAGEDIMENSIONGROUPITEM on ECORESSTORAGEDIMENSIONGROUPITEM.ITEMID = inventtable.ITEMID and ECORESSTORAGEDIMENSIONGROUPITEM.ITEMDATAAREAID = inventtable.DATAAREAID where ECORESSTORAGEDIMENSIONGROUPITEM.RECID is null -Demo Live on SQLSAV01

31 Use X++ Enums in SQL(Easy Way)
The SRSANALYSISENUMS table will contain the labels for ENUMs in use by your Analysis projects. Does not contain all Enums select PRODID ,PRODSTATUS ,SRSANALYSISENUMS.ENUMITEMLABEL from PRODTABLE join SRSANALYSISENUMS on PRODTABLE.PRODSTATUS = SRSANALYSISENUMS.ENUMITEMVALUE and SRSANALYSISENUMS.ENUMNAME = 'ProdStatus' and SRSANALYSISENUMS.LANGUAGEID = 'en-us' -Demo Live in SQLSAV01

32 Day to Day activities

33 Daily Checks Drive Space Back-up status Back-Up validation
Index maintenance

34 Drive Space Data Files Log Files TempDB Continually grow
Data Management practices can control this IDMF is Microsoft’s solution Log Files Relatively steady-state in size controlled by daily data volume and back-up frequency TempDB Very steady-state in size, should not regularly gro Everyone is using separate drives for Data, Logs and TempDB?

35 Back-up Status / Validation
Most straight-forward method is to use SQL job to notify of status Different validation for different backups Example Nightly Full - notifies on all conditions Transaction Backup only on failure Validation Use Restore Verifyonly If backup does NOT contain CheckSum then VerifyOnly will only confirm that the file is complete and restore attempt is possible Using With CheckSu command on back-up to include CheckSum in the backup Validate back by having a nightly data refresh

36 Index Maintenance SQL includes a number of native tools for index maintenance Rebuild re-creates the index Re-Organize makes existing index’s more efficient Both of these can be scheduled via SQL Agent jobs This approach is not dynamic, and make not be practical Tigercat uses SQLFool Index maintenance script Automates re-indexing with a selectable priority Logging Restart Highly Configurable

37 Scheduled Data Checking
Use SQL Job + sp_send_dbmail Allows scheduled queries to send results via Much Easier than creating a Batch Job in X++ Lower resource overhead depending on query -Demo Live on SQLSAV01

38 Scheduled SQL Example if exists (
select * from TCI_AX2012R2_PROD.dbo.route where ROUTEID = '' ) EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Exchange', @recipients = @subject = 'Blank Route Issue', @query = N'select OPRID, OPRNUM, DATAAREAID, RECID from TCI_AX2012R2_PROD.dbo.route where ROUTEID = ""', @attach_query_result_as_file = 0

39 General SQL Query Tips(For AX)
Always add DataAreaID to join conditions Pay Attention to query predicates and indexes Note Extended Tables

40 Thank You Corey Vantilborg, Tigercat Industries
Twitter: @CoreyVantilborg Please Remember to Fill our session surveys #CollaborateCanada


Download ppt "Managing SQL Server for AX"

Similar presentations


Ads by Google