sp_audit

Allows a system security officer to configure auditing options.

Syntax

sp_audit option, login_name, object_name [,setting]

Or:

sp_audit ‘restart’

Parameters

Examples

Usage

  • sp_audit determines what is audited when auditing is enabled. No actual auditing takes place until you use sp_configure to set the auditing parameter to on. Then, all auditing options that have been configured with sp_audit take effect. For more information, see sp_configure.

  • If you are not the owner of the object being specified, qualify the object_name parameter value with the owner’s name, in the following format:
    "ownername.objname"
  • You cannot activate default auditing for the following options in the tempdb database:

    • delete

    • exec_procedure

    • exec_trigger

    • insert

    • select

    • update

  • The configuration parameters that control auditing are:

    • auditing – enables or disables auditing for the server.

    • audit queue size – establishes the size of the audit queue.

    • current audit table – sets the current audit table. The SAP ASE server writes all audit records to that table.

    • suspend auditing when full – controls the behavior of the audit process when an audit device becomes full.

    All auditing configuration parameters are dynamic and take effect immediately.

See also:
  • For more information about configuring the SAP ASE server for auditing, see sp_configure in the System Administration Guide.

  • bcp in the Utility Guide

Permissions

The permission checks for sp_audit differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be a user with manage auditing privilege.

Disabled

With granular permissions disabled, you must be a user with sso_role.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

Related reference
sp_configure
sp_addauditrecord