microsoft / SqlNexus

SQL Nexus is a tool that helps you identify the root cause of SQL Server performance issues. It loads and analyzes performance data collected by SQL LogScout, SQLDiag or PSSDiag. It can dramatically reduce the amount of time you spend manually analyzing data.
MIT License
356 stars 101 forks source link

Import fails in tbl_availability_groups and tbl_availability_replicas (with latest Diagmanager version) #166

Closed PiJoCoder closed 2 years ago

PiJoCoder commented 2 years ago

Here is a sample:

The affected file is Snapshot_startup.out and the affected table is tbl_availability_groups.

SQLNexus Information: 0 : RowsetImportEngine Error: An unexpected error has occurred:

System.ArgumentException: Column 'runtime' does not belong to table tbl_availability_groups. at System.Data.DataRow.GetDataColumn(String columnName) at RowsetImportEngine.TextRowsetImporter.InsertRow() at RowsetImportEngine.TextRowsetImporter.ProcessFile()

PiJoCoder commented 2 years ago

The issue stems from the fact that two different scripts collect the same data - in this case tbl_availability_group - and one collects it with runtime column (snapshot file) and the other without (miscpssdiaginfo file). Then in SQL Nexus it depends which file gets imported first – it this case it seems that miscpssdiaginfo.out got imported first and created the table without the runtime column. Then when we try to import the data with runtime column from snapshot file , it throws this.

This issue has already been filed for Diagmanager - https://github.com/microsoft/DiagManager/issues/162

But in the mean time we can take a workaround approach and create two tables in SQL Nexus to accommodate both outputs and let the import proceed.