Audit
Audit
Audit
Auditing is to perform to track the changes whatever done in the record. Its of two types:
* Field level auditing
* Record level auditing
1.
2.
3.
In the Audit group box, Field Add, Field Delete, Field Change are the available options
4.
5.
click OK.
Now you can perform some online transactions that affect the Record Field in question and check if auditing is working as desired; remember only the
audit options you have chosen in the record field properties will be captured.
Sample query:
Lets consider we are going to audit the EMPLID field in PS_JOB record.
SELECT * FROM PSAUDIT WHERE RECNAME = PS_JOB AND FIELDNAME=EMPLID
Record level auditing
As the name suggests, record level auditing is the auditing mechanism enforced on a record.
Setting up Steps:
1.
2.
Create the Audit Record - The Audit record is essentially a copy of the record being audited. The easiest way to create a copy of your
record is to do a Save As. Name the new record under standard record naming convention prefixed with AUDIT_
3.
4.
5.
Add Audit Fields Insert the below fields (also known as audit fields) at the top of the new record in the below order
AUDIT_OPRID (Captures the User who performed an action)
AUDIT_STAMP (Captures the date and time when the action was performed)
AUDIT_ACTN (Captures the type of action performed)
AUDIT_RECNAME (Captures the name of the audited record definition. This field is used only when the same audit record is used for auditing multiple
records)
1.
On the Record Field Properties for AUDIT_STAMP, we need to check the Auto-Update checkbox. This is essential to correctly populate the
date-time stamp.
2.
AUDIT_ACTN can take up any of the below values based on the type of the action performed.
A Row inserted
D Row deleted.
C Row changed (updated), but no key fields changed.
K Row changed (updated), and at least one key field changed.
N Row changed (updated), and at least one key field changed.
In case of C and K the system writes old values to the audit table. While for N, the new values are written into the audit table.
1.
2.
Open the Base Record that is to be audited. Open its properties. On the Use tab, under the Record Audit, specify the name of the audit
record that we just created as the Record Name. Choose Audit Options based on your requirement
Add An Audit table row is inserted when a row is inserted in the base record
Delete An Audit table row is inserted when a row is deleted from the base record
Change Audit table row(s) is inserted when a row changes in the base record
Selective Audit table row(s) is inserted when common field (present in both base record and audit record) changes
10. Based on the Audit option that you have chosen, perform some transaction that can trigger the audit. Now query the audit record and check for
new rows.
Record Level Audit vs Field Level Audit:
When you realize that you need to employ auditing in a certain situation, you have got to decide between Record level audit and field level
audit.
Record level auditing provides the option to chose from the delivered PSAUDIT record or a custom built audit record. But this is not the
case with Field level auditing; here PSAUDIT is your only option.
When you realize that you need to employ auditing in a certain situation, you have got to decide between Record level audit and field level
audit.
Based on the factors outlines above, it would be wise to choose Record level auditing when the situation demands the auditing of a number
of fields or a record as a whole. However, you always have another option in Field level audit when you are chasing just a filed or two.
Field Auditing
There are two types of delivered auditing in PeopleSoft:
Field level auditing tracks changes to one or more fields on a PeopleSoft record and stores the results in the
delivered PSAUDIT table.
Like record level auditing, field level auditing only applies to data updated through PeopleSoft and not directly through the database.
So auditing will not apply to data updated by SQL scripts, SQRs and COBOLs unless they are specifically designed to update the
audit table.
The project name (PROJECTNAME field) in KEY1 as this is the first (and only) key of
the PSPROJECTDEFN record.
Audit Records
If you are creating an audit record, there are normally three fields that need to go at the start of the audit record (remember to use
the AUDIT_ prefix as described in the record naming conventions). These three fields will uniquely identify your audit data. They
are (in the order they should be put on the audit record):
1.
AUDIT_OPRID
2.
AUDIT_STAMP
3.
AUDIT_ACTN
The audit stamp field is a date/time field. However in order for it to be correctly populated, make sure that you set it to Auto-Update
so that it is automatically set to the correct date/time stamp.
If you are using the same audit record for multiple records then add the field AUDIT_RECNAME. Ensure that this is system
maintained and this will tell you which record the audit action relates to.
PeopleTools ver 8.45
To audit an already exisiting PeopleSoft record, we need to create a record definition and SQL table in which we store audit information. When creating
the audit record, remove any attributes such as
PARENT records, Query Security Records, and PeopleCode. The easiest way to create an audit table is to open the record definition of the base record that
you wish to audit. Save it as a new record, prefaced with AUDIT_.
Remove the all edit and key attributes from the newly saved record. Also remove any attributes such as
PARENT records, Query Security Records, and PeopleCode. Add to the top of the audit record the following three special audit-specific fields in the same
order given below.
AUDIT_OPRID
AUDIT_STAMP
AUDIT_ACTN
AUDIT_RECNAME
In most cases you should include AUDIT_OPRID, AUDIT_STAMP, AUDIT_ACTN. The AUDIT_STAMP must be given the attribute AUTOUPDATE. You might
also add AUDIT_RECNAME if you are creating an audit table to audit more than one record definition.
Make these fields required and keys. Then build the table. Make sure you can query this table using sql editor.
AUDIT_OPRID Identifies the user who caused the system to trigger the auditseither by performing an add, change, or delete to an audited field.
AUDIT_STAMP Identifies the date and time the audit was triggered.
AUDIT_ACTN Indicates the type of action that the system audited. Possible actions include:
A: Row inserted.
D: Row deleted.
C: Row changed (updated), but no key fields changed. The system writes old values to the audit table.
K: Row changed (updated), and at least one key field changed. The system writes old values to the audit table.
N: Row changed (updated), and at least one key field changed. The system writes new values to the audit table.
AUDIT_RECNAME Identifies the name of the record definition that was audited.
The audit table does not have to include all the columns of the base table. In fact, for performance reasons, its best to only include those fields in your
audit record that are deemed
Open the record properties for the record you want to audit, Under the Record Audit, we have the following options
Audit Options following are the audit options to choose for auditing the record.
Add Inserts an audit table row whenever a new row is added to the table underlying this record definition.
Change Inserts one or two audit table rows whenever a row is changed on the table underlying this record definition.
Selective Inserts one or two audit table rows whenever a field that is also included in the record definition for the audit table is changed.
Delete Inserts an audit table row whenever a row is deleted from the table underlying this record definition.
Now perform online transactions on the audited table, query the audit table to know what is changed and who changed it at what time.
0
inShare
As PeopleSoft maintains critical enterprise data, having an audit trail on critical data is of paramount importance. This post will help
you setup Record Level Auditing in 7 simple steps.
Audit Fields
On the Record Field Properties for AUDIT_STAMP, we need to check the Auto-Update checkbox. This is essential to correctly
populate the date-time stamp.
AUDIT_ACTN can take up any of the below values based on the type of the action performed.
A Row inserted
D Row deleted.
C Row changed (updated), but no key fields changed.
Add An Audit table row is inserted when a row is inserted in the base record
Delete An Audit table row is inserted when a row is deleted from the base record
Change Audit table row(s) is inserted when a row changes in the base record
Selective Audit table row(s) is inserted when common field (present in both base record and audit record) changes
7. Test the Auditing
Based on the Audit option that you have chosen, perform some transaction that can trigger the audit. Now query the audit record
and check for new rows. Try to infer the meaning of each row that got added.
A delivered page to test this is the Department page. Navigate to Set Up Financials/Supply Chain > Common Definitions > Design
ChartFields > Department. Add a new value.
Hi Vera,
While migrating the project from dev to tst, click the Options button in the Copy Database dialog. This will take you to the Upgrade Options settings.
Here, on the General options tab, select the Set Target Audit Flags from Source option in the Audit Flags on Records settings.
In 9.1 we also have a delivered audit logging feature which can track most of the commonly used transaction tables.
Common Definitions> Audit Logging