SlideShare a Scribd company logo
1 of 18
Oracle audit and reporting in one hour or 
less. 
UGF9157 
Prepared by: 
Leon Rzhemovskiy 
Database Architect 
UnikaSolution.com
Learning Objectives 
2 
 Answer questions Who, What , When and Where 
about any database activity by setting up an Oracle 
audit. The infrastructure is free and available in every 
database edition. 
 Stay on top of any possible performance and storage 
issues by choosing appropriate audit parameters. 
 Build summary and detail reports to analyze audit 
events from multiple databases using APEX or 
SQL*Plus. 
 Setup a data retention period and cleanup audit 
records regularly. 
 Create honeypot to attract hacker’s attention. 
 Enable alerts and send email notifications using 
Oracle Enterprise Manager infrastructure.
Monitoring Infrastructure 
3
Enabling Auditing 
4 
Database auditing is enabled and disabled by the 
AUDIT_TRAIL parameter in the database 
initialization parameter file. Unfortunately, audit_trail 
is not a dynamic parameter and as a result, 
requires a database reboot. To enable the audit, 
execute the following SQL commands as sysdba: 
 ALTER SYSTEM SET audit_trail=db_extended 
SCOPE=SPFILE; 
 SHUTDOWN immediate; 
 STARTUP; 
Verify the audit value by executing 
SELECT VALUE FROM V$PARAMETER WHERE 
NAME='audit_trail';
Auditing options 
5 
Audit policy is controlled by setting up options based on the 
statement, privilege, object and network level. 
AUDIT and NOAUDIT statements are used to set up auditing 
settings. 
Following views could be used to display auditing settings: 
 DBA_PRIV_AUDIT_OPTS; 
 DBA_STMT_AUDIT_OPTS; 
 DBA_OBJ_AUDIT_OPTS; 
To remove all audit settings on the statement and privilege level 
execute 
 NOAUDIT ALL PRIVILEGES; 
 NOAUDIT ALL;
Auditing Options Setup 
6 
The auditing event’s frequency impacts database performance and 
storage. The number of auditing options varies between database 
versions. 
You can setup auditing options by running oracle recommended 
RDBMS/admin/secconf.sql. 
In my opinion, it is more beneficial to start from auditing everything 
available and reduce/modify auditing options if needed. 
 AUDIT ALL PRIVILEGES WHENEVER SUCCESSFUL; 
 AUDIT ALL WHENEVER SUCCESSFUL; 
 NOAUDIT CREATE SESSION; 
 AUDIT CREATE SESSION WHENEVER NOT SUCCESSFUL; 
 NOAUDIT SELECT ANY TABLE; 
 NOAUDIT SELECT ANY SEQUENCE; 
 NOAUDIT INSERT ANY TABLE; 
 NOAUDIT DELETE ANY TABLE; 
 NOAUDIT UPDATE ANY TABLE; 
 NOAUDIT EXECUTE ANY PROCEDURE;
