
{"id":6999,"date":"2022-11-10T10:29:25","date_gmt":"2022-11-10T10:29:25","guid":{"rendered":"https:\/\/rax-stg-wp-aws.com\/blogs\/database-auditing-monitoring-and-securing-database\/"},"modified":"2026-11-03T19:27:26","modified_gmt":"2026-11-03T19:27:26","slug":"database-auditing-monitoring-and-securing-database","status":"publish","type":"blogs","link":"https:\/\/www.rackspace.com\/de\/blogs\/database-auditing-monitoring-and-securing-database\/","title":{"rendered":"Database Auditing: Monitoring and Securing Database"},"content":{"rendered":"<p>Database auditing monitors the activities occurring in a database. Oracle has functions that allow us to audit actions in the database and against the database.<\/p>\n<p>The Database auditing facility is an action-based process that runs SQL statements that meet a specific requirement.<\/p>\n<p><strong>Types of Auditing:<\/strong><\/p>\n<ol>\n<li>Schema object auditing<strong>:<\/strong>&nbsp;It allows us to specify schema objects to be audited.<\/li>\n<li>SQL statement auditing<strong>:<\/strong>&nbsp;It allows us to specify SQL statements to be audited.<\/li>\n<li>SQL privilege auditing<strong>:<\/strong>&nbsp;It allows us to specify system privileges to be audited.<\/li>\n<\/ol>\n<p><strong>Scope of Audit:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26060-body-technical-blog-database-auditing-image-1.png\" alt=\"technical-blog-database-auditing-image-1\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The audit facility allows you to specify the scope of audit actions as follows:<\/p>\n<ul>\n<li><strong>By user:<\/strong>&nbsp;This allows us to audit a certain user, by default it is all users.<\/li>\n<li><strong>Whenever Successful\/Whenever unsuccessful<\/strong>: This allows us to specify whether we want auditing to always occur or only whether the specific action was successful or unsuccessful. By default, it is BOTH.<\/li>\n<li><strong>By Session\/ By Access:<\/strong>&nbsp;This allows us to assign how frequently audit files are to be created. By default, it is by access.&nbsp;<em>A stream pool<\/em>&nbsp;is utilized to build a buffer for the data pump.<\/li>\n<\/ul>\n<p><strong>Limits of Auditing:<\/strong>&nbsp;Database auditing service works on the statement level only. It will record a scenario in case a specific user has run a select query against a particular table, but it is incapable of telling you which rows have been retrieved. This enables auditing to the database.<\/p>\n<p><strong>Implementing Auditing:<\/strong>&nbsp;Auditing can be activated by following steps:<\/p>\n<ul>\n<li>Enable auditing at the database level with the init.ora parameter (AUDIT_TRAIL).<\/li>\n<li>Enable the level of auditing through the audit SQL statement.<\/li>\n<\/ul>\n<p>The audit_trail parameter must be enabled for auditing to work. Available values are DB, NONE, and OS. Parameters can be as below:<\/p>\n<p><code>Audit_trail=true[audit_trail=db] or audit_trail=false[audit_trail=none] or audit_trail=os Audit_trail=db: <\/code><\/p>\n<p>This enables auditing to the internal data dictionary<\/p>\n<p><code>Audit_trail=os:<\/code>&nbsp;This enables auditing of the OS audit trail. When set to OS another parameter AUDIT_FILE_DEST must be set in the&nbsp;<code>init.ora<\/code>&nbsp;for dumping audit_trail files in the OS.&nbsp;<code>AUDIT_TRAIL=none<\/code>: This disables all auditing.<\/p>\n<p><strong>Note:<\/strong>&nbsp;DB bounce is not needed if you change the objects auditing. DB bounce is needed only if you switch off or on all auditing.<\/p>\n<p><strong>Audit trail views<\/strong>:<\/p>\n<p><code>Dba_audit_object, dba_audit_session, dba_audit_statement, dba_audit_trail, dba_object_audit_opts, dba_stmt_audit_opts, dba_priv_audit_opts, dba_audit_exists, audit_actions<\/code><\/p>\n<p><strong>Scenarios:<\/strong><\/p>\n<p>1. Statement Level Auditing:<\/p>\n<p>SYS &gt; audit create session whenever not successful.<br \/>\nSYS &gt; select user_name, audit_option, success,failure from dba_stmt_audit_opts;<br \/>\nSYS &gt; save dba_stmt_audit_opts<br \/>\nSYS &gt; select os_username, username, terminal, action_name, to_char(timestamp, \u2018dd\/mm\/yyyy:hh24:mi:ss\u2019) time_stamp from dba_audit_session;<br \/>\nSYS &gt; save dba_audit_sessions;<br \/>\nSYS &gt; audit table by U_SCOTT;<br \/>\nSYS &gt; @dba_stmt_audit_opts<br \/>\nSYS &gt; conn U_SCOTT\/U_SCOTT<br \/>\nU_SCOTT &gt; create table test (tno number);<br \/>\nSYS &gt; select os_username, username,owner,action_name,obj_name,to_char(timestamp, \u2018dd\/mm\/yyyy:hh24:mi:ss\u2019) as time_stamp from dba_audit_trail;<br \/>\nSYS &gt; save dba_audit_trail;<\/p>\n<p>2. Object Level Auditing:<\/p>\n<p>SYS &gt; audit select on u_scott.dept whenever successful;<br \/>\nSYS &gt; select owner,object_name,object_type,sel,upd,del from dba_obj_audit_opts where owner=\u2019U_SCOTT\u2019;<br \/>\nSYS &gt; save dba_obj_audit_opts<br \/>\nU_SCOTT &gt; select * from dept;<br \/>\nSYS &gt; @dba_audit_trail<br \/>\nSYS &gt; audit update on u_scott.emp by access whenever at unsuccessful;<br \/>\nSYS &gt; @dba_obj_audit_opts<br \/>\nU_SCOTT &gt; update emp set sal=6000 where empno=\u2019U_SCOTT\u2019;<br \/>\nU_SCOTT &gt; update emp set sal=7000 where empno=\u2019U_SCOTT\u2019;<br \/>\nU_SCOTT &gt; update emp set sal=8000 where empno=\u2019U_SCOTT\u2019;<br \/>\nSYS &gt; @dba_audit_trail<\/p>\n<p>3. Privilege Level Auditing:<\/p>\n<p>SYS &gt; audit create view by u_scott whenever successful;<br \/>\nSYS &gt; select user_name, privilege, success, failure from dba_priv_audit_opts;<br \/>\nSYS &gt; save dba_priv_audit_opts<br \/>\nu_scott &gt; create view v_test as select * from emp;&nbsp;<br \/>\nSYS &gt; @dba_audit_trail<\/p>\n<p>4. Disabling Audit:<\/p>\n<p>SYS &gt; @dba_stmt_audit_opts<br \/>\nSYS &gt; noaudit table by u_scott;<br \/>\nSYS &gt; @dba_stmt_audit_opts<br \/>\nSYS &gt; noaudit create session;<br \/>\nSYS &gt; noaudit create view by u_scott;<br \/>\nSYS &gt; @dba_stmt_audit_opts<br \/>\nSYS &gt; @dba_priv_audit_opts<br \/>\nIn DB level init.ora file remove parameter audit_trail=true<\/p>\n<p><strong>Fine-Grained Auditing:<\/strong>&nbsp;It is used for monitoring and accessing the data in the database based on the rules or SQL statements. There is an in-built process in the database that obstructs users from skipping the audit.<\/p>\n<p>It provides an expandable view in creating different policies to audit DML statements on objects like views and tables.<\/p>\n<p>Policies combined with the objects may also define appropriate columns so that any given statement type touching an applicable column is audited.<\/p>\n<p><strong>Note:<\/strong>&nbsp;AUDIT_TRAIL parameter is not needed to enable sys auditing or FGA.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Database Auditing: Monitoring and Securing Database<\/p>\n","protected":false},"author":2,"featured_media":7001,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"content-type":"","nid":"26060","content_type":"blog","created_by":"11255","authored_on":"2023-09-20T09:29:25+00:00","field_article_industries":"","tag_category":"Technical","field_blog_author_text":"by Rackspace Technology Staff","seo_description":"Understand the critical importance of database auditing in monitoring, securing, and ensuring data integrity and compliance.","field_featured_image":"","insights_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/26060-insights_image-database-technical-blog-1-insights.jpg","field_partners":"","rxt_platforms":"Relational Databases","product":"","publisheddate":"2022-11-10T10:29:25","rxt_solutions":"","opengraph_tag":"","x_tag":"","teaser_flag":"Technical Blog","seo_titile":"Database Auditing: Monitoring and Securing Database","field_topics":"","field_slug":"Database Auditing: Monitoring and Securing Database","footnotes":""},"categories":[178],"tags":[204],"class_list":["post-6999","blogs","type-blogs","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-technical"],"_links":{"self":[{"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs\/6999","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs"}],"about":[{"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/types\/blogs"}],"author":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/comments?post=6999"}],"version-history":[{"count":2,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs\/6999\/revisions"}],"predecessor-version":[{"id":8713,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs\/6999\/revisions\/8713"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/media\/7001"}],"wp:attachment":[{"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/media?parent=6999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/categories?post=6999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/tags?post=6999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}