<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Archives des Unified Auditing - dbi Blog</title>
	<atom:link href="https://www.dbi-services.com/blog/tag/unified-auditing/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbi-services.com/blog/tag/unified-auditing/</link>
	<description></description>
	<lastBuildDate>Tue, 02 Jul 2024 11:35:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2025/05/cropped-favicon_512x512px-min-32x32.png</url>
	<title>Archives des Unified Auditing - dbi Blog</title>
	<link>https://www.dbi-services.com/blog/tag/unified-auditing/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Cleanup Audit Trail &#8211; the Full Picture</title>
		<link>https://www.dbi-services.com/blog/cleanup-audit-trail-the-full-picture/</link>
					<comments>https://www.dbi-services.com/blog/cleanup-audit-trail-the-full-picture/#respond</comments>
		
		<dc:creator><![CDATA[Oracle Team]]></dc:creator>
		<pubDate>Tue, 02 Jul 2024 17:30:00 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Database management]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[AUD$]]></category>
		<category><![CDATA[audit]]></category>
		<category><![CDATA[Unified Auditing]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=33833</guid>

					<description><![CDATA[<p>Oracle Database 23ai introduces several enhancements to unified auditing, focused on flexibility, and effectiveness. Some of the new key features are: Desupport of Traditional Auditing: Traditional auditing is desupported in Oracle 23ai, which means all auditing must now be done using unified auditing. Unified auditing consolidates audit records into a single, secure trail and supports [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/cleanup-audit-trail-the-full-picture/">Cleanup Audit Trail &#8211; the Full Picture</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Oracle Database 23ai introduces several enhancements to unified auditing, focused on flexibility, and effectiveness. Some of the new key features are:</p>



<p class="wp-block-paragraph"><strong>Desupport of Traditional Auditing</strong>: Traditional auditing is desupported in Oracle 23ai, which means all auditing must now be done using unified auditing. Unified auditing consolidates audit records into a single, secure trail and supports conditional policies for selective auditing.</p>



<p class="wp-block-paragraph"><strong>Column-Level Audit Policies</strong>: One of the most notable features is the ability to create audit policies on individual columns of tables and views. This granularity control allows organizations to focus their audit efforts on the most sensitive data elements, reducing the volume of audit data and enhancing security by targeting specific actions like SELECT, INSERT, UPDATE, or DELETE on specified columns​. It can be implemented like:</p>



<pre class="wp-block-code"><code>conn / as sysdba
noaudit policy test_audit_policy;
drop audit policy test_audit_policy;
create audit policy test_audit_policy
	actions update(col1, col2) on userx.audit_test_tab,
	select(col2) on userx.audit_test_tab
	container = current;
audit policy test_audit_policy;
</code></pre>



<p class="wp-block-paragraph"><strong>Enhanced Integration with IAM and Cloud Services</strong>: Oracle 23ai includes improved authentication and authorization capabilities for IAM users, supporting Azure AD OAuth2 tokens and allowing seamless integration with Oracle Autonomous Database on Dedicated Exadata Infrastructure.</p>



<p class="wp-block-paragraph"><strong>New Cryptographic Algorithms and Security Enhancements</strong>: The release includes support for new cryptographic algorithms such as SM2, SM3, SM4, and SHA-3, along with enhancements to the <code>DBMS_CRYPTO</code> package and <code>orapki</code> utility.</p>



<p class="wp-block-paragraph"><strong>Consolidation of FIPS 140 Parameter</strong>: Oracle 23c introduces a unified <code>FIPS_140</code> parameter for configuring FIPS across various database environments, including Transparent Data Encryption (TDE) and network encryption, streamlining the compliance process and improving security management​.</p>



<h2 class="wp-block-heading" id="h-cleanup-of-audit-trail"><strong>Cleanup of audit trail</strong></h2>



<p class="wp-block-paragraph">Also for the reason that unified audit is now standard, I would like to summarize the management and cleanup of the audit trail in detail here:</p>



<p class="wp-block-paragraph">First of all you should check the size of the existing audit tables (AUD$ and FGA_LOG$), create a new audit-tablespace for the audit tables:</p>



<pre class="wp-block-code"><code>set lin 999
set pages 999
col tablespace_name for a30
col segment_name for a30
col owner for a20
select owner, segment_name, tablespace_name, bytes/1024/1024 MB 
from dba_segments 
where segment_name in ('AUD$', 'FGA_LOG$');
-- create audit tablespace
create tablespace audit_ts;
select file_name, file_id, tablespace_name, autoextensible, maxbytes/1024/1024/1024 GB 
from dba_data_files 
where tablespace_name like 'AUD$';
-- alter database datafile … autoextend on next 100M maxsize 1G;
-- eventually create an audit history table for further use
create table AUD_HIST tablespace audit_ts as select * from AUD$;
-- truncate table sys.aud$;
</code></pre>



<p class="wp-block-paragraph">Now you can move the audit tables from sysaux to the audit-tablespace:</p>



<pre class="wp-block-code"><code>--move AUD$
BEGIN
DBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION(
audit_trail_type =&gt; DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,
audit_trail_location_value =&gt; 'AUDIT_TS');
END;
/
--move FGA_LOG$
BEGIN
DBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION(
audit_trail_type =&gt; DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD,
audit_trail_location_value =&gt; 'AUDIT_TS');
END;
/
--moving additional audit tables
alter table FGACOL$ move tablespace AUDIT_TS;
</code></pre>



<p class="wp-block-paragraph">Short check of audit-parameters:</p>



<pre class="wp-block-code"><code>-- check audit parameters
col parameter_name for a30
col parameter_value for a20
col audit_trail for a20
show parameter audit
SELECT * FROM dba_audit_mgmt_config_params;
</code></pre>



<p class="wp-block-paragraph">Before starting any cleanup you should be sure that no old jobs exist:</p>



<pre class="wp-block-code"><code>-- deinit all purge jobs
exec dbms_audit_mgmt.deinit_cleanup( dbms_audit_mgmt.audit_trail_all );
exec dbms_audit_mgmt.deinit_cleanup( dbms_audit_mgmt.audit_trail_os );
exec dbms_audit_mgmt.deinit_cleanup( dbms_audit_mgmt.audit_trail_xml );
exec dbms_audit_mgmt.deinit_cleanup( dbms_audit_mgmt.audit_trail_aud_std );
exec dbms_audit_mgmt.deinit_cleanup( dbms_audit_mgmt.audit_trail_fga_std )
</code></pre>



<p class="wp-block-paragraph">Now you can set up an audit-management, e.g. every 24 hours, which purges audit-entries older than 7 months:</p>



<pre class="wp-block-code"><code>-- init cleanup for 24 hours
exec DBMS_AUDIT_MGMT.INIT_CLEANUP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_all, 24 );
-- set retention (last_archive_timestamp, sysdate -210 days) =7 months
exec dbms_audit_mgmt.set_last_archive_timestamp( dbms_audit_mgmt.AUDIT_TRAIL_AUD_STD, to_timestamp(sysdate-210));
exec dbms_audit_mgmt.set_last_archive_timestamp( dbms_audit_mgmt.AUDIT_TRAIL_FGA_STD, to_timestamp(sysdate-210));
exec DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( dbms_audit_mgmt.audit_trail_unified, sysdate-210);
-- 1 means RAC-node 1
exec dbms_audit_mgmt.set_last_archive_timestamp( dbms_audit_mgmt.AUDIT_TRAIL_OS, to_timestamp(sysdate-210), 1);
exec dbms_audit_mgmt.set_last_archive_timestamp( dbms_audit_mgmt.AUDIT_TRAIL_XML, to_timestamp(sysdate-210), 1);
</code></pre>



<p class="wp-block-paragraph">Short check of parameter settings:</p>



<pre class="wp-block-code"><code>-- getting parameters
COLUMN parameter_name FORMAT A30
COLUMN parameter_value FORMAT A20
COLUMN audit_trail FORMAT A20
col days_back  for 9999  head "days|back"
select audit_trail, rac_instance, last_archive_ts, extract(day from(systimestamp-last_archive_ts))days_back from DBA_AUDIT_MGMT_LAST_ARCH_TS;
</code></pre>



<p class="wp-block-paragraph">Now you can set up and initiate the purge-jobs:</p>



<pre class="wp-block-code"><code>-- creating purge job for all audit trails
BEGIN 
dbms_audit_mgmt.create_purge_job(
audit_trail_type =&gt; dbms_audit_mgmt.audit_trail_all,
audit_trail_purge_interval =&gt; 24  /* hours */,
audit_trail_purge_name =&gt; 'DAILY_AUDIT_PURGE',
use_last_arch_timestamp =&gt; TRUE);
END;
/
-- create job for automatic updating last_archive_timestamp
create or replace procedure AUDIT_UPDATE_RETENTION( m_purge_retention  IN  number  DEFAULT 210
) AS
BEGIN
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, TO_TIMESTAMP(SYSDATE-m_purge_retention));
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, TO_TIMESTAMP(SYSDATE-m_purge_retention));
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD, TO_TIMESTAMP(SYSDATE-m_purge_retention));
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED, TO_TIMESTAMP(SYSDATE-m_purge_retention));
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_OS, TO_TIMESTAMP(SYSDATE-m_purge_retention), 1);
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_XML, TO_TIMESTAMP(SYSDATE-m_purge_retention), 1);
END;
/
</code></pre>



