Friday, February 19, 2016

Audit data pump actions in 12c

   ******************************************************************************
Audit Data pump actions
******************************************************************************

[oracle@Linux03 Desktop]$ sqlplus /"As sysdba"

SQL> alter session set container=pdborcl1;

Session altered.

SQL> create directory dpump as '/u01/app/oracle/dpump';

Directory created.

SQL> grant read,write on directory dpump to pdborcl1_usr2;

Grant succeeded.

******************************************************************************

SQL> SET LINESIZE 200
COLUMN event_timestamp FORMAT A30
COLUMN dp_text_parameters1 FORMAT A30
COLUMN dp_boolean_parameters1 FORMAT A30

SELECT event_timestamp,
       dp_text_parameters1,
       dp_boolean_parameters1
FROM   unified_audit_trail
WHERE  audit_type = 'Datapump';

no rows selected

SQL> CREATE AUDIT POLICY audit_dp_all_policy ACTIONS COMPONENT=DATAPUMP ALL;

Audit policy created.

SQL> AUDIT POLICY audit_dp_all_policy BY pdborcl1_usr2;

Audit succeeded.

******************************************************************************

[oracle@Linux03 oracle]$ expdp pdborcl1_usr2/XXXXXXX@pdborcl1 directory=dpump dumpfile=pdborc1_usr2_tables15 tables=pdborcl1_usr2.TEST,pdborcl1_usr2.TEST_ID logtime=status

Export: Release 12.1.0.2.0 - Production on Fri Mar 11 15:24:13 2016

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
11-MAR-16 15:24:15.351: Starting "PDBORCL1_USR2"."SYS_EXPORT_TABLE_01":  pdborcl1_usr2/********@pdborcl1 directory=dpump dumpfile=pdborc1_usr2_tables15 tables=pdborcl1_usr2.TEST,pdborcl1_usr2.TEST_ID logtime=status
11-MAR-16 15:24:15.810: Estimate in progress using BLOCKS method...
11-MAR-16 15:24:16.683: Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
11-MAR-16 15:24:16.778: Total estimation using BLOCKS method: 128 KB
11-MAR-16 15:24:21.341: Processing object type TABLE_EXPORT/TABLE/TABLE
11-MAR-16 15:24:22.237: Processing object type TABLE_EXPORT/TABLE/IDENTITY_COLUMN
11-MAR-16 15:24:23.233: Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
11-MAR-16 15:24:24.615: Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
11-MAR-16 15:24:24.656: Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
11-MAR-16 15:24:25.230: Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
11-MAR-16 15:24:25.245: Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
11-MAR-16 15:24:29.893: . . exported "PDBORCL1_USR2"."TEST"                      5.078 KB       1 rows
11-MAR-16 15:24:29.907: . . exported "PDBORCL1_USR2"."TEST_ID"                   5.937 KB       2 rows
11-MAR-16 15:24:30.137: Master table "PDBORCL1_USR2"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
11-MAR-16 15:24:30.142:

******************************************************************************
11-MAR-16 15:24:30.142: Dump file set for PDBORCL1_USR2.SYS_EXPORT_TABLE_01 is:
11-MAR-16 15:24:30.147:   /u01/app/oracle/dpump/pdborc1_usr2_tables15.dmp
11-MAR-16 15:24:30.164: Job "PDBORCL1_USR2"."SYS_EXPORT_TABLE_01" successfully completed at Fri Mar 11 15:24:30 2016 elapsed 0 00:00:15

******************************************************************************

SQL> SET LINESIZE 200
COLUMN event_timestamp FORMAT A30
COLUMN dp_text_parameters1 FORMAT A30
COLUMN dp_boolean_parameters1 FORMAT A30

SELECT event_timestamp,
       dp_text_parameters1,
       dp_boolean_parameters1
FROM   unified_audit_trail
WHERE  audit_type = 'Datapump';

EVENT_TIMESTAMP       DP_TEXT_PARAMETERS1      DP_BOOLEAN_PARAMETERS1
------------------------------ ------------------------------ ------------------------------
11-MAR-16 08.24.15.775940 AM   MASTER TABLE:  "PDBORCL1_USR2" MASTER_ONLY: FALSE, DATA_ONLY:
      ."SYS_EXPORT_TABLE_01" , JOB_T  FALSE, METADATA_ONLY: FALSE,
      YPE: EXPORT, METADATA_JOB_MODE DUMPFILE_PRESENT: TRUE, JOB_RE
      : TABLE_EXPORT, JOB VERSION: 1 STARTED: FALSE
      2.1.0.2.0, ACCESS METHOD: AUTO
      MATIC, DATA OPTIONS: 0, DUMPER
DIRECTORY: NULL  REMOTE LINK:
NULL, TABLE EXISTS: NULL, PAR
      TITION OPTIONS: NONE

No comments:

Post a Comment