大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
在oracle11g中,数据库的审计功能是默认开启的(这和oracle10g的不一样,10g默认是关闭的),
创新互联专注于企业全网整合营销推广、网站重做改版、兖州网站定制设计、自适应品牌网站建设、html5、商城建设、集团公司官网建设、成都外贸网站建设公司、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为兖州等各大城市提供网站开发制作服务。
oracle11gr2的官方文档上写的是错的,当上说default是none,而且是审计到db级别的,这样就会
往aud$表里记录统计信息。
1.如果审计不是必须的,可以关掉审计功能;
sql
show
parameter
audit_trail;
name
type
value
------------------------------------
-----------
------------------------------
audit_trail
string
db
sql
alter
system
set
audit_trail=none
scope=spfile;
sql
shut
immediate;
sqlstartup
2.删除已有的审计信息
可以直接truncate表aud$,
truncate
table
sys.aud$;
3.或者将aud$表移到另外一个表空间下,以减少system表空间的压力和被撑爆的风险。
附:11g中有关audit_trail参数的设置说明:
audit_trail
property
description
parameter
type
string
syntax
audit_trail
=
{
none
|
os
|
db
[,
extended]
|
xml
[,
extended]
}
default
value
none
modifiable
no
basic
no
audit_trail
enables
or
disables
database
auditing.
values:
none
disables
standard
auditing.
this
value
is
the
default
if
the
audit_trail
parameter
was
not
set
in
the
initialization
parameter
file
or
if
you
created
the
database
using
a
method
other
than
database
configuration
assistant.
if
you
created
the
database
using
database
configuration
assistant,
then
the
default
is
db.
os
directs
all
audit
records
to
an
operating
system
file.
oracle
recommends
that
you
use
the
os
setting,
particularly
if
you
are
using
an
ultra-secure
database
configuration.
db
directs
audit
records
to
the
database
audit
trail
(the
sys.aud$
table),
except
for
records
that
are
always
written
to
the
operating
system
audit
trail.
use
this
setting
for
a
general
database
for
manageability.
if
the
database
was
started
in
read-only
mode
with
audit_trail
set
to
db,
then
oracle
database
internally
sets
audit_trail
to
os.
check
the
alert
log
for
details.
db,
extended
performs
all
actions
of
audit_trail=db,
and
also
populates
the
sql
bind
and
sql
text
clob-type
columns
of
the
sys.aud$
table,
when
available.
these
two
columns
are
populated
only
when
this
parameter
is
specified.
if
the
database
was
started
in
read-only
mode
with
audit_trail
set
to
db,
extended,
then
oracle
database
internally
sets
audit_trail
to
os.
check
the
alert
log
for
details.
xml
writes
to
the
operating
system
audit
record
file
in
xml
format.
records
all
elements
of
the
auditrecord
node
except
sql_text
and
sql_bind
to
the
operating
system
xml
audit
file.
xml,
extended
performs
all
actions
of
audit_trail=xml,
and
populates
the
sql
bind
and
sql
text
clob-type
columns
of
the
sys.aud$
table,
wherever
possible.
these
columns
are
populated
only
when
this
parameter
is
specified.
you
can
use
the
sql
audit
statement
to
set
auditing
options
regardless
of
the
setting
of
this
parameter.
您好,不知道你的数据库是什么?
Oracle的审计是放到AUD$表里面,需要sys权限。
查询审计:
select * from sys.aud$;
select returncode, action#, userid, userhost, terminal,timestamp from aud$。
SYS.AUD$ 是唯一保留审计结果的表。其它的都是视图。
STMT_AUDIT_OPTION_MAP 包含有关审计选项类型代码的信息由SQL.BSQ 脚本在CREATEDATABASE 的时候创建
AUDIT_ACTIONS 包含对审计跟踪动作类型代码的说明
ALL_DEF_AUDIT_OPTS 包含默认对象审计选项。当创建对象时将应用这些选项
DBA_STMT_AUDIT_OPTS 描述由用户设置的跨系统的当前系统审计选项
DBA_PRIV_AUDIT_OPTS 描述由用户正在审计的跨系统的当前系统权限
DBA_OBJ_AUDIT_OPTS 描述在所有对象上的审计选项
USER_OBJ_AUDIT_OPTS USER 视图描述当前用户拥有的所有对象上的审计选项
以下是审计记录
DBA_AUDIT_TRAIL 列出所有审计跟踪条目
USER_AUDIT_TRAIL USER视图显示与当前用户有关的审计跟踪条目
DBA_AUDIT_OBJECT 包含系统中所有对象的审计跟踪记录
USER_AUDIT_ OBJECT USER 视图列出一些审计跟踪记录而这些记录涉及当前用户可以访问的对象的语句
DBA_AUDIT_SESSION 列出涉及CONNECT 和DISCONNECT 的所有审计跟踪记录
USER_AUDIT_ SESSION USER视图列出涉及当前用户的CONNECT 和DISCONNECT 的所有审计跟踪记录
DBA_AUDIT_STATEMENT 列出涉及数据库全部的GRANT REVOKE AUDIT NOAUDIT 和ALTER SYSTEM 语句的审计跟踪记录
USER_ AUDIT_ STATEMENT 对于USER 视图来说这些语句应是用户发布的
DBA_AUDIT_EXISTS 列出BY AUDIT NOT EXISTS 产生的审计跟踪条目
下面的视图用于细粒度审计
DBA_AUDIT_POLICIES 显示系统上的所有审计策略
DBA_FGA_AUDIT_TRAIL 列出基于值的审计的审计跟踪记录。
sqlplus "/ as sysdba"
show parameter audit
alter system set audit_sys_operations=TRUE scope=spfile;
alter system set audit_trail=DB scope=spfile;
shutdown immediate;
startup force;
Oracle 11g起audit是自动开启的。我很烦这个审计开启,审计日志半个月10G,烦烦烦。我一把都关闭Oracle的审计功能,提高Oracle的空闲率。