Introduction

Understanding the Feature Through Internals and Performance Analysis

Oracle sequences have long been the preferred mechanism for generating unique identifiers in Oracle Database applications. Their lightweight architecture and efficient caching mechanism make them well suited for high-throughput OLTP workloads. However, as application concurrency increases, the frequency of sequence cache replenishment also increases, eventually becoming a source of contention that can limit scalability.

For many years, the recommended solution was to increase the sequence CACHE value. Larger caches reduced the number of cache replenishment operations and significantly improved scalability, but the approach relied on manual tuning and required DBAs to estimate an appropriate cache size for each workload.

Sequence Dynamic Cache Resizing is a sequence performance enhancement introduced in Oracle Database 19.10 and available in later releases. Rather than relying solely on a fixed cache size, Oracle automatically adapts the effective sequence cache according to runtime workload characteristics, reducing cache replenishment overhead while remaining completely transparent to the application.

In this article, we examine how the feature works, explore the internal implementation at a high level, and validate its behavior through reproducible benchmarks, SQL Trace, Oracle Enterprise Manager, AWR analysis, and Oracle RAC validation.

Why Oracle Caches Sequence Values

Oracle sequences achieve their performance by caching sequence values in memory. Rather than updating the sequence metadata every time an application requests NEXTVAL, Oracle preallocates a configurable range of sequence values based on the configured CACHE value.

CREATE SEQUENCE order_seq
    START WITH 1
    INCREMENT BY 1
    CACHE 20;

With this definition, Oracle allocates the first twenty sequence values into memory. Subsequent calls to NEXTVAL are therefore satisfied directly from the in-memory cache without requiring a data dictionary update.

This approach makes sequence generation extremely efficient for the majority of applications because most requests never need to access the underlying sequence metadata. Eventually, however, the allocated cache is exhausted and Oracle must allocate another range of sequence values before processing additional NEXTVAL requests.

Understanding Cache Replenishment

When the current sequence cache has been consumed, Oracle performs a cache replenishment operation to allocate the next range of sequence values. Internally, Oracle advances the sequence metadata stored in the data dictionary by executing a recursive UPDATE SEQ$ statement similar to the one shown below.

UPDATE seq$
   SET increment$ = :2,   -- Sequence increment value
       minvalue   = :3,   -- Minimum value defined for the sequence
       maxvalue   = :4,   -- Maximum value defined for the sequence
       cycle#     = :5,   -- Indicates whether the sequence cycles
       order$     = :6,   -- ORDER or NOORDER attribute
       cache      = :7,   -- Configured CACHE value
       highwater  = :8,   -- Upper boundary of the allocated sequence cache
       audit$     = :9,   -- Internal audit metadata
       flags      = :10   -- Internal sequence attributes and feature flags
 WHERE obj#       = :1;   -- Internal object identifier of the sequence

Of particular interest are the CACHE and HIGHWATER columns. During each cache replenishment, Oracle advances the HIGHWATER value to reserve the next range of sequence numbers before loading that range into the in-memory cache.

Although this operation is typically very fast, it is not free. Every cache replenishment requires Oracle to update the sequence metadata before additional sequence values can be allocated.

Under heavy concurrency, multiple sessions may exhaust their caches at approximately the same time. Because the sequence metadata must be updated serially, these sessions wait while Oracle allocates the next cache range. This serialization is observed as enq: SQ – contention, which has historically been one of the primary scalability bottlenecks for sequence-intensive workloads.

The Traditional Solution

For many years, the standard approach to reducing sequence contention was straightforward: increase the sequence CACHE value. Larger cache sizes reduce the frequency of cache replenishment, which in turn reduces the number of recursive UPDATE SEQ$ operations and the likelihood of concurrent sessions waiting for sequence allocation.

For busy OLTP systems, recommendations such as increasing the cache size from the default value of 20 to 2,000 or even 5,000 or more were common practice and often proved highly effective. The limitation, however, was that the cache size remained static. A value that was appropriate for one workload might be unnecessarily large for another, while a cache that performed well today might become inadequate as application concurrency increased over time.

This naturally raises the next question:

Can Oracle automatically determine the appropriate cache size instead of relying on manual tuning?

