Automic Workload Automation

  • 1.  Automic database table size reports

    Posted Jun 01, 2017 09:19 PM
    Does anyone have any scripts or queries that will report out on the size of the tables in the Automic DB itself?


  • 2.  Automic database table size reports

    Posted Jun 01, 2017 11:58 PM
    I use the below query for checking table usage on MSSQL databases

    DECLARE @tempResults TABLE
    (
          [name] nvarchar(776),
          [rows] varchar(20),
          [reserved] nvarchar(50),
          [data] nvarchar(50),
          [index_size] nvarchar(50),
          [unused] nvarchar(50)
    )

    INSERT INTO @tempResults
    EXEC sp_MSforeachtable 'sp_spaceused "?"'

    SELECT
         t.[name], [rows],
         cast(left([reserved],len([reserved])-3) as int) as [Reserved KB],
         cast(left([data],len([data])-3) as int) as [data KB],
         cast(left([index_size],len([index_size])-3) as int) as [index_size KB],
         cast(left([unused],len([unused])-3) as int) as [unused KB]
    FROM
          @tempResults t
          LEFT OUTER JOIN sys.objects o ON t.[name] = o.[name]
    WHERE
          [is_ms_shipped] = 0 AND
          [type] = 'U'
    ORDER BY
          [Reserved KB] DESC