<p class="wp-block-paragraph">You can test it now:</p>



<pre class="wp-block-code"><code>-- test run
exec audit_update_retention(210);
</code></pre>



<p class="wp-block-paragraph">Before we invoke the new job, we get sure that no old bodies are left:</p>



<pre class="wp-block-code"><code>-- drop job if exists
set serveroutput on
begin
dbms_scheduler.drop_job(job_name =&gt; 'DAILY_AUDIT_UPDATE_RETENTION');
end;
/
-- create job for last_archive_timestamp
set serveroutput on
declare
m_purge_retention number DEFAULT 210;
ex_job_doesnt_exist EXCEPTION;
PRAGMA EXCEPTION_INIT(ex_job_doesnt_exist, -27475);
begin
--dbms_scheduler.drop_job(job_name =&gt; 'DAILY_AUDIT_UPDATE_RETENTION');
--dbms_output.put_line(chr(13)||'= 60;
DBMS_SCHEDULER.create_job (
job_name =&gt; 'DAILY_AUDIT_UPDATE_RETENTION',
job_type =&gt; 'PLSQL_BLOCK',
job_action =&gt; 'BEGIN
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, TO_TIMESTAMP(SYSDATE-m_purge_retention));
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, TO_TIMESTAMP(SYSDATE-m_purge_retention));
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD, TO_TIMESTAMP(SYSDATE-m_purge_retention));
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED, TO_TIMESTAMP(SYSDATE-m_purge_retention));
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_OS, TO_TIMESTAMP(SYSDATE-m_purge_retention), 1);
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( DBMS_AUDIT_MGMT.AUDIT_TRAIL_XML, TO_TIMESTAMP(SYSDATE-m_purge_retention), 1);
END;', 
start_date =&gt; SYSTIMESTAMP, 
repeat_interval =&gt; 'freq=daily; byhour=0; byminute=0; bysecond=0;', 
end_date =&gt; NULL, 
enabled =&gt; TRUE, 
auto_drop =&gt; FALSE, 
comments =&gt; 'every day, update last_archive_timestamp (which DAILY_AUDIT_PURGE uses) to '||m_purge_retention||' days back.'
);
--Exception
--when ex_must_be_declared then
--dbms_output.put_line('DAILY_AUDIT_UPDATE_RETENTION: component missing?'||chr(13));
END;
/
</code></pre>



