OracleFGA fine-grained Audit

Source: Internet
Author: User

OracleFGA fine-grained Audit

If you want to audit the table, it is a good choice to use FGA for a certain period of time, persons and DML statements.

SQL> select * from v $ version;
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
PL/SQL Release 11.2.0.1.0-Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0-Production
NLSRTL Version 11.2.0.1.0-Production

SQL> exec DBMS_FGA.ADD_POLICY (object_schema => 'lcam _ test', object_name => 'test', policy_name => 'fga _ 1', enable => TRUE, statement_types => 'Update, delete', audit_trail => DBMS_FGA.DB + DBMS_FGA.EXTENDED, audit_column_opts => DBMS_FGA.ANY_COLUMNS );--

SQL> col SQL _TEXT format a80
SQL> select SQL _TEXT, TIMESTAMP from DBA_FGA_AUDIT_TRAIL order by TIMESTAMP;

SQL> update test set subobject_name = object_id where rownum = 1;
SQL> select SQL _TEXT, TIMESTAMP from DBA_FGA_AUDIT_TRAIL order by TIMESTAMP;
Update test set subobject_name = object_id where rownum = 1 month-12-14

SQL> update test set subobject_name = object_id where rownum <100;
SQL> select SQL _TEXT, TIMESTAMP from DBA_FGA_AUDIT_TRAIL order by TIMESTAMP;
Update test set subobject_name = object_id where rownum <100-14
Update test set subobject_name = object_id where rownum = 1 month-12-14

SQL> delete from sys. fga_log $;
SQL> commit;
SQL> select SQL _TEXT, TIMESTAMP from DBA_FGA_AUDIT_TRAIL order by TIMESTAMP;

SQL>

There are also ways to invalidate, activate, and delete audits:

Exec DBMS_FGA.DISABLE_POLICY (object_schema => 'lcam _ test', object_name => 'test', policy_name => 'fga _ 1 ');
Exec DBMS_FGA.ENABLE_POLICY (object_schema => 'lcam _ test', object_name => 'test', policy_name => 'fga _ 1 ');
Exec DBMS_FGA.DROP_POLICY (object_schema => 'lcam _ test', object_name => 'test', policy_name => 'fga _ 1 ');

The official document is located:

Oracle? Database PL/SQL Packages and Types Reference 11GRelease 2 (11.2) DBMS_FGA

Table 66-2 ADD_POLICY Procedure Parameters

Parameter Description Default Value

Object_schema

The schema of the object to be audited. (If NULL, the current log-on user schema is assumed .)

NULL

Object_name

The name of the object to be audited.

-

Policy_name

The unique name of the policy.

-

Audit_condition

A condition in a row that indicates a monitoring condition. NULL is allowed and acts as TRUE.

NULL

Audit_column

The columns to be checked for access. These can include OLS hidden columns or object type columns. The default, NULL, causes audit if any column is accessed or affected.

NULL

Handler_schema

The schema that contains the event handler. The default, NULL, causes the current schema to be used.

NULL

Handler_module

The function name of the event handler; Parameters des the package name if necessary. this function is invoked only after the first row that matches the audit condition in the query is processed. if the procedure fails with an exception, the user SQL statement will fail as well.

NULL

Enable

Enables the policy if TRUE, which is the default.

TRUE

Statement_types

The SQL statement types to which this policy is applicable: INSERT, UPDATE, DELETE, or SELECT only.

SELECT

Audit_trail

Destination (DB or XML) of fine grained audit records. Also specifies whether to populate LSQLTEXT and LSQLBIND in fga_log $.

DB + EXTENDED

Audit_column_opts

Establishes whether a statement is audited when the query referencesany column specified in the audit_column parameter or only when allsuch columns are referenced.

ANY_COLUMNS


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.