Sequence Dynamic Cache Resizing was introduced to answer exactly that question.

Sequence Dynamic Cache Resizing

As discussed in the previous section, increasing the sequence CACHE value has traditionally been an effective way to reduce the frequency of cache replenishment and the associated maintenance overhead. While this approach works well, it requires DBAs to manually select a cache size that best matches the application’s workload.

To address this limitation, Oracle Database introduced Sequence Dynamic Cache Resizing. Instead of relying solely on a statically configured cache size, Oracle can automatically adjust the effective sequence cache based on runtime workload characteristics. This enables the database to respond to changing workload demands without requiring application changes or manual cache tuning.

How It Works

Sequence Dynamic Cache Resizing is based on a simple principle: the effective cache size should reflect the rate at which sequence values are being consumed rather than relying on a fixed cache size throughout the lifetime of the sequence.

Oracle estimates the sequence consumption rate on each database instance and projects the number of sequence values required over approximately the next 10 seconds. During the next cache replenishment, Oracle allocates an effective cache size large enough to satisfy the projected demand while remaining within predefined operating limits.

For example, if an instance is consuming sequence values at a rate of approximately 300 values per second, Oracle projects that it will require approximately 3,000 values over the next ten seconds (300 × 10 = 3,000). During the next cache replenishment, Oracle can therefore allocate an effective cache of approximately 3,000 sequence values, subject to the configured operating limits.

Cache sizing is performed independently for each database instance, allowing every instance to adapt its effective cache size according to its own workload.

Initialization Parameters

Sequence Dynamic Cache Resizing is enabled by default and is controlled by the following initialization parameters and is managed at instance-level. Currently, the feature cannot be enabled or configured on a per-sequence basis.

Initialization ParameterDefaultDescription
_dynamic_sequence_cacheTRUEEnables or disables Sequence Dynamic Cache Resizing.
_dynamic_sequence_cache_scale10Specifies the maximum factor by which Oracle can increase the effective sequence cache. If the current cache size is 20, Oracle can increase it to at most 20 × N, where N is the value of this parameter.
_dynamic_sequence_cache_max1000000Specifies the maximum effective sequence cache size. Oracle limits the resized cache to the smaller of Current Cache × Scale and _dynamic_sequence_cache_max.
Table 1 – Initialization Parameter

Note: These are internal initialization parameters provided to aid understanding of the feature. As with other underscore parameters, they should not be modified unless directed by Oracle Support.

Although Sequence Dynamic Cache Resizing is enabled by default, there are specific scenarios in which Oracle restricts or disables the feature to preserve sequence semantics and correctness.

Cycle Sequences

For sequences created with the CYCLE attribute, the effective cache size cannot exceed the number of values available within a single sequence cycle. This ensures that cache allocation remains consistent with the defined sequence boundaries.

Ordered Sequences in Oracle RAC

Sequence Dynamic Cache Resizing is not applied to ORDER sequences in Oracle RAC environments.

For ordered sequences, Oracle maintains global ordering across all RAC instances by coordinating sequence allocation through an instance lock. The lock value represents the last sequence value allocated and is used by each instance to determine the next high-water mark during cache replenishment.

Because this calculation assumes a fixed cache size, dynamically changing the cache size could lead to an incorrect high-water mark calculation. Supporting dynamic cache sizing in this scenario would require Oracle to consult the row cache during cache allocation, introducing additional synchronization overhead that would negate much of the intended performance benefit.

For this reason, Oracle disables Sequence Dynamic Cache Resizing for ordered sequences in Oracle RAC while continuing to preserve the global ordering guarantees provided by the ORDER attribute.

Test environment

The benchmark presented in this article was performed using Oracle Database 19.31 running on a single-instance Oracle Linux 9 system with 8 vCPUs.

Although Sequence Dynamic Cache Resizing is particularly beneficial for high-concurrency RAC environments, the experiments presented in this article focus on a single-instance database to clearly demonstrate the feature’s behavior and internal implementation. Where appropriate, RAC-specific considerations are discussed separately.

All benchmark results, SQL trace analysis, and Oracle Enterprise Manager screenshots shown throughout this article were generated from this test environment.

Benchmark Design