<p class="wp-block-paragraph">An other option would be to start the jon manually or to purge the audit-trail on demand:</p>



<pre class="wp-block-code"><code>-- manual start of purge jobs
select distinct job_name, owner from dba_scheduler_jobs;
exec dbms_scheduler.run_job('DAILY_AUDIT_UPDATE_RETENTION',use_current_session=&gt;false);
exec dbms_scheduler.run_job('audsys.DAILY_AUDIT_PURGE',use_current_session=&gt;false);
-- other options
exec DBMS_AUDIT_MGMT.FLUSH_UNIFIED_AUDIT_TRAIL;
-- or
begin
DBMS_AUDIT_MGMT.FLUSH_UNIFIED_AUDIT_TRAIL;
for i in 1..10 loop
DBMS_AUDIT_MGMT.TRANSFER_UNIFIED_AUDIT_RECORDS;
end loop;
end;
/
begin
DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL(
audit_trail_type =&gt; DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED,
use_last_arch_timestamp =&gt; FALSE);
end;
/
</code></pre>



<h2 class="wp-block-heading" id="h-sources-links-and-related-blogs">Sources, links and related blogs:</h2>



<p class="wp-block-paragraph"><a href="https://support.oracle.com/knowledge/Oracle%20Database%20Products/2904294_1.html">https://support.oracle.com/knowledge/Oracle%20Database%20Products/2904294_1.html</a></p>



<p class="wp-block-paragraph"><a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/AUDIT-Unified-Auditing.html">https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/AUDIT-Unified-Auditing.html</a></p>



