Auditing stored procedures

When auditing the execution of a stored procedure, if that procedure is created with execute as owner or execute as caller, the information is written to position 2 of the extrainfo section of the audit record. In section 5 of the extrainfo section, the user name is written as either the owner or the grantee, which ever applies.

The following is an example of an extrainfo column that is owned by the database owner, executed by user Joe, and is created with execute as caller :

; EXECUTE AS CALLER; ; ; procedure caller = joe ; ; ;

The following is an example of an extrainfo column for a procedure that is owned by Billy and created with execute as owner:

; EXECUTE AS OWNER; ; ; procedure owner = billy ; ; ;