To evaluate Sequence Dynamic Cache Resizing, a simple sequence-intensive workload was designed around repeated row inserts into a single table. The goal of the benchmark was not to simulate a full application stack, but to create a repeatable workload that places sustained pressure on sequence generation and makes cache replenishment behavior easy to observe.

The benchmark uses a sequence defined with a small cache size of 20 so that cache replenishment occurs frequently enough to make the behavior visible under load.

CREATE SEQUENCE seq_bench_seq
  START WITH 1
  INCREMENT BY 1
  CACHE 20
  NOORDER;

The target table stores the generated sequence value along with a run tag and the sequence cache information observed at insert time.

CREATE TABLE sequence_test (
    seq_val      NUMBER NOT NULL,
    run_tag      VARCHAR2(30),
    cache_size   NUMBER,
    last_number  NUMBER,
    created_at   TIMESTAMP DEFAULT SYSTIMESTAMP
);
  NOORDER;

The workload itself is implemented as a PL/SQL procedure. For each row, the procedure reads the current sequence metadata from USER_SEQUENCES, generates the next sequence value, and inserts both values into the table. A commit is issued every 1,000 rows to keep the transaction size controlled while still allowing the session to sustain a high insert rate.

CREATE OR REPLACE PROCEDURE run_seq_bench(
    p_rows NUMBER,
    p_tag  VARCHAR2
) AS
    l_cache_size  NUMBER;
    l_last_number NUMBER;
BEGIN
  DBMS_APPLICATION_INFO.SET_MODULE('SEQ_BENCH', p_tag);

  FOR i IN 1 .. p_rows LOOP
    SELECT cache_size, last_number
      INTO l_cache_size, l_last_number
      FROM user_sequences
     WHERE sequence_name = UPPER('SEQ_BENCH_SEQ');

    INSERT /* SEQ_BENCH */ INTO sequence_test
      (seq_val, run_tag, cache_size, last_number)
    VALUES
      (seq_bench_seq.NEXTVAL, p_tag, l_cache_size, l_last_number);

    IF MOD(i, 1000) = 0 THEN
      COMMIT;
    END IF;
  END LOOP;

  COMMIT;
END;
/

Each session executes the procedure for 200,000 rows.

EXEC run_seq_bench(200000, 'LOAD_A'); -- LOAD_B for enabled workload

To generate sustained concurrency, the benchmark launches 20 SQL*Plus sessions in parallel, with each session running the same 200,000-row insert workload.

sqlplus / as sysdba @seq_load_test_LOAD_A.sql &
sqlplus / as sysdba @seq_load_test_LOAD_A.sql &
..

Overall, the benchmark generated approximately 4 million sequence values using 20 concurrent sessions, providing a sustained sequence-intensive workload for evaluating cache replenishment behavior.

Benchmark Observations

To evaluate the effectiveness of Sequence Dynamic Cache Resizing, the benchmark was executed twice using identical workloads. The only difference between the two executions was whether Dynamic Sequence Cache Resizing was enabled. The workload, sequence definition, number of concurrent sessions, and commit frequency remained unchanged throughout the tests, ensuring that any observed differences could be attributed solely to the feature.

Observation 1 – Overall Benchmark Performance

The most immediate difference between the two benchmark executions is the overall elapsed time. With Sequence Dynamic Cache Resizing disabled, the benchmark completed in approximately 14 minutes. Repeating the identical workload with Sequence Dynamic Cache Resizing enabled reduced the execution time to approximately 4 minutes, representing an improvement of approximately 71%.

BenchmarkDisabledEnabled
Concurrent Sessions2020
Rows per Session200,000200,000
Total Sequence Allocations~4 Million~4 Million
Elapsed Time14 minutes4 minutes
Table 2 – Benchmark Workload

This reduction in elapsed time demonstrates the benefit of adapting the sequence cache to match the workload. The following observations explain how Sequence Dynamic Cache Resizing changes the workload profile and why the benchmark completes significantly faster.

Observation 2 – OEM Workload Characteristics

Oracle Enterprise Manager (OEM) provides a high-level view of the workload during each benchmark execution. Figures 1 and 2 compare the Average Active Sessions (AAS) profile with Sequence Dynamic Cache Resizing disabled and enabled