Audit Reporting 
7 
Audit entries are stored in SYS.AUD$ table and usually are accessed 
using DBA_AUDIT_TRAIL view. For every entry, the user name, 
timestamp, connection origin, action performed and even SQL 
statement is recorded. 
You can use TOAD, SQLDeveloper to browse audit records. 
SQL*Plus could be used to generate html output. The following is a 
sample: 
SET MARKUP HTML ON 
spool summary.html 
SELECT TRUNC(TIMESTAMP) "Date" ,COUNT(1) "Count Audit Entries" 
FROM dba_audit_trail 
WHERE TIMESTAMP BETWEEN TRUNC(SYSDATE,'MON') AND 
SYSDATE 
GROUP BY TRUNC(TIMESTAMP) 
ORDER BY TRUNC(TIMESTAMP) DESC; 
exit;
Audit reporting using APEX demo 
8
Audit reporting using APEX demo 
9
Audit reporting using APEX demo 
10
Audit reporting using APEX demo 
11
Audit reporting using APEX demo 
12
Audit reporting using APEX demo 
13
Audit Cleanup 
14 
The simplest (but not recommended by Oracle) option is 
TRUNCATE TABLE sys.aud$; 
If you are running 11g, then use the following solution: 
-- init cleanup 
BEGIN 
DBMS_AUDIT_MGMT.INIT_CLEANUP( 
AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, 
DEFAULT_CLEANUP_INTERVAL => 720 /*hours*/ ); 
END; 
/ 
-- set timestamp to purge data 30+ days old 
BEGIN 
DBMS_AUDIT_MGMT.set_last_archive_timestamp( 
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, 
last_archive_time => SYSTIMESTAMP-30); 
END; 
/ 
-- cleanup job. Should be scheduled to execute daily 
BEGIN 
DBMS_AUDIT_MGMT.clean_audit_trail( 
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, 
use_last_arch_timestamp => TRUE); 
END; 
/
Setup alerts and email notifications 
15 
Login to Oracle Enterprise Manager Cloud Control 12c 
Navigate to Enterprise-> Monitoring -> Metric Extensions -> Action -> Create
Setup alerts and email notifications 
16
Honeypot Setup 
17 
Create a table with an intriguing name and then monitor any attempt 
to select data from this table. Setup the Metric Extension and email 
notifications in Enterprise Manager to react on unauthorized actions 
immediately. 
CREATE TABLE CUSTOMER_CREDIT_CARDS( 
Customer_no number(16), 
Credit_Card_No number(16), 
Credit_Card_Exp varchar2(4)); 
GRANT SELECT ON CUSTOMER_CREDIT_CARDS TO PUBLIC; 
CREATE PUBLIC SYNONYM CUSTOMER_CREDIT_CARDS FOR 
CUSTOMER_CREDIT_CARDS; 
AUDIT SELECT ON CUSTOMER_CREDIT_CARDS;
Conclusion 
18 
There is no excuse to avoid setting up an Audit Trail. You will get an 
enormous value for expending very little effort. You can utilize APEX 
application or any SQL client to browse Oracle audit entries. You can 
react immediately on unauthorized activities by setting up Enterprise 
Manager metric extensions and email notifications.

More Related Content

What's hot

Database Automation with MySQL Triggers and Event Schedulers
Database Automation with MySQL Triggers and Event SchedulersDatabase Automation with MySQL Triggers and Event Schedulers
Database Automation with MySQL Triggers and Event SchedulersAbdul Rahman Sherzad
 
Sql storeprocedure
Sql storeprocedureSql storeprocedure
Sql storeprocedureftz 420
 
Maria db audit plugin introduction v1.3
Maria db audit plugin introduction v1.3Maria db audit plugin introduction v1.3
Maria db audit plugin introduction v1.3YUCHENG HU
 
Convert Physical Standby Into Logical Standby
Convert Physical Standby Into Logical StandbyConvert Physical Standby Into Logical Standby
Convert Physical Standby Into Logical StandbyArun Sharma
 
Getting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise MonitorGetting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise MonitorMark Leith
 
R12 d49656 gc10-apps dba 19
R12 d49656 gc10-apps dba 19R12 d49656 gc10-apps dba 19
R12 d49656 gc10-apps dba 19zeesniper
 
Performance schema and_ps_helper
Performance schema and_ps_helperPerformance schema and_ps_helper
Performance schema and_ps_helperMark Leith
 
Analytics work space manager installation
Analytics work space manager installationAnalytics work space manager installation
Analytics work space manager installationRavi Kumar Lanke
 
R12 d49656 gc10-apps dba 22
R12 d49656 gc10-apps dba 22R12 d49656 gc10-apps dba 22
R12 d49656 gc10-apps dba 22zeesniper
 
Developing Information Schema Plugins
Developing Information Schema PluginsDeveloping Information Schema Plugins
Developing Information Schema PluginsMark Leith
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-PresentationChuck Walker
 
R12 d49656 gc10-apps dba 27
R12 d49656 gc10-apps dba 27R12 d49656 gc10-apps dba 27
R12 d49656 gc10-apps dba 27zeesniper
 
Using triggers in my sql database
Using triggers in my sql databaseUsing triggers in my sql database
Using triggers in my sql databaseKimera Richard
 

What's hot (20)

Database Automation with MySQL Triggers and Event Schedulers
Database Automation with MySQL Triggers and Event SchedulersDatabase Automation with MySQL Triggers and Event Schedulers
Database Automation with MySQL Triggers and Event Schedulers
 
