Offline database cleanup and snapshot for partitioned databases
Issue
Running the offline or online database cleanup utility on partitioned tables causes data corruption.
Determine whether the tables are already partitioned and take the necessary action:
To determine whether the tables are already partitioned, run the following script on the TrueSight Server Automation database:
(Oracle)select decode(count(*), '0', 'Snapshot tables are not partitioned', 'Snapshot tables are partitioned')
from user_part_tables
where table_name in (select table_name
from dbm_module_tables
where module_id = 2
and operation_type = 'SwapTable');(SQL Server)
select case count(*)
when 0 then 'Snapshot tables are not partitioned'
else 'Snapshot tables are partitioned'
end
from(
Select t.name
From sys.tables t
Inner Join sys.schemas s
On t.schema_id = s.schema_id
Inner Join sys.partitions p
on p.object_id = t.object_id
where t.name in (select table_name
from dbm_module_tables
where module_id = 2
and operation_type = 'SwapTable')
and p.index_id In (0, 1)
Group By s.name, t.name
Having Count(*) > 1) pts- Depending on the output of the script, do the following:
- If the output indicates that tables are partitioned, and you are running the cleanup already, stop it, and contact Customer Support for next steps.
- If the output indicates that the tables are not partitioned, your environment is not affected by the issue and cleanup can continue to be run as normal.
Resolution
Before you start with database partitioning, contact BMC Customer Support for a hotfix.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*