Skip to end of metadata
Go to start of metadata

During your Development process you have, for example, linked to an Active Directory and loaded too many
person in your MES System.

now it's time to clean up

Step-by-step guide

Test this on a DEV or Test system first and as always also take a GW/DB backup beforehand

  1. in DB Browser or SQL Workbench

    This will wipe out all MESPerson references from the Change Log (3.0) Object Link, and Person tables.

    delete from MESChangeLog where MESObjectUUID in (select MESPersonUUID from MESPerson)  # MES 3.0 ONLY
    delete from MESObjectLink where MESObjectType = 'Person'                               # MES 2.0 AND 3.0
    delete FROM MESPerson                                                                  # MES 2.0 AND 3.0

    1. in the Script Console
      This will trigger a personnel sync 


      Now you should just be left with the intended users.

      note#1: You may just have to reassign people to personnel classes.

      note#2: The Analysis Security Properties are not rebuilt during system.mes.synchronizeMESPersonnel()
                    If a role is no longer present or needed you can delete it using
                     delete from MESANalysisSecurityProperty where Name = '<Role Name>'
      note#3 to delete a single user 
               delete from MESPerson and MESObjectLink where MESPersonUUID/MESObjectUUID = that UUID

Personnel Objects

MES Personnel Selector