Sql storeprocedure
Sql storeprocedureSql storeprocedure
Sql storeprocedure
 
Introduction to triggers
Introduction to triggersIntroduction to triggers
Introduction to triggers
 
Maria db audit plugin introduction v1.3
Maria db audit plugin introduction v1.3Maria db audit plugin introduction v1.3
Maria db audit plugin introduction v1.3
 
Trigger
TriggerTrigger
Trigger
 
Convert Physical Standby Into Logical Standby
Convert Physical Standby Into Logical StandbyConvert Physical Standby Into Logical Standby
Convert Physical Standby Into Logical Standby
 
Sql triggers
Sql triggersSql triggers
Sql triggers
 
Getting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise MonitorGetting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise Monitor
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
R12 d49656 gc10-apps dba 19
R12 d49656 gc10-apps dba 19R12 d49656 gc10-apps dba 19
R12 d49656 gc10-apps dba 19
 
Performance schema and_ps_helper
Performance schema and_ps_helperPerformance schema and_ps_helper
Performance schema and_ps_helper
 
PL/SQL TRIGGERS
PL/SQL TRIGGERSPL/SQL TRIGGERS
PL/SQL TRIGGERS
 
Analytics work space manager installation
Analytics work space manager installationAnalytics work space manager installation
Analytics work space manager installation
 
R12 d49656 gc10-apps dba 22
R12 d49656 gc10-apps dba 22R12 d49656 gc10-apps dba 22
R12 d49656 gc10-apps dba 22
 
Developing Information Schema Plugins
Developing Information Schema PluginsDeveloping Information Schema Plugins
Developing Information Schema Plugins
 
Oracle Database Trigger
Oracle Database TriggerOracle Database Trigger
Oracle Database Trigger
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-Presentation
 
R12 d49656 gc10-apps dba 27
R12 d49656 gc10-apps dba 27R12 d49656 gc10-apps dba 27
R12 d49656 gc10-apps dba 27
 
SQL Server Stored procedures
SQL Server Stored proceduresSQL Server Stored procedures
SQL Server Stored procedures
 
Using triggers in my sql database
Using triggers in my sql databaseUsing triggers in my sql database
Using triggers in my sql database
 

Viewers also liked

Oracle apex training | Oracle Application Application Express Training | Ora...
Oracle apex training | Oracle Application Application Express Training |  Ora...Oracle apex training | Oracle Application Application Express Training |  Ora...
Oracle apex training | Oracle Application Application Express Training | Ora...Nancy Thomas
 
D17316 gc20 l12_other
D17316 gc20 l12_otherD17316 gc20 l12_other
D17316 gc20 l12_otherMoeen_uddin
 
Data Guard New Features
Data Guard New FeaturesData Guard New Features
Data Guard New Featuresxiangrong
 
ADF Taskflows for beginners
ADF Taskflows for beginnersADF Taskflows for beginners
ADF Taskflows for beginnersRajasekhar Manda
 
Oracle Data Guard A to Z
Oracle Data Guard A to ZOracle Data Guard A to Z
Oracle Data Guard A to ZZohar Elkayam
 
APEX printing with BI Publisher
APEX printing with BI PublisherAPEX printing with BI Publisher
APEX printing with BI PublisherRoel Hartman
 
Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016Lino Schildenfeld
 
Active / Active configurations with Oracle Active Data Guard
Active / Active configurations with Oracle Active Data GuardActive / Active configurations with Oracle Active Data Guard
Active / Active configurations with Oracle Active Data GuardAris Prassinos
 
Speed Up Your APEX Apps with JSON and Handlebars
Speed Up Your APEX Apps with JSON and HandlebarsSpeed Up Your APEX Apps with JSON and Handlebars
Speed Up Your APEX Apps with JSON and HandlebarsMarko Gorički
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12cuzzal basak
 
APEX, restful services and STRIPE
APEX, restful services and STRIPEAPEX, restful services and STRIPE
APEX, restful services and STRIPELino Schildenfeld
 