Figure 1 – OEM Average Active Sessions (Sequence Dynamic Cache Resizing Disabled)
Figure 2 – OEM Average Active Sessions (Sequence Dynamic Cache Resizing Enabled)

Although both benchmark executions generated the same workload using 20 concurrent sessions, the workload profile changes noticeably once Sequence Dynamic Cache Resizing is enabled. As Oracle dynamically increases the effective sequence cache, cache replenishment occurs less frequently, reducing the amount of internal sequence maintenance required during workload execution

Observation 3 – Eliminating the Sequence Bottleneck

The AWR reports provide the clearest evidence of the feature’s impact.

With Sequence Dynamic Cache Resizing disabled, the workload is dominated by enq: SQ – contention, accounting for approximately 80.7% of total database time. This clearly identifies sequence allocation and cache replenishment as the primary bottleneck during workload execution.

After enabling Sequence Dynamic Cache Resizing and repeating the identical workload, enq: SQ – contention no longer appears in the Top Foreground Events. Instead, the workload becomes dominated by buffer busy waits.

Figure 3 – AWR Top Foreground Events (Sequence Dynamic Cache Resizing Disabled)
Figure 4 – AWR Top Foreground Events (Sequence Dynamic Cache Resizing Enabled)

Table 3 summarizes the most important differences between the two runs.

MetricDisabledEnabled
Elapsed Time14 min4 min
DB Time16,300 sec4,488 sec
Top Foreground Waitenq: SQ – contentionbuffer busy waits
enq: SQ – contention13,200 secNot in Top 10
Table 3 – Summary of workload

At first glance, the increase in buffer busy waits may appear to indicate a new performance bottleneck. In reality, it simply reflects the removal of the original one. With Sequence Dynamic Cache Resizing enabled, enq: SQ - contention is eliminated, allowing inserts to proceed at a much higher rate. As a result, contention naturally shifts to data blocks, making buffer busy waits the next limiting resource for this workload.

Observation 4 – Internal Sequence Activity

SQL Trace was enabled on the recursive UPDATE SEQ$ statement for sqlid 4m7m0t6fjcs5x.

SQL> alter system set events 'sql_trace[SQL:4m7m0t6fjcs5x] wait=false, bind=true';

The following trace excerpt shows the recursive SQL executed by Oracle whenever the sequence cache is exhausted and a new cache must be allocated.

PARSING IN CURSOR #140638525347192 len=129 dep=2 uid=0 oct=6 lid=0 tim=1358558970159 hv=2635489469 ad='18f0ea7c8' sqlid='4m7m0t6fjcs5x'
update seq$ set increment$=:2,minvalue=:3,maxvalue=:4,cycle#=:5,order$=:6,cache=:7,highwater=:8,audit$=:9,flags=:10 where obj#=:1
END OF STMT
BINDS #140638525347192:

Sequence Dynamic Cache Resizing – Enabled

When Sequence Dynamic Cache Resizing is enabled, Oracle dynamically increases the effective cache size based on workload demand, reducing the frequency of cache replenishment and the corresponding recursive UPDATE SEQ$ operations. Bind#6 represents the high-water mark, which corresponds to LAST_NUMBER in DBA_SEQUENCES.

Searching for Bind#6 in the trace file shows the progression of the high-water mark as Oracle adapts the cache to the workload.

Bind#6
oacdty=02 mxl=22(02) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=132bb1eff bln=22 avl=02 flg=09
value=21
Bind#6
oacdty=02 mxl=22(03) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=132bb1eff bln=22 avl=03 flg=09
value=221
Bind#6
oacdty=02 mxl=22(03) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=132bb1eff bln=22 avl=03 flg=09
value=2221
Bind#6
oacdty=02 mxl=22(04) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=132bb1eff bln=22 avl=04 flg=09
value=22221
...
....
Bind#6
oacdty=02 mxl=22(05) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=132bb1eff bln=22 avl=05 flg=09
value=3774833
Bind#6
oacdty=02 mxl=22(05) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=132bb1eff bln=22 avl=05 flg=09
value=3926130
Bind#6
oacdty=02 mxl=22(05) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=132bb1eff bln=22 avl=05 flg=09
value=4103834

When filtering the data inserted into the sequence_test table during the test when the LAST_NUMBER changes , the high-water mark was increased 28 times.

