audit drop table为什么不行

audit drop table为什么不行

SQL> audit drop table;
audit drop table
      *
ERROR at line 1:
ORA-00956: missing or invalid auditing option


SQL> audit table;

Audit succeeded.


我看AUDIT_ACTIONS表中有drop table呀


刚看了一个帖子,也讲到这个事情。我的理解是这个帖子里只是说了这种情况,也没有给出原因。(英文的,看得比较吃力。如果理解有错,大佬给解释下)
帖子链接 http://www.dbasupport.com/forums/showthread.php?t=20054
这是我看到的主要的几个观点:

Yes u cannot audit DROP TABLE.This is because when you create a table you are the owner of the table and so you have all the priveleges.If you want to audit CREATE,DROP and other DDL commands write a database trigger on it.The database trigger works fine on Oracle 8.1.5 and higher versions.      这个说的是原因吗?实现这个功能可以用audit table(10.2.0.3),不知他的8.1.5不能吗

I think you performed those DROPs and CREATEs on user's own schema, that is why it seemed that the first two are not working while the last one is.

There is one odd thing with DROP TABLE and TRUNCATE TABLE statement auditing. You can't specify any of those two actions to be audited explicitely (ORA-956), like you can with CRATE TABLE. So you can't use "AUDIT DROP TABLE;" command. You can only set auditing for DROP and TRUNCATE by isuing "AUDIT TABLE;", which incorporates CREATE, TRUNCATE and DROP. So by setting "AUDIT TABLE;" audit trial will be created whenever someone isues CREATE TABLE, DROP TABLE or TRUNCATE TABLE statement.

BTW, I just noticed one strange thing on my test DB (8.1.7.1.2). AUDIT_TRIAL is set to TRUE. When I started auditing logins/logoffs by isuing "AUDIT SESSION", every new session has been audited immediately. But if I use any other auditing command (like "AUDIT TABLE;"), the table statements ussage was not audited until I restarted the database. After that everything went normal and audit trail has started to reflect the changes. I found this to be true for every auditing statement, except for AUDIT SESSION. I haven't found anything regarding this unusual behaviour in the documentation, so I think this is a bug. Can anyone else reproduce this?

提到了ORA-956


it's working now, I changed audit_trail=db to audit_trail=true and connected as sys with sysdba to audit the statements and works

I thought audit_trail has to be none, db or os?

我看有资料介绍true和db是一样的。我测试也是没区别的。不知道这位的works指的是什么

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/32939/viewspace-567198/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/32939/viewspace-567198/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值