APEX 5 Interactive Reports: Guts and PErformance
APEX 5 Interactive Reports: Guts and PErformanceAPEX 5 Interactive Reports: Guts and PErformance
APEX 5 Interactive Reports: Guts and PErformanceKaren Cannell
 
APEX 5 Interactive Reports: Deep Dive and Upgrade Advice
APEX 5 Interactive Reports: Deep Dive and Upgrade AdviceAPEX 5 Interactive Reports: Deep Dive and Upgrade Advice
APEX 5 Interactive Reports: Deep Dive and Upgrade AdviceKaren Cannell
 
APEX 5.1 features - AUSOUG Connect 2016
APEX 5.1 features - AUSOUG Connect 2016APEX 5.1 features - AUSOUG Connect 2016
APEX 5.1 features - AUSOUG Connect 2016Lino Schildenfeld
 
RMAN backup Oracle
RMAN backup OracleRMAN backup Oracle
RMAN backup OracleAlfan Dya
 
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...Ludovico Caldara
 
Oracle APEX or ADF? From Requirements to Tool Choice
Oracle APEX or ADF? From Requirements to Tool ChoiceOracle APEX or ADF? From Requirements to Tool Choice
Oracle APEX or ADF? From Requirements to Tool ChoiceSten Vesterli
 

Viewers also liked (20)

Oracle apex training | Oracle Application Application Express Training | Ora...
Oracle apex training | Oracle Application Application Express Training |  Ora...Oracle apex training | Oracle Application Application Express Training |  Ora...
Oracle apex training | Oracle Application Application Express Training | Ora...
 
D17316 gc20 l12_other
D17316 gc20 l12_otherD17316 gc20 l12_other
D17316 gc20 l12_other
 
Data Guard New Features
Data Guard New FeaturesData Guard New Features
Data Guard New Features
 
ADF Taskflows for beginners
ADF Taskflows for beginnersADF Taskflows for beginners
ADF Taskflows for beginners
 
Oracle Data Guard A to Z
Oracle Data Guard A to ZOracle Data Guard A to Z
Oracle Data Guard A to Z
 
APEX printing with BI Publisher
APEX printing with BI PublisherAPEX printing with BI Publisher
APEX printing with BI Publisher
 
Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016
 
Active / Active configurations with Oracle Active Data Guard
Active / Active configurations with Oracle Active Data GuardActive / Active configurations with Oracle Active Data Guard
Active / Active configurations with Oracle Active Data Guard
 
Apex RnD APEX 5 - Printing
Apex RnD APEX 5 - PrintingApex RnD APEX 5 - Printing
Apex RnD APEX 5 - Printing
 
Speed Up Your APEX Apps with JSON and Handlebars
Speed Up Your APEX Apps with JSON and HandlebarsSpeed Up Your APEX Apps with JSON and Handlebars
Speed Up Your APEX Apps with JSON and Handlebars
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12c
 
APEX, restful services and STRIPE
APEX, restful services and STRIPEAPEX, restful services and STRIPE
APEX, restful services and STRIPE
 
APEX 5 Interactive Reports: Guts and PErformance
APEX 5 Interactive Reports: Guts and PErformanceAPEX 5 Interactive Reports: Guts and PErformance
APEX 5 Interactive Reports: Guts and PErformance
 
APEX 5 Interactive Reports: Deep Dive and Upgrade Advice
APEX 5 Interactive Reports: Deep Dive and Upgrade AdviceAPEX 5 Interactive Reports: Deep Dive and Upgrade Advice
APEX 5 Interactive Reports: Deep Dive and Upgrade Advice
 
APEX 5.1 features - AUSOUG Connect 2016
APEX 5.1 features - AUSOUG Connect 2016APEX 5.1 features - AUSOUG Connect 2016
APEX 5.1 features - AUSOUG Connect 2016
 
Data Guard25 August
Data Guard25 AugustData Guard25 August
Data Guard25 August
 
RMAN backup Oracle
RMAN backup OracleRMAN backup Oracle
RMAN backup Oracle
 
Oracle Data Guard
Oracle Data GuardOracle Data Guard
Oracle Data Guard
 
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
 
