Deleting users in an instance


Questions :

--Should we delete the user or inactivate the user if they are no longer required on the instance 

-- What happens when we delete the user records from the User table.

This article attempts the address the above questions

1. Deletion of the user record will also affect the records on the tables that references the "sys_user" table. Referencing data will be affected based on the "reference cascade delete" configured on the dictionary record.
Review referencing data for sys_user > https://<instance-name>

2. Based on the Cascade rule defined following are the possibilities as explained in the documentation > Configure cascade delete rules
-- Clear or -- None -- : Deleting a record clears references (default option).
-- Delete or Cascade: Deleting a record also deletes all referencing records. For example, when a user record is deleted, any incidents assigned to the user are also deleted.
-- Restrict: Deleting a record is restricted unless there are no references to the record. For example, prevent the user record from being deleted if any incident includes a reference to the user.
-- None: Deleting a record does not change records that reference the record.

3. For eg: "Opened By", "Assigned to" columns on table "task" does reference "sys_user", and the cascade rule defined for them is "empty" i.e clear. Any deletion on sys_user record will also update the data on these columns to Null for the respective records.

4. Deleting the user will cause a data loss and hence it is recommended instead of deleting a specific user, change the state Active as False and Locked out as True.

Note: If it is absolutely necessary to delete the user, this should be tested on the sub-production instance to evaluate the data that can be impacted there can be data loss on the instance as explained above based on the cascade delete rule.

Additional Information

The following Knowledge article explains the general guidelines to avoid data loss on the instance
Dataloss Prevention / Reduction