Oracle Database

Page 199

Using Triggers to Record Customized Standard Auditing Information

destinations that the syslog utility can access. To find more information about these types of tags, refer to the syslog utility MAN page. ■

priority: Defines the severity of the message. Accepted values are notice, info, debug, warning, err, crit, alert, and emerg.

The syslog daemon compares the value assigned to the facility argument of the AUDIT_SYSLOG_LEVEL parameter with the syslog.conf file to determine where to log information. For example, the following statement identifies the facility as local1 with a priority level of warning: AUDIT_SYSLOG_LEVEL=local1.warning

See Oracle Database Reference for more information about AUDIT_SYSLOG_LEVEL. 3.

Add the audit file destination to the syslog configuration file /etc/syslog.conf. For example, assuming you had set the AUDIT_SYSLOG_LEVEL to local1.warning, enter the following: local1.warning /var/log/audit.log

This setting logs all warning messages to the /var/log/audit.log file. 4.

Restart the syslog logger: $/etc/rc.d/init.d/syslog restart

Now, all audit records will be captured in the file /var/log/audit.log through the syslog daemon. 5.

Restart the database instance: CONNECT SYS / AS SYSOPER Enter password: password Connected. SQL> SHUTDOWN; Database closed. Database dismounted. ORACLE instance shut down. SQL> STARTUP; ORACLE instance started.

Using Triggers to Record Customized Standard Auditing Information You can often use triggers to record additional customized information that is not automatically included in audit records, thereby customizing your own audit conditions and record contents. For example, you could define a trigger on the employee_salaries table to generate an audit record whenever the salary of an employee is increased by more than 10 percent. You can include selected information, such as the values of salary before and after it was changed. Example 6–13 shows a trigger used to record customized audit information. Example 6–13 Using a Trigger to Record Customized Audit Information CREATE TRIGGER audit_emp_salaries AFTER INSERT OR DELETE OR UPDATE ON employee_salaries for each row begin

Configuring Auditing 6-37


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.