Oracle APEX or ADF? From Requirements to Tool Choice
Oracle APEX or ADF? From Requirements to Tool ChoiceOracle APEX or ADF? From Requirements to Tool Choice
Oracle APEX or ADF? From Requirements to Tool Choice
 

Similar to Oracle audit and reporting in one hour or less

NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseParesh Patel
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
LVOUG meetup #4 - Case Study 10g to 11g
LVOUG meetup #4 - Case Study 10g to 11gLVOUG meetup #4 - Case Study 10g to 11g
LVOUG meetup #4 - Case Study 10g to 11gMaris Elsins
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ICarlos Oliveira
 
Remote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts
 
05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptxKareemBullard1
 
OTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least PrivilegeOTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least PrivilegeBiju Thomas
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userDesty Yani
 
Achieving Gold Medal Performance From SQL Server
Achieving Gold Medal Performance From SQL ServerAchieving Gold Medal Performance From SQL Server
Achieving Gold Medal Performance From SQL ServerSQLDBApros
 
SQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVsSQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVsFranklin Yamamoto
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMayank Prasad
 
Less12 Proactive
Less12 ProactiveLess12 Proactive
Less12 Proactivevivaankumar
 

Similar to Oracle audit and reporting in one hour or less (20)

OER UNIT 5 Audit
OER UNIT  5 AuditOER UNIT  5 Audit
OER UNIT 5 Audit
 
Sherlock holmes for dba’s
Sherlock holmes for dba’sSherlock holmes for dba’s
Sherlock holmes for dba’s
 
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
 
Aspects of 10 Tuning
Aspects of 10 TuningAspects of 10 Tuning
Aspects of 10 Tuning
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
LVOUG meetup #4 - Case Study 10g to 11g
LVOUG meetup #4 - Case Study 10g to 11gLVOUG meetup #4 - Case Study 10g to 11g
LVOUG meetup #4 - Case Study 10g to 11g
 
audit_blog.ppt
audit_blog.pptaudit_blog.ppt
audit_blog.ppt
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
 
DB2 LUW Auditing
DB2 LUW AuditingDB2 LUW Auditing
DB2 LUW Auditing
 
Remote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts 11g Features
Remote DBA Experts 11g Features
 
Free oracle performance tools
Free oracle performance toolsFree oracle performance tools
Free oracle performance tools
 
05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx
 
OTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least PrivilegeOTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least Privilege
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan user
 
Achieving Gold Medal Performance From SQL Server
Achieving Gold Medal Performance From SQL ServerAchieving Gold Medal Performance From SQL Server
Achieving Gold Medal Performance From SQL Server
 
SQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVsSQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVs
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasia
 
Less12 Proactive
Less12 ProactiveLess12 Proactive
Less12 Proactive
 

