Sybase IQ具有一般的数据库审计功能,它提供的审计功能可以获得DDL(create table、index等)语句的信息,但是对于DML语句(insert、update、delete、select语句是不行的)。它提供的审计类型如下:
'all' enables all types of auditing.
'connect' enables auditing of both successful and failed connection attempts.
'connectFailed' enables auditing of failed connection attempts.
'DDL' enables auditing of DDL statements.
'options' enables auditing of public options.
'permission' enables auditing of permission checks, user checks, and SETUSER
statements.
'permissionDenied' enables auditing of failed permission and user checks.
'triggers' enables auditing after a trigger event.
下面是审计功能的设置和使用方法:
--1. 打开审计
SET OPTION PUBLIC.auditing = 'On';
CALL sa_enable_auditing_type('all');
--查看审计信息(下面两种方法可以只用一个)
dbtran -g -c "UID=DBA;PWD=sql" -n demo.sql --直接访问iq server
dbtran -g demo.log demo.sql --访问catalog transaction log file
--关闭审计
SET OPTION PUBLIC.auditing = 'Off';
CALL sa_disable_auditing_type( 'all' );
注意:使用审计功能会对性能有负面影响。并且会增加存放catlog db和其日志的文件系统空间。
阅读(4160) | 评论(0) | 转发(0) |