| 1 | = ZUAUSR Table Maintenance = |
| 2 | |
| 3 | == Overview == |
| 4 | Three types of table maintenance for the zuausr@prod user are ongoing. |
| 5 | * Cleaning out unused classes |
| 6 | * Consolidating classes |
| 7 | * Managing Fake or Terminated Users |
| 8 | |
| 9 | == Cleaning out Unused Classes == |
| 10 | As we examine ZUAUSR tables, we at times find base classes that have no users associated with them. When that is the case, the functional user is consulted about its relevance. If the class is determined to be of no value, then the class is recorded in ZUAUSR administrative documents and deleted. See [[https://drive.google.com/drive/folders/0B1lxXqYPLTCicW1OZmswd2dYdUk|ZUAUSR > DELETE ZUAUSR CLASSES]]. |
| 11 | |
| 12 | === Removing a SUPER class === |
| 13 | A typical report to determine membership follows: |
| 14 | {{{ |
| 15 | FG_AR_ATN_CLS |
| 16 | Description |
| 17 | This class was created to finalize billing related to an audio conferencing service that was discontinued. RayAnne Robinson created the class and assigned Laura Morisky to it who used it for a few months to clear out the accounts receivable. Laura is its only member and has not used it since. |
| 18 | |
| 19 | Class Definition |
| 20 | ZUAUSR@prod> select ztvclsd_class_inst, ztvclsd_assoc_class_name, |
| 21 | 2 ztvclsd_assoc_class_type, ztvclsd_assoc_class_inst |
| 22 | 3 from ztvclsd |
| 23 | 4 where ztvclsd_class_name = 'FG_AR_ATN_CLS'; |
| 24 | |
| 25 | CLS Inst Associated Class Name AssocType AssocInst |
| 26 | ---------- ------------------------------ ---------- ---------- |
| 27 | LRGP MTR_ATN_C BANNER LRGP |
| 28 | LRGP USR_DEFAULT_Q ORACLE LRGP |
| 29 | LRGP USR_DEFAULT_M ORACLE LRGP |
| 30 | |
| 31 | PROD QAA_ACCESS_C BANNER PROD |
| 32 | PROD MTR_ATN_C BANNER PROD |
| 33 | PROD USR_DEFAULT_M ORACLE PROD |
| 34 | PROD USR_DEFAULT_Q ORACLE PROD |
| 35 | |
| 36 | 7 rows selected. |
| 37 | Zero Members |
| 38 | |
| 39 | }}} |
| 40 | |
| 41 | Since there are no members, and this is a SUPER class, there are two steps required. One must first delete the class from ZTVCLSD, then delete it from ZTVCLSA. All entries in the ZTVCLSD table are deleted using the following command: |
| 42 | {{{ |
| 43 | DELETE ztvclsd |
| 44 | where ztvclsd_class_name = 'FG_AR_ATN_CLS'; |
| 45 | }}} |
| 46 | The associated class names are not removed from ZTVCLSA so they remain associated with SUPER classes that are actively used. |
| 47 | |
| 48 | The following command deletes the class from ZTVCLSA |
| 49 | {{{ |
| 50 | DELETE ztvclsa |
| 51 | where ztvclsa_class_name = 'FG_AR_ATN_CLS'; |
| 52 | }}} |
| 53 | |
| 54 | === Removing an Associated Class === |
| 55 | Several associated classes had not been used in ZUAUSR. If an associated class had not been included in a SUPER class, then removing it from ZTVCLSA is enough. However, if it had been included in a SUPER class, the following would suffice to remove its associations. The following was such a class |
| 56 | ||'''Type'''||'''Class Name'''||'''Instance'''|| |
| 57 | ||ORACLE||UA_APPWORX||APMT|| |
| 58 | ||ORACLE||UA_APPWORX||APMP|| |
| 59 | |
| 60 | First query the number of classes to which its associated: |
| 61 | {{{ |
| 62 | SELECT count(*) from ztvclsd |
| 63 | WHERE ztvclsd_assoc_class_name = 'UA_APPWORX'; |
| 64 | }}} |
| 65 | A number results. This is the number you use to ensure that you do not delete any other classes from the ZUAUSR tables. The following deletes the class from any association to a SUPER class. |
| 66 | {{{ |
| 67 | DELETE ztvclsd |
| 68 | WHERE ztvclsd_assoc_class_name = 'UA_APPWORX'; |
| 69 | }}} |
| 70 | The number should match the result from the previous count. If it does, issue a "COMMIT;" command. |
| 71 | |
| 72 | == Managing Terminated or Fake Users == |
| 73 | As time permits, users who have no classes assigned in ZUAUSR are compared to what privileges are assigned in GURUCLS and ORACLE. If those users have no roles in Banner or ORACLE, they are set to terminated status. This may be done in the ZUAUSR forms, but would require work from another co-worker who happened to be managing the queue. Setting the termination status can be done easily by performing three update queries as zuausr@prod: |
| 74 | {{{ |
| 75 | INSERT INTO ztrusrd |
| 76 | (ztrusrd_user_acct_id, ztrusrd_class_type, |
| 77 | ztrusrd_class_name, ztrusrd_class_inst) |
| 78 | VALUES |
| 79 | ('idxxx','SUPER','EMPLOYEE_TERMINATE_CLS','PROD'); |
| 80 | |
| 81 | UPDATE ztbusrh |
| 82 | SET ztbusrh_term_flag = 'X' |
| 83 | WHERE ztbusrh_user_acct_id = 'idxxx'; |
| 84 | |
| 85 | UPDATE ztbusrh_load |
| 86 | SET ztbusrh_term_flag = 'X' |
| 87 | WHERE ztbusrh_user_acct_id = 'idxxx'; |
| 88 | |
| 89 | commit; |
| 90 | }}} |
| 91 | |
| 92 | At times, on TEST database instance or PREP database instance, fake users have been created that are not managed in both the ZTBUSRH_LOAD and ZTBUSRH table. These users may have Social Security Numbers of actual users who had been affiliated with UA at one time. Since no termination date is set and since they are not showing up as actual users, they linger in ZUAUSR. |
| 93 | |
| 94 | As a policy, we are removing these users from ZUAUSR. The following must be run as zuausr@prod. One may find them in only one table, but I list both below: |
| 95 | {{{ |
| 96 | DELETE ztbusrh |
| 97 | WHERE ztbusrh_user_acct_id = 'fakeid'; |
| 98 | |
| 99 | DELETE ztbusrh_load |
| 100 | WHERE ztbusrh_user_acct_id = 'fakeid'; |
| 101 | |
| 102 | commit; |
| 103 | }}} |
| 104 | |
| 105 | |