Recently uploaded

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Oracle audit and reporting in one hour or less

  • 1. Oracle audit and reporting in one hour or less. UGF9157 Prepared by: Leon Rzhemovskiy Database Architect UnikaSolution.com
  • 2. Learning Objectives 2  Answer questions Who, What , When and Where about any database activity by setting up an Oracle audit. The infrastructure is free and available in every database edition.  Stay on top of any possible performance and storage issues by choosing appropriate audit parameters.  Build summary and detail reports to analyze audit events from multiple databases using APEX or SQL*Plus.  Setup a data retention period and cleanup audit records regularly.  Create honeypot to attract hacker’s attention.  Enable alerts and send email notifications using Oracle Enterprise Manager infrastructure.
  • 4. Enabling Auditing 4 Database auditing is enabled and disabled by the AUDIT_TRAIL parameter in the database initialization parameter file. Unfortunately, audit_trail is not a dynamic parameter and as a result, requires a database reboot. To enable the audit, execute the following SQL commands as sysdba:  ALTER SYSTEM SET audit_trail=db_extended SCOPE=SPFILE;  SHUTDOWN immediate;  STARTUP; Verify the audit value by executing SELECT VALUE FROM V$PARAMETER WHERE NAME='audit_trail';
  • 5. Auditing options 5 Audit policy is controlled by setting up options based on the statement, privilege, object and network level. AUDIT and NOAUDIT statements are used to set up auditing settings. Following views could be used to display auditing settings:  DBA_PRIV_AUDIT_OPTS;  DBA_STMT_AUDIT_OPTS;  DBA_OBJ_AUDIT_OPTS; To remove all audit settings on the statement and privilege level execute  NOAUDIT ALL PRIVILEGES;  NOAUDIT ALL;
  • 6. Auditing Options Setup 6 The auditing event’s frequency impacts database performance and storage. The number of auditing options varies between database versions. You can setup auditing options by running oracle recommended RDBMS/admin/secconf.sql. In my opinion, it is more beneficial to start from auditing everything available and reduce/modify auditing options if needed.  AUDIT ALL PRIVILEGES WHENEVER SUCCESSFUL;  AUDIT ALL WHENEVER SUCCESSFUL;  NOAUDIT CREATE SESSION;  AUDIT CREATE SESSION WHENEVER NOT SUCCESSFUL;  NOAUDIT SELECT ANY TABLE;  NOAUDIT SELECT ANY SEQUENCE;  NOAUDIT INSERT ANY TABLE;  NOAUDIT DELETE ANY TABLE;  NOAUDIT UPDATE ANY TABLE;  NOAUDIT EXECUTE ANY PROCEDURE;
  • 7. Audit Reporting 7 Audit entries are stored in SYS.AUD$ table and usually are accessed using DBA_AUDIT_TRAIL view. For every entry, the user name, timestamp, connection origin, action performed and even SQL statement is recorded. You can use TOAD, SQLDeveloper to browse audit records. SQL*Plus could be used to generate html output. The following is a sample: SET MARKUP HTML ON spool summary.html SELECT TRUNC(TIMESTAMP) "Date" ,COUNT(1) "Count Audit Entries" FROM dba_audit_trail WHERE TIMESTAMP BETWEEN TRUNC(SYSDATE,'MON') AND SYSDATE GROUP BY TRUNC(TIMESTAMP) ORDER BY TRUNC(TIMESTAMP) DESC; exit;
  • 8. Audit reporting using APEX demo 8
  • 9. Audit reporting using APEX demo 9
  • 10. Audit reporting using APEX demo 10
  • 11. Audit reporting using APEX demo 11
  • 12. Audit reporting using APEX demo 12
  • 13. Audit reporting using APEX demo 13
  • 14. Audit Cleanup 14 The simplest (but not recommended by Oracle) option is TRUNCATE TABLE sys.aud$; If you are running 11g, then use the following solution: -- init cleanup BEGIN DBMS_AUDIT_MGMT.INIT_CLEANUP( AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, DEFAULT_CLEANUP_INTERVAL => 720 /*hours*/ ); END; / -- set timestamp to purge data 30+ days old BEGIN DBMS_AUDIT_MGMT.set_last_archive_timestamp( audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, last_archive_time => SYSTIMESTAMP-30); END; / -- cleanup job. Should be scheduled to execute daily BEGIN DBMS_AUDIT_MGMT.clean_audit_trail( audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, use_last_arch_timestamp => TRUE); END; /
  • 15. Setup alerts and email notifications 15 Login to Oracle Enterprise Manager Cloud Control 12c Navigate to Enterprise-> Monitoring -> Metric Extensions -> Action -> Create
  • 16. Setup alerts and email notifications 16
  • 17. Honeypot Setup 17 Create a table with an intriguing name and then monitor any attempt to select data from this table. Setup the Metric Extension and email notifications in Enterprise Manager to react on unauthorized actions immediately. CREATE TABLE CUSTOMER_CREDIT_CARDS( Customer_no number(16), Credit_Card_No number(16), Credit_Card_Exp varchar2(4)); GRANT SELECT ON CUSTOMER_CREDIT_CARDS TO PUBLIC; CREATE PUBLIC SYNONYM CUSTOMER_CREDIT_CARDS FOR CUSTOMER_CREDIT_CARDS; AUDIT SELECT ON CUSTOMER_CREDIT_CARDS;
  • 18. Conclusion 18 There is no excuse to avoid setting up an Audit Trail. You will get an enormous value for expending very little effort. You can utilize APEX application or any SQL client to browse Oracle audit entries. You can react immediately on unauthorized activities by setting up Enterprise Manager metric extensions and email notifications.