Skip to content
Keep Learning Keep Living
Keep Learning Keep Living
Keep Learning Keep Living

Querying CDB_* Views Generates Audit Records

Mustafa, 2023-10-04

Hi,

I would like to share a small problem I had on one of my databases. I had a common user on my CDBs to manage the databases (version is 19.20). On my databases, I use unified auditing and traditional audit is off. ORA_LOGON_FAILURES and ORA_SECURECONFIG policies are only enabled policies. There are two pdbs on the cdb.

Problem is, for this common user, querying any CDB_* view in a procedure (including functions/packages etc) generates audit records. for example when I run “select * from cdb_objects” no audit records are generated but if I use it in a simple plsql object like this:

Oracle PL/SQL
1
2
3
4
5
6
7
create or replace procedure sp_X as
begin
  for i in (select * from cdb_objects) loop
    null;
  end loop;
end;
/

Running this procedure generates audit records. For the procedure above, two audit records are generated one for DBA_OBJECTS and the other is CDB_OBJECTS. DBA_OBJECTS is the first one generated. When I checked the audit records (unified_audit_trail) I realized that, audit generator policy was ORA_SECURECONFIG and record for “DBA_*” view has “EXEMPT ACCESS POLICY” on system_privileged_used column. this privilege is commonly used for export entire data even if there is an active virtual private database policies.

So for some reason, oracle says, my common user is using EXEMPT ACCESS POLICY privilege to access on the PDB. Here are interesting points:

  1. This common user has DBA privilege on all pdbs and root, also has direct select privilege on DBA_OBJECTS view on all pdbs and root as well. there is no any VPD or label security etc. I believe there is no reason to use EXEMPT ACCESS POLICY privilege while querying DBA_* view on pdb via CDB_* view.
  2. There are two pdbs on the cdb but only one of the pdb cause this audit generation. how do I know that? on the original code, there are some plsql variables and one of them is CON_ID. Unified_Audit_Trail has “sql_binds” column that shows con_id and it always shows same con_id.
  3. This happens on all CDB_* views.
  4. This database is copied from another database and there few more copied databases as this one and they have quite same structure. same common user, same privileges, same codes etc and non of them has this problem.
  5. if I create a view like “create or replace view v_objects as select * from containers(dba_objects)” and use that view in the code instead of cdb_objects, it does not generate any audit record. if you check CDB_* views query, they are mostly the same with the view I just mentioned. they all use CONTAINERS(DBA_*) clause but somehow, my view doesn’t cause this problem.

So I dig as much as I could but couldn’t find the root problem here. Only thing I come up with is, this pdb has been converted from non-cdb, maybe conversion had some problems but not sure. After trying many things, I created a new common user and grant same privileges then check the audit. There weren’t any! so this is specific to my common user and one specific pdb.

I can start an SR and talked to support team for a while but since I have a workaround (creating a view with containers clause), I wanted to do whatever I can do first and my last option was a “kill switch”. I exported everything the user has and drop the user. then recreate with my create scripts, grant privileges, import the objects again. Problem is gone. I believe there was a glitch (maybe a small bug) but at least I get rid of unnecessary thousands of audit records in the end.

Thanks for reading.

19c Administration Multi-tenant auditcdbEXEMPT ACCESS POLICYunified audit

Post navigation

Previous post
Next post

Comments (2)

  1. Tom says:
    2023-10-25 at 06:26

    All great Oracle database posts. Very helpful. I greatly appreciated.

    Reply
    1. Mustafa says:
      2023-10-25 at 22:33

      Thank you very much for your kind words Tom and sparing time to write. you made my day.

      Reply

Leave a Reply to Tom Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • DDL Generation Failed with ORA-65047: Object SYS.KUPUTIL is invalid
  • How to call HTTPS Url Without SSL Wallet in 19c
  • Is Table Unnecessary for Pipelined Function
  • Password Rollover Time in Seconds
  • PDB Syncronization Issue
  • How to limit DB Link Connection Timeout
  • Cloud Base Database Service
  • 29th of February and interval

Recent Comments

  • Mustafa on How to call HTTPS Url Without SSL Wallet in 19c
  • Накрутка авито on How to call HTTPS Url Without SSL Wallet in 19c
  • Mustafa on Cloud Base Database Service
  • Raja on Cloud Base Database Service
  • Mustafa on Refreshable PDB and ORA-17627: ORA-12578: TNS:wallet open failed

Categories

  • 11g
  • 12c
  • 18c
  • 19c
  • 21c
  • 23ai
  • Administration
  • Cloud
  • Compression
  • Development
  • Materialized View
  • Multi-tenant
  • Performance
  • Security
  • SQL / PLSQL
  • Uncategorized
  • Undocumented
  • Useful Scripts

Archives

  • June 2025
  • April 2025
  • November 2024
  • July 2024
  • April 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • October 2021
  • September 2021
  • August 2021
  • April 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • July 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • June 2018

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

RSS Follow This Blog

  • DDL Generation Failed with ORA-65047: Object SYS.KUPUTIL is invalid
  • How to call HTTPS Url Without SSL Wallet in 19c
  • Is Table Unnecessary for Pipelined Function
  • Password Rollover Time in Seconds
  • PDB Syncronization Issue
  • How to limit DB Link Connection Timeout
  • Cloud Base Database Service
  • 29th of February and interval
  • How to Copy Local Files to Oracle Object Storage
  • Guid vs Sequences

Archives

  • June 2025
  • April 2025
  • November 2024
  • July 2024
  • April 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • October 2021
  • September 2021
  • August 2021
  • April 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • July 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • June 2018

RSS Follow This Blog

  • DDL Generation Failed with ORA-65047: Object SYS.KUPUTIL is invalid
  • How to call HTTPS Url Without SSL Wallet in 19c
  • Is Table Unnecessary for Pipelined Function
  • Password Rollover Time in Seconds
  • PDB Syncronization Issue
  • How to limit DB Link Connection Timeout
  • Cloud Base Database Service
  • 29th of February and interval
  • How to Copy Local Files to Oracle Object Storage
  • Guid vs Sequences
RSS Error: A feed could not be found at `http://www.mywebsite.com/feed/`; the status code is `200` and content-type is `text/html; charset=UTF-8`
©2025 Keep Learning Keep Living | WordPress Theme by SuperbThemes