Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Berkeley DB JE 7.5.11 - ever growing expiration DB

Siva tezJul 20 2023 — edited Jul 20 2023

We are utilizing Berkeley DB JE 7.5.11 as our key-value store. Our usage involves a primary database as a SortedMap<String, Val>, along with a secondary database as SortedMap<Date, Val>. We frequently add keys to the primary database using the SortedMap#put method, and periodically remove entries older than a specific value using the secondary database using secondaryMap.headSet(Date).clear().

While the system is functioning as expected, we have observed a continuous increase in the number of records within the internal expiration database (_jeExpiration). Seems that though we are not using the expiration feature, expiration records are still created whenever a new log files are added but are not deleted when the files are removed.

This seems to be ok as long as the service is running but it is causing delays during the POPULATE_EP stage whenever the service is restarted. In one instance when the expiration database had ~3 million records, the restart took ~30 minutes, it is also triggering a lot of eviction during the startup process probably adding to the delay.

Questions,

  1. What is the expected behavior? Shouldn't the expiration DB cleaned automatically ? Is there a known issue around it? Is there a way to trigger the cleanup of this DB ?
  2. Is it possible to disable EP completely (via EnvironmentConfig#getCreateEP to false) ?

Thanks in advance for the response!

Comments

MartinBach-Oracle Jan 8 2025

Hi Salomon,

please have a look at this blog post written by @ulrike-schwinn-oracle :

https://blogs.oracle.com/coretec/post/easy-sql-statement-tracking-in23c

I hope this answers your question, if not, please shout!

- Martin

Solomon Yakobson Jan 8 2025

@martinbach-oracle - No, it doesn't answer my question. Article you pointed to shows uses:

SQL> alter system set sql_history_enabled=true scope=both;

And in my post I said “Works fine when enabled on system level”. My question was about

SQL> ALTER SESSION SET SQL_HISTORY_ENABLED = TRUE;

where I showed SQL history was NOT captured even though it should be based on SQL_HISTORY_ENABLED:

Modifiable **ALTER SESSION**, ALTER SYSTEM

SY.

MartinBach-Oracle Jan 8 2025

As per the article I shared the situation is as follows at the moment

  • You must enable SQL history PDB-wide (only a DBA can do that) so there's a certain level of control over the feature
  • Your session has access to the SQL history
  • If you don't want to record anything, set sql_history_enabled to false.

I'm currently assessing if that's intended behaviour (in which case the documentation should be amended) or a feature not working as it should (in which case it needs fixing). The parameter is indeed session-modifyable, but not in the sense you expected.

We'll keep you posted.

- Martin

Solomon Yakobson Jan 8 2025

Do you mean it must be enabled on system level and not on session level and all session can do is disabe it for the session?

SY.

MartinBach-Oracle Jan 14 2025

Yes,

that's correct as of Oracle Database Free 23.6.

- Martin

Solomon Yakobson Jan 14 2025

Thanks Martin, I hope this will be added to 23AI docs soon.

SY.

1 - 6

Post Details

Added on Jul 20 2023
6 comments
587 views