This knowledge article may contain information that does not apply to version 21.05 or later which runs in a container environment. Please refer to
Article Number 000385088 for more information about troubleshooting BMC products in containers.
Legacy ID:KA360124
There are basically 2 things we need to do (besides taking a db backup)
1. Remove the form record from the arschema table.
2. Change the overlayprop for the base form in the arschema table.
3. Clean the Fields tables from objects and references to the overlay.
This will leave any added overlay fields orphaned in all the field related tables but that doesn’t cause a problem. Further steps are provided to perform this activity.
Safety Note:
Please make sure you understand these steps before running them; modifying metadata is very delicate and mistakes are very difficult to recover from.
Make backups of the individual table before touching them as well.
For Oracle use the following syntax:
Create table <newtable> as select * from <originaltable>;
- For example ‘create table arschema_copy as select * from arschema;’
For SQL Server or Sybase:
Select * into <newtable> from <originaltable>
- For example ‘Select * into <newtable> from <originaltable>’
Steps:
Let’s assume the base form is called ‘HPD:Help Desk’, just for an example.
Therefore the overlay form is called ‘HPD:Help Desk__o’
1. Remove the form record from the arschema table
a) From a SQL client run the following SQL statement to the AR Database:
Select name, schemaId, overlayprop from arschema where name in (‘<form_name>’, ‘<form_name>__o’);
Example:
Select name, schemaId, overlayprop from arschema where name in (‘HPD:Help Desk’, ‘HPD:Help Desk__o’);
b) Note and write down the schemaId for the base form (HPD:Help Desk in this example). This will be referred later as <BaseschemaId>
c) Also write down the schemaId for the overlay form (HPD:Help Desk__o in this example). This will be referred later as <overlayschemaId>
d) Delete the overlay form from the database using the SQL statement:
delete from arschema where schemaId=<overlayschemaid>;
delete from arschema where schemaId=3379;
2. Change the overlayprop for the base form in the arschema table
a) Set the Base form to not have an overlay:
update arschema set overlayProp=0 where schemaId=<baseschemaid>;
update arschema set overlayProp=0 where schemaId=2407;
b) Since we set the form to not be overlaid, we need also set the Database views to be not-overlaid using the following SQL statement:
update vui set overlayProp=0 where schemaId=<baseschemaid>;
update vui set overlayProp=0 where schemaId=2407;
3. Clean the Fields tables from objects and references to the overlay
To remove the orphans from the field tables: (note that many of these tables many not have any records in them).
Delete from field where schemaId=<overlayschemaId>;
Delete from field_attach where schemaId=<overlayschemaId>;
Delete from field_char where schemaId=<overlayschemaId>;
Delete from field_column where schemaId=<overlayschemaId>;
Delete from field_curr where schemaId=<overlayschemaId>;
Delete from field_date where schemaId=<overlayschemaId>;
Delete from field_dec where schemaId=<overlayschemaId>;
Delete from field_diary where schemaId=<overlayschemaId>;
Delete from field_display where schemaId=<overlayschemaId>;
Delete from field_dispprop where schemaId=<overlayschemaId>;
Delete from field_enum where schemaId=<overlayschemaId>;
Delete from field_enum_values where schemaId=<overlayschemaId>;
Delete from field_int where schemaId=<overlayschemaId>;
Delete from field_permissions where schemaId=<overlayschemaId>;
Delete from field_real where schemaId=<overlayschemaId>;
Delete from field_table where schemaId=<overlayschemaId>;
Delete from field_view where schemaId=<overlayschemaId>;
Restart AR System to finish this procedure.