Project

General

Profile

Production Ticket(ST) #11037

DATANORY - housekeep this 4 table in Datanory production and trial

Added by Rashdan Hussin 7 months ago. Updated 7 months ago.

Status:
Ticket Resolved
Priority:
P3 - Medium
Start date:
23/02/2024
Due date:
29/02/2024
% Done:

100%

Estimated time:
Spent time:
Job Remark:
Ticket Logged Date:
23/02/2024
Ticket No.:
Related Ticket ID:
Type:
Support Request
SLA Initial Response:
23/02/2024
SLA Delivery:
29/02/2024
Esclation Time:
23/02/2024
Issue Reoccurance#:
Actual Initial Response:
23/02/2024
Resolution:

1) Find the table that need to be drop or truncate.

Root cause: Table housekeeping.

Requester ExpectedDeliveryDate:
Delay Justification:
Priority Seq:
Effort (Hour):
External Ticket #:

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

5c69c482-4a3c-4981-ba17-d46da2cb5168.jpg (131 KB) 5c69c482-4a3c-4981-ba17-d46da2cb5168.jpg Rashdan Hussin, 23/02/2024 12:30 PM
Check table size.txt (895 Bytes) Check table size.txt Rashdan Hussin, 23/02/2024 12:31 PM

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

Also available in: Atom PDF