SQL> select executions, sql_text from v$sql  where sql_id='4m7m0t6fjcs5x';
EXECUTIONS SQL_TEXT
_____________ __________________________________________________________________
28 update seq$ setincrement$=:2,minvalue=:3,maxvalue=:4,
cycle#=:5, order$=:6,cache=:7,highwater=:8,audit$=:9,flags=:10
where obj#=:1

Table 4 – Run data with Sequence Dynamic Cache resize enabled

LAST_NUMBER is the last sequence number written to disk. If a sequence uses caching, the number written to disk is the last number placed in the sequence cache. This number is likely to be greater than the last sequence number that was used.

The first few replenishments show that Oracle appears to be increasing the effective cache by the maximum scale factor while the workload is ramping up, i.e. 10×.

Until the highwater mark reaches 22,221, Oracle increases the effective cache by 10× at each replenishment during the initial ramp-up. From sequence value 22,241 onward, Oracle estimates the sequence consumption rate and projects the number of sequence values required over approximately the next 10 seconds, increasing the high-water mark to 197,740.

After the initial ramp-up, the same 10-second projection pattern continues as the workload stabilizes.

Sequence Dynamic Cache Resizing – Disabled

With Sequence Dynamic Cache Resizing disabled, Oracle performs frequent executions of the recursive UPDATE SEQ$ statement as the configured sequence cache is repeatedly exhausted. Searching for “Bind#6” in the trace file shows as below

Bind#6
oacdty=02 mxl=22(02) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=11faddb1f bln=22 avl=02 flg=09
value=21
Bind#6
oacdty=02 mxl=22(02) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=11faddb1f bln=22 avl=02 flg=09
value=41
Bind#6
oacdty=02 mxl=22(02) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=11faddb1f bln=22 avl=02 flg=09
value=61
Bind#6
oacdty=02 mxl=22(02) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=11faddb1f bln=22 avl=02 flg=09
value=81
Bind#6
oacdty=02 mxl=22(03) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=11faddb1f bln=22 avl=03 flg=09
value=101
Bind#6
oacdty=02 mxl=22(03) mxlc=00 mal=00 scl=00 pre=00
oacflg=10 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=11faddb1f bln=22 avl=03 flg=09
value=121
....

Cache replenishment is performed every 20 sequence values when the cache size is fixed and no projection is used. The metadata shows that 200,001 high-water-mark increases occurred while inserting 4 million rows with a cache value of 20.

SQL> select executions, sql_text from v$sql  where sql_id='4m7m0t6fjcs5x';
EXECUTIONS SQL_TEXT
_____________ __________________________________________________________________
200001 update seq$ set increment$=:2,minvalue=:3,maxvalue=:4,
cycle#=:5, order$=:6,cache=:7,highwater=:8,audit$=:9,flags=:10
where obj#=:1

That is approximately 238 executions per second, which explains why enq: SQ – contention appears when multiple sessions try to replenish the sequence cache at the same time and must serialize the SEQ$ update.


Table 5 – Run data with Sequence Dynamic Cache resize disabled

Validation in Oracle RAC

To validate the behavior of Sequence Dynamic Cache Resizing in a clustered environment, the same benchmark was repeated on a three-node Oracle RAC cluster using the identical workload and sequence definition. The results were consistent with those observed in the single-instance benchmark. Sequence Dynamic Cache Resizing continued to reduce sequence cache replenishment while allowing the workload to scale efficiently across the RAC cluster

Sequence Dynamic Cache Resizing Enabled

Figure 5 – Workload distribution in RAC with Sequence Dynamic Cache Resizing Enabled
Figure 6 – AAS in RAC with Sequence Dynamic Cache Resizing Enabled

Sequence Dynamic Cache Resizing Disabled

Figure 7 – Workload distribution in RAC with Sequence Dynamic Cache Resizing disabled
Figure 8 – AAS in RAC with Sequence Dynamic Cache Resizing disabled

Cluster TypeDisabledEnabled
Single Instance14 min4 min
RAC21 min7 min
Table 4 – Elapsed Time Comparison ( RAC vs Single Instance )

Considerations