<p class="wp-block-paragraph"><a href="https://oracle-base.com/articles/23/auditing-enhancements-23">https://oracle-base.com/articles/23/auditing-enhancements-23</a></p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-embed is-type-wp-embed is-provider-dbi-blog wp-block-embed-dbi-blog"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="X5dWIytpr2"><a href="https://www.dbi-services.com/blog/purging-unified-audit-trail-in-12cr2/">Purging Unified Audit Trail in 12cR2</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Purging Unified Audit Trail in 12cR2&#8221; &#8212; dbi Blog" src="https://www.dbi-services.com/blog/purging-unified-audit-trail-in-12cr2/embed/#?secret=sKzMAbliRo#?secret=X5dWIytpr2" data-secret="X5dWIytpr2" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<figure class="wp-block-embed is-type-wp-embed is-provider-dbi-blog wp-block-embed-dbi-blog"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="3NmvxFyHE0"><a href="https://www.dbi-services.com/blog/from-oracle-standard-auditing-to-oracle-unified-auditing/">From Oracle Standard Auditing to Oracle Unified Auditing</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;From Oracle Standard Auditing to Oracle Unified Auditing&#8221; &#8212; dbi Blog" src="https://www.dbi-services.com/blog/from-oracle-standard-auditing-to-oracle-unified-auditing/embed/#?secret=AQSsnN5rAM#?secret=3NmvxFyHE0" data-secret="3NmvxFyHE0" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<figure class="wp-block-embed is-type-wp-embed is-provider-dbi-blog wp-block-embed-dbi-blog"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="DfYuHM0vIv"><a href="https://www.dbi-services.com/blog/upgrade-to-oracle-19c-performance-issue/">Upgrade to Oracle 19c &#8211; performance issue</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Upgrade to Oracle 19c &#8211; performance issue&#8221; &#8212; dbi Blog" src="https://www.dbi-services.com/blog/upgrade-to-oracle-19c-performance-issue/embed/#?secret=18qEZivpot#?secret=DfYuHM0vIv" data-secret="DfYuHM0vIv" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>
<p>L’article <a href="https://www.dbi-services.com/blog/cleanup-audit-trail-the-full-picture/">Cleanup Audit Trail &#8211; the Full Picture</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/cleanup-audit-trail-the-full-picture/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>From Oracle Standard Auditing to Oracle Unified Auditing</title>
		<link>https://www.dbi-services.com/blog/from-oracle-standard-auditing-to-oracle-unified-auditing/</link>
					<comments>https://www.dbi-services.com/blog/from-oracle-standard-auditing-to-oracle-unified-auditing/#respond</comments>
		
		<dc:creator><![CDATA[Oracle Team]]></dc:creator>
		<pubDate>Tue, 05 Oct 2021 12:39:59 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Database management]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Auditing]]></category>
		<category><![CDATA[DBD::Oracle]]></category>
		<category><![CDATA[oracle security]]></category>
		<category><![CDATA[Unified Auditing]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/from-oracle-standard-auditing-to-oracle-unified-auditing/</guid>

					<description><![CDATA[<p>In this post, I will not show you all advantages related to Oracle Unified Auditing. For that, read the oracle documentation. You can also read the blogs written by my colleagues : Oracle 12c Unified Auditing Feature in a multitenant environment Oracle 12c &#8211; RMAN and Unified Auditing &#8211; Does it really work ? Purging [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/from-oracle-standard-auditing-to-oracle-unified-auditing/">From Oracle Standard Auditing to Oracle Unified Auditing</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this post, I will not show you all advantages related to Oracle Unified Auditing. For that, read the <a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/introduction-to-auditing.html#GUID-8D96829C-9151-4FA4-BED9-831D088F12FF">oracle documentation.</a></p>
<p>You can also read the blogs written by my colleagues :</p>
<ul>
<li><a href="https://www.dbi-services.com/blog/oracle-12c-unified-auditing-feature-in-a-multitenant-environment/">Oracle 12c Unified Auditing Feature in a multitenant environment</a></li>
<li><a href="https://www.dbi-services.com/blog/oracle-12c-rman-and-unified-auditing-does-it-really-work/">Oracle 12c &#8211; RMAN and Unified Auditing &#8211; Does it really work ?</a></li>
<li><a href="https://www.dbi-services.com/blog/purging-unified-audit-trail-in-12cr2/">Purging Unified Audit Trail in 12cR2</a></li>
</ul>
<p>I just want to share with you the steps needed to move from Standard Auditing to Unified Auditing in a mutlitenant environment.</p>
<p>Steps 1 : Check if Unified Auditing is disabled</p>
<pre class="brush: sql; gutter: true; first-line: 1">oracle@*****:/u01/app/oracle/product/rdbms19_1/rdbms/lib/ [MYCDB] sqh
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 4 10:45:35 2021
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL&gt; SELECT value FROM v$option WHERE parameter = 'Unified Auditing';

VALUE
----------------------------------------------------------------
FALSE
</pre>
<p>&nbsp;</p>
<p><em>FALSE</em> means unified audit trail and audit policy functionality is enabled in mixed mode</p>
<p>Step 2 : As we want to disabled Standard Auditing and enabled Unifed Auditing, let&#8217;s check the <em>audit_file_dest</em> parameter</p>
<pre class="brush: sql; gutter: true; first-line: 1">SQL&gt; sho parameter audit_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /u01/app/oracle/admin/xxxx/adump
</pre>
<p>Step 4 : Let&#8217;s check the folder <em>/u01/app/oracle/admin/xxxx/adump</em></p>
<pre class="brush: shell; gutter: true; first-line: 1">ls -ltr /u01/app/oracle/admin/CSYR01I/adump
...
-rw-r-----. 1 oracle dba     1090 Oct  4 10:55 MYCDB_m001_19948_202105041945FHDFJDHF888912.aud
-rw-r-----. 1 oracle dba     1090 Oct  4 10:55 MYCDB_m001_19948_202FàDéFàDéDFéàD0527767763.aud
-rw-r-----. 1 oracle dba     1090 oct  4 10:55 MYCDB_m001_19948_20210504FHDJFHDJHFD9851253.aud
-rw-r-----. 1 oracle dba     1090 Oct  4 10:55 MYCDB_m001_19948_202105041FLDKFLDKDL4960612.aud
-rw-r-----. 1 oracle dba    40985 Oct  4 10:56 MYCDB_m003_20296_2021050FDJFDKJD54384117793.aud
-rw-r-----. 1 oracle dba     2504 Oct  4 10:59 MYCDB_ora_32211_202105041FKDJFDDKJFD9350382.aud
</pre>
<p>&nbsp;</p>
<p>Step 5 : Stop all listeners and databases sharing the ORACLE_HOME</p>
<pre class="brush: sql; gutter: true; first-line: 1">oracle@xxxxxxxxx:/u01/app/oracle/product/rdbms19_1/rdbms/lib/ [MYCDB] lsnrctl stop LISTENER
oracle@xxxxxxxxx:/u01/app/oracle/product/rdbms19_1/rdbms/lib/ [MYCDB] sqh
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 04 14:11:37 2021
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL&gt; shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
</pre>
<p>&nbsp;</p>
<p>Step 6 : To enable the Unified Auditng, we have to relink the file $ORACLE_HOME/rdbms/lib/ins_rdbms.mk</p>
<pre class="brush: sql; gutter: true; first-line: 1">oracle@xxxxxx:/u01/app/oracle/product/rdbms19_1/rdbms/lib/ [MYCDB] make -f ins_rdbms.mk uniaud_on ioracle ORACLE_HOME=$ORACLE_HOME
/usr/bin/ar d /u01/app/oracle/product/rdbms19_1/rdbms/lib/libknlopt.a kzanang.o
/usr/bin/ar cr /u01/app/oracle/product/rdbms19_1/rdbms/lib/libknlopt.a /u01/app/oracle/product/rdbms19_1/rdbms/lib/kzaiang.o
chmod 755 /u01/app/oracle/product/rdbms19_1/bin
- Linking Oracle
rm -f /u01/app/oracle/product/rdbms19_1/rdbms/lib/oracle
/u01/app/oracle/product/rdbms19_1/bin/orald -o /u01/app/oracle/product/rdbms19_1/rdbms/lib/oracle -m64 -z noexecstack -Wl,--disable-new-dtags -L/u01/app/oracle/product/rdbms19_1/rdbms/lib/ -L/u01/app/oracle/product/rdbms19_1/lib/ -L/u01/app/oracle/product/rdbms19_1/lib/stubs/ -Wl,-E /u01/app/oracle/product/rdbms19_1/rdbms/lib/opimai.o /u01/app/oracle/product/rdbms19_1/rdbms/lib/ssoraed.o /u01/app/oracle/product/rdbms19_1/rdbms/lib/ttcsoi.o -Wl,--whole-archive -lperfsrv19 -Wl,--no-whole-archive /u01/app/oracle/product/rdbms19_1/lib/nautab.o /u01/app/oracle/product/rdbms19_1/lib/naeet.o /u01/app/oracle/product/rdbms19_1/lib/naect.o /u01/app/oracle/product/rdbms19_1/lib/naedhs.o /u01/app/oracle/product/rdbms19_1/rdbms/lib/config.o -ldmext -lserver19 -lodm19 -lofs -lcell19 -lnnet19 -lskgxp19 -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lxml19 -lcore19 -lunls19 -lsnls19 -lnls19 -lcore19 -lnls19 -lclient19 -lvsnst19 -lcommon19 -lgeneric19 -lknlopt -loraolap19 -lskjcx19 -lslax19 -lpls19 -lrt -lplp19 -ldmext -lserver19 -lclient19 -lvsnst19 -lcommon19 -lgeneric19 `if [ -f /u01/app/oracle/product/rdbms19_1/lib/libavserver19.a ] ; then echo "-lavserver19" ; else echo "-lavstub19"; fi` `if [ -f /u01/app/oracle/product/rdbms19_1/lib/libavclient19.a ] ; then echo "-lavclient19" ; fi` -lknlopt -lslax19 -lpls19 -lrt -lplp19 -ljavavm19 -lserver19 -lwwg `cat /u01/app/oracle/product/rdbms19_1/lib/ldflags` -lncrypt19 -lnsgr19 -lnzjs19 -ln19 -lnl19 -lngsmshd19 -lnro19 `cat /u01/app/oracle/product/rdbms19_1/lib/ldflags` -lncrypt19 -lnsgr19 -lnzjs19 -ln19 -lnl19 -lngsmshd19 -lnnzst19 -lzt19 -lztkg19 -lmm -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lxml19 -lcore19 -lunls19 -lsnls19 -lnls19 -lcore19 -lnls19 -lztkg19 `cat /u01/app/oracle/product/rdbms19_1/lib/ldflags` -lncrypt19 -lnsgr19 -lnzjs19 -ln19 -lnl19 -lngsmshd19 -lnro19 `cat /u01/app/oracle/product/rdbms19_1/lib/ldflags` -lncrypt19 -lnsgr19 -lnzjs19 -ln19 -lnl19 -lngsmshd19 -lnnzst19 -lzt19 -lztkg19 -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lxml19 -lcore19 -lunls19 -lsnls19 -lnls19 -lcore19 -lnls19 `if /usr/bin/ar tv /u01/app/oracle/product/rdbms19_1/rdbms/lib/libknlopt.a | grep "kxmnsd.o" &gt; /dev/null 2&gt;&amp;1 ; then echo " " ; else echo "-lordsdo19 -lserver19"; fi` -L/u01/app/oracle/product/rdbms19_1/ctx/lib/ -lctxc19 -lctx19 -lzx19 -lgx19 -lctx19 -lzx19 -lgx19 -lclscest19 -loevm -lclsra19 -ldbcfg19 -lhasgen19 -lskgxn2 -lnnzst19 -lzt19 -lxml19 -lgeneric19 -locr19 -locrb19 -locrutl19 -lhasgen19 -lskgxn2 -lnnzst19 -lzt19 -lxml19 -lgeneric19 -lgeneric19 -lorazip -loraz -llzopro5 -lorabz2 -lorazstd -loralz4 -lipp_z -lipp_bz2 -lippdc -lipps -lippcore -lippcp -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lxml19 -lcore19 -lunls19 -lsnls19 -lnls19 -lcore19 -lnls19 -lsnls19 -lunls19 -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lcore19 -lsnls19 -lnls19 -lxml19 -lcore19 -lunls19 -lsnls19 -lnls19 -lcore19 -lnls19 -lasmclnt19 -lcommon19 -lcore19 -ledtn19 -laio -lons -lmql1 -lipc1 -lfthread19 `cat /u01/app/oracle/product/rdbms19_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/rdbms19_1/lib -lm `cat /u01/app/oracle/product/rdbms19_1/lib/sysliblist` -ldl -lm -L/u01/app/oracle/product/rdbms19_1/lib `test -x /usr/bin/hugeedit -a -r /usr/lib64/libhugetlbfs.so &amp;&amp; test -r /u01/app/oracle/product/rdbms19_1/rdbms/lib/shugetlbfs.o &amp;&amp; echo -Wl,-zcommon-page-size=2097152 -Wl,-zmax-page-size=2097152 -lhugetlbfs`
rm -f /u01/app/oracle/product/rdbms19_1/bin/oracle
mv /u01/app/oracle/product/rdbms19_1/rdbms/lib/oracle /u01/app/oracle/product/rdbms19_1/bin/oracle
chmod 6751 /u01/app/oracle/product/rdbms19_1/bin/oracle
(if [ ! -f /u01/app/oracle/product/rdbms19_1/bin/crsd.bin ]; then \
getcrshome="/u01/app/oracle/product/rdbms19_1/srvm/admin/getcrshome" ; \
if [ -f "$getcrshome" ]; then \
crshome="`$getcrshome`"; \
if [ -n "$crshome" ]; then \
if [ $crshome != /u01/app/oracle/product/rdbms19_1 ]; then \
oracle="/u01/app/oracle/product/rdbms19_1/bin/oracle"; \
$crshome/bin/setasmgidwrap oracle_binary_path=$oracle; \
fi \
fi \
fi \
fi\
);
</pre>
<p>&nbsp;</p>
<p>Step 7 : Restart the listener and the databases and check if Unified Auditing is enabled from the container database (CDB) and from the pluggable databases (PDB)</p>
<pre class="brush: sql; gutter: true; first-line: 1">Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0
oracle@xxxxxx:/u01/app/oracle/product/rdbms19_1/rdbms/lib/ [MYCDB] sqh
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 04 14:26:04 2021
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL&gt; select value from v$option where lower(parameter)='unified auditing';

VALUE
----------------------------------------------------------------
TRUE

SQL&gt; alter session set container=MYPDB;

Session altered.

SQL&gt; select value from v$option where lower(parameter)='unified auditing';

VALUE
----------------------------------------------------------------
TRUE
</pre>
<p>Now we have Unified Pure Auditing without traditional auditing, than means that AUDIT* spfile parameters are no more taking account and the *.aud files are no more generated.</p>
<p>&nbsp;</p>
<p>Step 8 : Set the last archive timestamp for audit records stored into the table unified_audit_trail (below we remove all rows with timestamp &gt; 5 days)</p>
<pre class="brush: sql; gutter: true; first-line: 1">BEGIN
     DBMS_AUDIT_MGMT.set_last_archive_timestamp(
    audit_trail_type     =&gt; DBMS_AUDIT_MGMT.audit_trail_unified,
    last_archive_time    =&gt; SYSTIMESTAMP-5,
    --rac_instance_number  =&gt;  1,
    container            =&gt; DBMS_AUDIT_MGMT.container_current
  );
 END;
/

PL/SQL procedure successfully completed.

COLUMN audit_trail FORMAT A20
COLUMN last_archive_ts FORMAT A40
SELECT audit_trail,
       last_archive_ts
  FROM   dba_audit_mgmt_last_arch_ts;

AUDIT_TRAIL          LAST_ARCHIVE_TS
-------------------- ----------------------------------------
UNIFIED AUDIT TRAIL  04-OCT-21 15.24.32.000000 PM +00:00</pre>
<p>Step 9 : Create and schedule the purge jobs <em>PURGE_ALL_AUDIT_TRAILS</em></p>
<pre class="brush: sql; gutter: true; first-line: 1">BEGIN
  DBMS_AUDIT_MGMT.create_purge_job(
    audit_trail_type           =&gt; DBMS_AUDIT_MGMT.AUDIT_TRAIL_ALL,
    audit_trail_purge_interval =&gt; 24 /* hours */,
    audit_trail_purge_name     =&gt; 'PURGE_ALL_AUDIT_TRAILS',
    use_last_arch_timestamp    =&gt; TRUE );
END;
/

PL/SQL procedure successfully completed.

SELECT job_action
FROM   dba_scheduler_jobs
WHERE  job_name = 'PURGE_ALL_AUDIT_TRAILS';

JOB_ACTION
--------------------------------------------------------------------------------
BEGIN AUDSYS.DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL(15, TRUE, 1);  END;

SQL&gt;</pre>
<p>My customer wanted to audit all LOGON (even FAILS LOGIN) and LOGOFF for all users including proxy users.</p>
<p>Create the audit policy LOG_ON_OFF for actions LOGON and LOGOFF and enable it :</p>
<pre class="brush: sql; gutter: true; first-line: 1">conn /as sysdba
CREATE AUDIT POLICY LOG_ON_OFF ACTIONS LOGON,LOGOFF;
AUDIT POLICY LOG_ON_OFF;
SQL&gt; alter session set container=MYPDB;

Session altered.

col user_name format A10
col policy_name format A18
select POLICY_NAME, ENABLED_OPTION, ENTITY_NAME, SUCCESS, FAILURE
from AUDIT_UNIFIED_ENABLED_POLICIES
  3  where POLICY_NAME ='LOG_ON_OFF';

POLICY_NAME		ENABLED_OPTION		ENTITY_NAME		SUCCESS FAILURE
--- ------ ------ ------ ------ ------ ------ ------ ------ ---
LOG_ON_OFF		BY USER				ALL USERS		YES 	YES
</pre>
<p>&nbsp;</p>
<p>Let&#8217;s simulate a fails connection through a proxy users :</p>
<pre class="brush: actionscript3; gutter: true; first-line: 1">oracle@server:/home/oracle/ [MYCDB (CDB$ROOT)] sqlplus xfelahi[xxxxx]/"******"@server.domain.name/pdb.domain.name

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 5 16:07:37 2021
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied

</pre>
<p>Let&#8217;s check the Unified Auditing records into the table unified_audit_trail</p>
<p><a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture-4.png"><img loading="lazy" decoding="async" class="alignnone wp-image-51874 size-full" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture-4.png" alt="" width="752" height="182" /></a></p>
<p>&nbsp;</p>
<p>L’article <a href="https://www.dbi-services.com/blog/from-oracle-standard-auditing-to-oracle-unified-auditing/">From Oracle Standard Auditing to Oracle Unified Auditing</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/from-oracle-standard-auditing-to-oracle-unified-auditing/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Handling unified auditing spillover files on the standby-site</title>
		<link>https://www.dbi-services.com/blog/handling-unified-auditing-spillover-files-on-the-standby-site/</link>
					<comments>https://www.dbi-services.com/blog/handling-unified-auditing-spillover-files-on-the-standby-site/#respond</comments>
		
		<dc:creator><![CDATA[Clemens Bleile]]></dc:creator>
		<pubDate>Fri, 08 Jan 2021 15:57:31 +0000</pubDate>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Data Guard]]></category>
		<category><![CDATA[primary]]></category>
		<category><![CDATA[spillover files]]></category>
		<category><![CDATA[Standby]]></category>
		<category><![CDATA[Unified Auditing]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/handling-unified-auditing-spillover-files-on-the-standby-site/</guid>

					<description><![CDATA[<p>Switching to Oracle Unified Auditing may produce lots of data when e.g. auditing activities of the SYS-user. I.e. according the documentation you can do the following to audit similarly as in traditional auditing with audit_sys_operations=TRUE: SQL&#62; CREATE AUDIT POLICY TOPLEVEL_ACTIONS ACTIONS ALL ONLY TOPLEVEL; SQL&#62; AUDIT POLICY TOPLEVEL_ACTIONS BY SYS; REMARK1: You may check the [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/handling-unified-auditing-spillover-files-on-the-standby-site/">Handling unified auditing spillover files on the standby-site</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Switching to Oracle Unified Auditing may produce lots of data when e.g. auditing activities of the SYS-user. I.e. according the documentation you can do the following to audit similarly as in traditional auditing with audit_sys_operations=TRUE:</p>
<pre class="brush: sql; gutter: true; first-line: 1">
SQL&gt; CREATE AUDIT POLICY TOPLEVEL_ACTIONS ACTIONS ALL ONLY TOPLEVEL;
SQL&gt; AUDIT POLICY TOPLEVEL_ACTIONS BY SYS;
</pre>
<p>REMARK1: You may check the Blog on traditional SYS-auditing <a href="https://www.dbi-services.com/blog/audit_sys_operations-and-top-level-operation/">here</a><br />
REMARK2: Tests done in this Blog were done with Oracle 19.9. Auditing toplevel operations were not possible before 19c.</p>
<p>With unified auditing all data is written in the database &#8211; except when there&#8217;s no possibility to write to the database. If the database is e.g. not open then spillover files are written to the OS. By default files with extension bin are written to $ORACLE_BASE/audit/$ORACLE_SID. </p>
<p>REMARK: Container databases have a sub-directory per pluggable DB there, but all examples in this Blog are for a non-container-DB. </p>
<p>E.g.</p>
<pre class="brush: sql; gutter: true; first-line: 1">
oracle@boda1:/u01/app/oracle/audit/TISMED/ [TISMED] ls -ltr | tail -10
-rw-------. 1 oracle oinstall    6656 Jan  8 15:30 ora_audit_031.bin
-rw-------. 1 oracle oinstall   98304 Jan  8 15:35 ora_audit_0251.bin
-rw-------. 1 oracle oinstall    1536 Jan  8 15:57 ora_audit_0253.bin
-rw-------. 1 oracle oinstall 3140096 Jan  8 15:57 ora_audit_019.bin
-rw-------. 1 oracle oinstall    2048 Jan  8 15:57 ora_audit_0256.bin
-rw-------. 1 oracle oinstall    3584 Jan  8 15:58 ora_audit_0252.bin
-rw-------. 1 oracle oinstall    4096 Jan  8 15:58 ora_audit_0238.bin
-rw-------. 1 oracle oinstall    2048 Jan  8 15:58 ora_audit_024.bin
-rw-------. 1 oracle oinstall  314368 Jan  8 15:58 ora_audit_030.bin
-rw-------. 1 oracle oinstall    2048 Jan  8 15:58 ora_audit_029.bin
oracle@boda1:/u01/app/oracle/audit/TISMED/ [TISMED] 
</pre>
<p>You get an idea what&#8217;s in the files when doing a strings on them:</p>
<pre><code>
oracle@boda1:/u01/app/oracle/audit/TISMED/ [TISMED] strings ora_audit_030.bin | head -20
ANG Spillover Audit File
ORAAUDNG
oracle
boda2.localdomain
pts/0
(TYPE=(DATABASE));(CLIENT ADDRESS=((ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.6)(PORT=18890))));	
PUBLIC
oracle@boda2.localdomain (TNS V1-V3)
`)',
26801
SYSOPR
PUBLIC:
ORAAUDNG
oracle
boda2.localdomain
pts/0
(TYPE=(DATABASE));(CLIENT ADDRESS=((ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.6)(PORT=18892))));	
PUBLIC
oracle@boda2.localdomain (TNS V1-V3)
26813
oracle@boda1:/u01/app/oracle/audit/TISMED/ [TISMED] 
</code></pre>
<p>The data in the spillover-files are visible in the database when querying e.g. unified_audit_trail as the following simple example shows:</p>
<pre class="brush: sql; gutter: true; first-line: 1">
SQL&gt; select count(*) from unified_audit_trail;

  COUNT(*)
----------
    237306

SQL&gt; !mv /u01/app/oracle/audit/TISMED /u01/app/oracle/audit/TISMED_tmp

SQL&gt; select count(*) from unified_audit_trail;

  COUNT(*)
----------
    233816

SQL&gt; !mv /u01/app/oracle/audit/TISMED_tmp /u01/app/oracle/audit/TISMED

SQL&gt; select count(*) from unified_audit_trail;

  COUNT(*)
----------
    237328

SQL&gt; 
</pre>
<p>I.e. moving the spillover directory to a new name results in showing less data in UNIFIED_AUDIT_TRAIL. The view UNIFIED_AUDIT_TRAIL is a UNION ALL of the view v$unified_audit_trail and the table audsys.aud$unified (you may check $ORACLE_HOME/rdbms/admin/catuat.sql on what the metadata of UNIFIED_AUDIT_TRAIL is). The data of the spillover-files comes from the view v$unified_audit_trail:</p>
<pre class="brush: sql; gutter: true; first-line: 1">
SQL&gt; select count(*) from v$unified_audit_trail;

  COUNT(*)
----------
      3501

SQL&gt; select count(*) from audsys.aud$unified;

  COUNT(*)
----------
    233845

SQL&gt; !mv /u01/app/oracle/audit/TISMED /u01/app/oracle/audit/TISMED_tmp

SQL&gt; select count(*) from v$unified_audit_trail;

  COUNT(*)
----------
	 0

SQL&gt; select count(*) from audsys.aud$unified;

  COUNT(*)
----------
    233849

SQL&gt; !mv /u01/app/oracle/audit/TISMED_tmp /u01/app/oracle/audit/TISMED

SQL&gt; select count(*) from v$unified_audit_trail;

  COUNT(*)
----------
      3501

SQL&gt; 
</pre>
<p>Oracle provided the following possibility to load the data of the spillover-files into the database:</p>
<pre class="brush: sql; gutter: true; first-line: 1">
SQL&gt; exec DBMS_AUDIT_MGMT.LOAD_UNIFIED_AUDIT_FILES;
</pre>
<p>The issue I want to talk about in this blog are spillover files on standby databases. Standby databases are usually running in MOUNT-mode and hence are not writable. I.e. all audit-data produced on the standby-DBs go to spillover-files. If you haven&#8217;t switched over to the standby database for a while and loaded the spillover-files to the database then there could be quite a lot of data in the spillover-directory. I saw systems with e.g. 10GB of data in the spillover-directory, especially when doing rman-backups on the standby-site.</p>
<p>That causes 3 issues:</p>
<p>1.) If you move your audit data on your primary database to history tables then those history-tables may not contain the full truth, because audit-records of spillover-files on the standby-DBs are not visible in the history tables.<br />
2.) After a switchover a query on unified_audit_trail may be very slow, because reading spillover-files is slower than reading from the database.<br />
3.) Loading the spillover files after a switchover to the new primary database may take a long time and causes the SYSAUX-tablespace to grow significantly.</p>
<p>So the question is: How to handle the spillover-files on the standby-DB?</p>
<p>One possibility is to just remove them regularly on the OS if your security rules can afford to lose auditing data of standby-DBs. If that&#8217;s not possible then you may move the spillover-files regularly to a backup-location, so that you can restore those if necessary. The third alternative I&#8217;ve tested was to copy the spillover-files from the standy DB to the primary DB and load them there. That worked for me, but 2 things have to be considered:</p>
<p>1. spillover-files are not unique over all DBs in data guard. I.e. don&#8217;t just copy files over to the primary. You have to move away the primnary spillover directory first and restore it when the data has been loaded.<br />
2. The procedure is not documented and has to be confirmed by Oracle Support</p>
<p>E.g. here the process to copy and load spillover-files from standby to primary and load them:</p>
<p>1. Move away the primary spillover-folder </p>
<pre class="brush: sql; gutter: true; first-line: 1">
SQL&gt; select count(*) from v$unified_audit_trail uview;

  COUNT(*)
