audit drop table为什么不行
SQL> audit drop table;
audit drop table
ERROR at line 1:
ORA-00956: missing or invalid auditing option
SQL> audit table;
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
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
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
BTW, I just noticed one strange thing on my test DB (18.104.22.168.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?
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?
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/32939/viewspace-567198/，如需转载，请注明出处，否则将追究法律责任。