Sequence Dynamic Cache Resizing significantly reduces the frequency of sequence cache replenishment under sustained concurrent workloads. Like any caching mechanism, however, it introduces a trade-off that DBAs should understand.

Larger Cache, Larger Potential Gap

Whenever Oracle caches sequence values, those values reside only in memory until they are consumed. If an instance terminates unexpectedly or the shared pool is flushed before the cache has been fully used, any remaining cached values are discarded.

This behavior is not unique to Sequence Dynamic Cache Resizing. Cached sequences have always been susceptible to gaps when unused cached values are lost. The difference is that Sequence Dynamic Cache Resizing can allocate a much larger effective cache under sustained workloads, increasing the number of sequence values that may be discarded if the cache is lost.

In this benchmark, the workload inserted approximately 4 million rows, leaving the sequence at 4,000,001. This provides a simple way to illustrate the difference between a fixed cache and a dynamically resized cache.

Sequence Dynamic Cache Resizing Enabled

With Sequence Dynamic Cache Resizing enabled, Oracle increased the effective cache size to match the workload. After generating two additional sequence values, the shared pool was flushed.

SQL> SELECT MAX(seq_val) FROM sequence_test;

MAX(SEQ_VAL)
------------
4000000

SQL> SELECT seq_bench_seq.NEXTVAL FROM dual;

NEXTVAL
-------
4000001

SQL> SELECT seq_bench_seq.NEXTVAL FROM dual;

NEXTVAL
-------
4000002

SQL> ALTER SYSTEM FLUSH SHARED_POOL;

System altered.

SQL> SELECT seq_bench_seq.NEXTVAL FROM dual;

NEXTVAL
-------
4139557

The next sequence value jumps from 4,000,002 to 4,139,557, indicating that approximately 139,555 cached sequence values were discarded when the shared pool was flushed

Sequence Dynamic Cache Resizing Disabled

The same experiment was repeated with Sequence Dynamic Cache Resizing disabled.

SQL> SELECT MAX(seq_val) FROM sequence_test;

MAX(SEQ_VAL)
------------
4000000

SQL> SELECT seq_bench_seq.NEXTVAL FROM dual;

NEXTVAL
-------
4000001

SQL> SELECT seq_bench_seq.NEXTVAL FROM dual;

NEXTVAL
-------
4000002

SQL> ALTER SYSTEM FLUSH SHARED_POOL;

System altered.

SQL> SELECT seq_bench_seq.NEXTVAL FROM dual;

NEXTVAL
-------
4000021

With the default cache size of 20, only the remaining cached sequence values are discarded. The next sequence value advances from 4,000,002 to 4,000,021, resulting in a gap of only 19 sequence values.

Why This Is Expected ?

The larger gap observed with Sequence Dynamic Cache Resizing is a direct consequence of allocating a larger effective cache to reduce cache replenishment overhead. While larger caches improve scalability under heavy workloads, they also increase the number of unused sequence values that may be lost if the cache is discarded before it is fully consumed.

This behavior should not be considered a limitation of the feature, but rather a characteristic of cached sequences. Oracle sequences are designed to generate unique values, not gap-free or ordered values. Applications should never rely on sequence values to indicate ordering. Sequence gaps can occur for many reasons, including rollbacks, instance failures, shared pool flushes, and cached sequence allocation. Sequence Dynamic Cache Resizing simply increases the size of the cache available to improve scalability and, consequently, the potential size of any gap should that cache be discarded

Conclusion

Sequence Dynamic Cache Resizing transforms sequence cache management from a manual tuning exercise into an adaptive, workload-aware mechanism. By reducing cache replenishment under sustained concurrency, it minimizes sequence contention and improves scalability while remaining completely transparent to applications. For sequence-intensive OLTP workloads, it provides a simple yet effective way to improve performance with minimal administration.

Author

  • Jomon Jacob is a Senior Principal Advanced Services Engineer in Oracle Customer Success Services (CSS) – Tech Delivery. With over 17 years at Oracle , he specializes in Oracle Cloud Infrastructure (OCI), Oracle Exadata, engineered systems, database technologies, performance optimization, and high availability. Through the Oracle Blog, Jomon shares practical insights, best practices, and real-world experiences to help customers and engineers get the most from Oracle technologies.