Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-11960

Insight Discovery MS SQL Pattern fails for large Database

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 3.1.6
    • 5.0.0
    • Assets Discovery
    • None

    Description

      Issue Summary

      Insight Discovery MS SQL Pattern fails for large Database

      This is reproducible on Data Center: yes

      Steps to Reproduce

      The below command in the MS SQL Pattern file will fail to execute in large databases and result in an “overflow” error because the SQL statement is tried to be written into an INT instead of a BIGINT in case of large databases.

       sqlcmd -E -Q "SELECT DB.name, SUM(CASE WHEN type = 0 THEN MF.size * 8 / 1024 ELSE 0 END) AS DataFileSizeMB, SUM(CASE WHEN type = 1 THEN MF.size * 8 / 1024 ELSE 0 END) AS LogFileSizeMB, @@servicename as InstanceName FROM sys.master_files MF JOIN sys.databases DB ON DB.database_id = MF.database_id GROUP BY DB.name"
      

      Expected Results

      The command in the pattern file executes without any issues and returns the Scan results.

      Actual Results

      Execution of the pattern files doesn't provide the expected results.

      Workaround

      The Column "size" needs to be CAST to data type bigint in the pattern file.

      • Current SQL Code: MF.size * 8 / 1024
      • Fixed SQL Code: cast(MF.size as bigint) * 8 / 1024

      Attachments

        Activity

          People

            11507b174037 Zakhar Listiev
            f75285566e0c Prabhu Subramaniyan
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Backbone Issue Sync