Production Ticket(ST) #11037
DATANORY - housekeep this 4 table in Datanory production and trial
1) Find the table that need to be drop or truncate.
Root cause: Table housekeeping.
None
Description
- hi @Rashdan Hussin , please help to housekeep this 4 table in Datanory production and trial
- here is the script to check table size
History
#1 Updated by Rashdan Hussin 7 months ago
- Status changed from Assigned To to Support In Progress
#2 Updated by Rashdan Hussin 7 months ago
- Status changed from Support In Progress to Ticket Resolved
- % Done changed from 0 to 100
- Esclation Time set to 23/02/2024
- Actual Initial Response set to 23/02/2024
- Resolution updated (diff)
select
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows,
SUM * 8 AS TotalSpaceKB,
CAST (Round(((SUM* 8)/1024.00),2) AS NUMERIC) AS TotalSpaceMB,
SUM * 8 AS USEDSpaceKB,
CAST*8) /1024.00),2) AS NUMERIC) AS UsedSpaceMB,
(SUM - SUM) * 8 AS UnusedSpaceKB,
CAST (ROUND - SUM)* 8) / 1024.00,2) AS NUMERIC (36,2)) AS UnusdeSpaceMB
FROM sys.tables t
inner join sys.indexes i on t.object_id = i.object_ID
inner join sys.partitions p on i.object_id= p.object_id
inner join sys.allocation_units a on p.partition_id= a.container_id
left outer join sys.schemas s on t.schema_id = s.schema_id
where
t.NAME NOT LIKE 'dt%'
and t.is_ms_shipped = '0'
and i.OBJECT_ID > 255
group by t.Name, s.Name, p.Rows
order by TotalSpaceMB DESC, t.Name
drop table error_log_bk_17012024
truncate table error_log_at
truncate table stg_integration_transaction_log