----------
       239

SQL&gt; !mv /u01/app/oracle/audit/${ORACLE_SID} /u01/app/oracle/audit/${ORACLE_SID}_tmp

SQL&gt; select count(*) from v$unified_audit_trail uview;

  COUNT(*)
----------
	 0
</pre>
<p>2. Copy spillover-files from standby to primary</p>
<pre class="brush: sql; gutter: true; first-line: 1">
SQL&gt; !scp -p -r standby:/u01/app/oracle/audit/${ORACLE_SID} /u01/app/oracle/audit
SQL&gt; select count(*) from v$unified_audit_trail uview;

  COUNT(*)
----------
       101

SQL&gt; exec DBMS_AUDIT_MGMT.LOAD_UNIFIED_AUDIT_FILES;

PL/SQL procedure successfully completed.

SQL&gt; select count(*) from v$unified_audit_trail uview;

  COUNT(*)
----------
	24
</pre>
<p>&#8211;&gt; Not all files were loaded. That&#8217;s normal.</p>
<p>3. Backup the current spillover-directory and restore the original spillover-directory</p>
<pre class="brush: sql; gutter: true; first-line: 1">
SQL&gt; !mv /u01/app/oracle/audit/${ORACLE_SID} /u01/app/oracle/audit/${ORACLE_SID}_standby

