Scenario 2 – Auditing RMAN and Oracle Data Pump Operations
In this scenario, we’ll explore how to audit Oracle Data Pump and Recovery Manager (RMAN) operations within your Oracle database environment.
Oracle Data Pump Auditing
1. Create Data Pump Audit Policy: Begin by creating an audit policy specifically for Oracle Data Pump export operations:
SQL> CREATE AUDIT POLICY DP_POL ACTIONS COMPONENT=datapump EXPORT;

2. Enable Audit Policy: Once the audit policy is created, enable it:
SQL> AUDIT POLICY DP_POL;

3. Verify Policy Status: Confirm that the audit policy is enabled:
SQL> COL USER_NAME FORMAT A10
SQL> COL POLICY_NAME FORMAT A10
SQL> SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES WHERE POLICY_NAME LIKE ‘%DP%’;

4. Perform Export Operation: Execute an export operation using Oracle Data Pump. This step is typically performed at the operating system level.
$ rm /u01/app/oracle/admin/orcl/dpdump/HR_tables.dmp
$ expdp system/oracle_4U dumpfile=HR_tables tables=HR.EMPLOYEES

4. View Audit Data: After performing the export operation, access the resulting audit data:
SQL> SET PAGES 100
SQL> SELECT DBUSERNAME, DP_TEXT_PARAMETERS1, DP_BOOLEAN_PARAMETERS1 FROM UNIFIED_AUDIT_TRAIL WHERE DP_TEXT_PARAMETERS1 IS NOT NULL;

5. Flush Audit Trail: If the audited data is still in memory, flush the unified audit trail to disk:
SQL> EXEC SYS.DBMS_AUDIT_MGMT.FLUSH_UNIFIED_AUDIT_TRAIL;
6. View Audit Data Again: Once the audit data is flushed to disk, view it again:
SQL> SELECT DBUSERNAME, DP_TEXT_PARAMETERS1, DP_BOOLEAN_PARAMETERS1 FROM UNIFIED_AUDIT_TRAIL WHERE DP_TEXT_PARAMETERS1 IS NOT NULL;
RMAN Auditing
For RMAN backup, restore, and recover operations are audited by default. You don’t need to create a separate audit policy.
1. Perform Backup Operation: Execute a backup operation using RMAN:
$ rman target /
RMAN> BACKUP TABLESPACE USERS;
RMAN> EXIT;

3. Restore and Recover Operation: Remove the USERS tablespace datafile, then restore and recover it using RMAN:
$ sqlplus / as sysdba
SQL> ALTER TABLESPACE USERS OFFLINE IMMEDIATE;
SQL> EXIT;
$ rman target /
RMAN> RESTORE TABLESPACE USERS;
RMAN> RECOVER TABLESPACE USERS;
RMAN> EXIT;


4. View Audit Data: Access the resulting audit data for RMAN operations:
$ sqlplus / as sysdbaSQL> ALTER TABLESPACE USERS ONLINE;
SQL> SELECT DBUSERNAME, RMAN_OPERATION FROM UNIFIED_AUDIT_TRAIL WHERE RMAN_OPERATION IS NOT NULL;

5. Flush Audit Trail: If necessary, flush the unified audit trail to disk:
SQL> EXEC SYS.DBMS_AUDIT_MGMT.FLUSH_UNIFIED_AUDIT_TRAIL;
6. View Audit Data Again: Once the audit data is flushed to disk, view it again:
SQL> SELECT DBUSERNAME, RMAN_OPERATION FROM UNIFIED_AUDIT_TRAIL WHERE RMAN_OPERATION IS NOT NULL;
By following these steps, you can effectively audit Oracle Data Pump and RMAN operations within your Oracle database environment.
Nice post. I learn something totally new and challenging on websites
Hi,
Thank you for your comment.
Regards
naturally like your web site however you need to take a look at the spelling on several of your posts. A number of them are rife with spelling problems and I find it very bothersome to tell the truth on the other hand I will surely come again again.
I very delighted to find this internet site on bing, just what I was searching for as well saved to fav
Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
I just like the helpful information you provide in your articles
very informative articles or reviews at this time.
I truly appreciate your technique of writing a blog. I added it to my bookmark site list and will