Rename and Move Procedure
Rename Procedure Generator
The Rename Procedure Generator is used to generate a database procedure which completely renames a model, including any denormalized natural key field values.
For example, if you want to rename an enterprise, it's not enough to simply change ENTERPRISE.NAME. This is because there are several other tables where that data has been redundantly denormalized (often as "ENT_NAME"), typically for performance reasons.
The Rename Procedure Generator is aware of these references, and generates a stored procedure capable of identifying and correcting them.
A JMX Method under the "DTB Admin" MBean has been provided to generate the procedure. The required parameters are the Model Level (e.g. Enterprise) and Field Name (e.g. Name) for which we need to make changes.
This will generate a DDL file which the developer must execute to create the procedure. The generated procedure accepts 3 parameters:
sysId - Surrogate id of the model level, i.e. sysId of the Enterprise to be renamed.
NewValue - New value of the field to be replaced, e.g. "SampleEnterprise2" to replace "SampleEnterprise" with "SampleEnterprise2"
CommitSize - Batch chunk size to commit. Default value is 1000.
Once created in the DB, you can execute this procedure as follows:
call REN_ENTERPRISE(10000, "SampleEnterprise", 50);
Move Procedure Generator
If all the "child" data associated with an Enterprise SampleEnterprise1 needs to be re-associated with Enterprise SampleEnterprise2 then this tool can be used to generate such procedure. After executing the procedure, all sys ids, denormalized natural keys and generic modellinks will be re-associated with SampleEnterprise2. For example, if "SampleOrg1" lived under "SampleEnterprise1", after executing the procedure it will now live under "SampleEnterprise2".
A JMX Method under the "DTB Admin" MBean has been provided to generate the procedure. It requires one parameter: Model Level
This will generate a DDL file which the developer must execute to create the procedure. The generated procedure accepts 3 parameters:
oldSysId - Old surrogate id of the model level which needs to be replaced, e.g. 10000
newSysId - New surrogate id of the model level to be replaced with, e.g. 10001
CommitSize - Batch chunk size to commit. Default value is 1000
Once created in the DB, you can execute this procedure as follows:
call MOVE_ENTERPRISE(10000, "SampleEnterprise2", 50);