SQL&gt; !mv /u01/app/oracle/audit/${ORACLE_SID}_tmp /u01/app/oracle/audit/${ORACLE_SID}

SQL&gt; select count(*) from v$unified_audit_trail uview;

  COUNT(*)
----------
       239
</pre>
<p>4. Backup the spillover-folder on the standby-site. I.e. do the following command on the standby-host</p>
<pre class="brush: sql; gutter: true; first-line: 1">
SQL&gt; !mv /u01/app/oracle/audit/${ORACLE_SID} /u01/app/oracle/audit/${ORACLE_SID}_backup
</pre>
<p>5. Copy the remaining standby-files not loaded back to the standby host. I.e. do the following command on the standby-host</p>
<pre class="brush: sql; gutter: true; first-line: 1">
SQL&gt; !scp -p -r primary:/u01/app/oracle/audit/${ORACLE_SID}_standby /u01/app/oracle/audit/${ORACLE_SID}
SQL&gt; select count(*) from v$unified_audit_trail uview;

  COUNT(*)
----------
	24
</pre>
<p>REMARK: Above procedure is not 100% correct, because it doesn&#8217;t consider spillover-files produced while doing above steps. </p>
<p>Summary: Many people with standby-DBs and Unified Auditing active may not have realized that there are potential issues with spillover-files at the standby-site. Those spillover files on standby have to be considered. The easiest method is to just remove them regularly on the OS if that has been approved by the security team.</p>
<p>L’article <a href="https://www.dbi-services.com/blog/handling-unified-auditing-spillover-files-on-the-standby-site/">Handling unified auditing spillover files on the standby-site</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/handling-unified-auditing-spillover-files-on-the-standby-site/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: www.dbi-services.com @ 2026-10-17 03:14:24 by W3 Total Cache
-->