Thursday, August 7, 2025

Performance issue : Handling SQL Version Count Issues with High-Volume Kafka Inserts on ExaCS

 






Intro 

We are in the era of AI, where increasing processing power is crucial for handling growing and complex workloads. As enterprise systems continue to scale, database performance challenges become increasingly common, especially under high-throughput operations. In my experience, no other database platform matches Oracle’s flexibility and tooling when it comes to identifying and resolving such performance issues.

Recently, we encountered a performance bottleneck in an Exadata Cloud@Customer (ExaCS) environment, where the database was handling a high volume of insert operations coming from a Kafka stream.

In this article, I’ll walk through the technical details of the SQL version count issue we faced and the solution we implemented to stabilize performance.

The Issue: Excessive SQL Versioning and Hard Parses

The ExaCS database was receiving a continuous stream of dynamically structured INSERT statements from Kafka. The column structure of these inserts varied significantly; some contained 100 columns, while others had up to 150. This variation was ongoing and unpredictable.

Due to these structural differences, Oracle’s optimizer treated each statement as a unique SQL. As a result, the database began to experience:
  • Excessive hard parses

  • High CPU utilization

  • Shared pool contention and pressure

Even though we were running Oracle 19.24, which includes enhancements to SQL plan management and version count handling, the optimizer still created new cursor versions for each structurally distinct INSERT, which led to rapid cursor growth and degraded overall performance.


                                    
                                        Figure 1: AWR report for Oracle SQLID version count


Temporary Workaround: Manual Flushing of High Version Count Cursors

As an immediate mitigation step, we identified the SQLs with high version counts and manually flushed them from the shared pool using their memory IDs. This helped temporarily relieve pressure on CPU and memory by:

  • Reducing shared pool bloat

  • Freeing up memory consumed by excessive cursor versions

  • Preventing further hard parsing on the same overloaded SQL

However, it's important to note that this is only a temporary workaround. The relief is short-lived, as the issue resurfaces once new INSERT statements with varying structures continue streaming in from Kafka.

    To clarify, this issue has not been resolved in Oracle 19.24, despite the version including several recent patches and updates. Here’s the output from the environment confirming the exact patch level:
    
    [oracle@exaprd01-node01 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
    34697081;NOT SHIPPING LIBAUTH_SDK_IAM.SO IN 23 SHIPHOME INSTALL
    36538667;JDK BUNDLE PATCH 19.0.0.0.240716
    36414915;OJVM RELEASE UPDATE: 19.24.0.0.240716 (36414915)
    36587798;OCW RELEASE UPDATE 19.24.0.0.0 (36587798)
    36582781;Database Release Update : 19.24.0.0.240716 (36582781)
    OPatch succeeded.
    [oracle@exaprd01-node01 ~]$
    


    To monitor and identify SQL statements with high version counts typically those contributing to shared pool pressure, you can use the following query:
    
    SELECT version_count, sql_id, sql_text FROM   v$sqlarea WHERE  version_count >  512;
    
    For any SQLs with unusually high version counts, manual flushing can be performed as a short-term mitigation step using the following commands:

    select inst_id,ADDRESS, HASH_VALUE from V$SQLAREA where SQL_ID like '&sqlid';
    exec sys.DBMS_SHARED_POOL.PURGE ('-ADDRESS-, -HASH-VALUE-', 'C');
    

    Note: Use manual flushing with caution, especially in production environments, as it may impact performance for frequently executed queries.

    Permanent Solution

    To address the high version count issue more permanently, Oracle provides specific guidance in the following My Oracle Support note:

    High Version Counts For SQL Statements (>1024) Post Upgrade To 12.2 and Above Causing Database Slow Performance Doc ID 2431353.1

    As per the recommendation, you should add the following initialization parameter _cursor_obsolete_threshold = <recommended_value>

    This parameter helps control the number of obsolete child cursors and can significantly reduce version count growth, improving shared pool performance and overall database stability.

    If you’re running in a RAC environment, apply this change and restart the database instances in a rolling fashion to avoid downtime.

    
    alter system set “_cursor_obsolete_threshold”=1024 scope=spfile;
    

    Conclusion

    This issue showed us how dynamic SQL from systems like Kafka can create serious performance problems, even in powerful environments like Exadata Cloud@Customer. Because each INSERT had a slightly different structure, Oracle treated them as new statements, leading to too many cursor versions, high CPU usage, and shared pool pressure.

    Even though we were on Oracle 19.24, the problem still occurred. The key was identifying the root cause and taking action, monitoring version counts, applying a temporary fix, and then implementing a permanent solution using the _cursor_obsolete_threshold parameter.

    In short, managing SQL behavior and understanding how Oracle handles different workloads is critical for keeping your systems running smoothly, especially in today’s fast-moving, high-volume environments.

    Friday, August 1, 2025

    OLVM : Expanding Fiber Channel (FC) Support in OLVM Using a Data Domain Storage System

     




    Intro

    We are living in a data-driven era where AI is advancing rapidly, placing even greater demands on processing power and virtualized environments. While cloud adoption continues to grow—largely fueled by virtualization—many organizations still rely heavily on their on-premises virtual infrastructure alongside cloud technologies.

    Oracle Linux Virtualization Manager (OLVM) is quickly emerging as a strong alternative, addressing key gaps left by other platforms like VMware. With Broadcom tightening its licensing policies, many organizations are now considering a move away from VMware. For those looking to transition, OLVM stands out as a reliable and cost-effective option, backed by Oracle’s 24/7 enterprise-grade support.

    In this article, I’ll walk you through how to expand Fiber Channel (FC) support in OLVM using a Data Domain storage system.

    Document Reference:

    OLVM: Expanding the Size of a Storage Domain (FC/iSCSI) (Doc ID 2881013.1)

    Steps to increase the FC data domain :

    • Increase the Storage LUN at the SAN level.
    • On all KVM hypervisors where the storage is mounted, execute the following command:/usr/bin/rescan-scsi-bus.sh
    • Increase the size of the Data Domain from the OLVM storage side.


    This is a sample output from executing /usr/bin/rescan-scsi-bus.sh.

    Please ensure any issues are resolved before proceeding with the disk size increase from the OLVM side.

    Sample output :


    
    [root@kvm01 ~]# /usr/bin/rescan-scsi-bus.sh
    Scanning SCSI subsystem for new devices
    Scanning host 0 for  SCSI target IDs  0 1 2 3 4 5 6 7, all LUNs
     Scanning for device 0 0 0 0 ...
    OLD: Host: scsi0 Channel: 00 Id: 00 Lun: 00
          Vendor: Generic- Model: SD/MMC CRW       Rev: 1.00
          Type:   Direct-Access                    ANSI SCSI revision: 06
    .Scanning host 1 for  all SCSI target IDs, all LUNs
     Scanning for device 1 0 0 0 ...
    OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 00
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 0 1 ...
    OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 01
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 0 2 ...
    OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 02
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 0 3 ...
    OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 03
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 0 5 ...
    OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 05
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 0 9 ...
    OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 09
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 0 10 ...
    OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 10
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 0 11 ...
    OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 11
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 1 0 ...
    OLD: Host: scsi1 Channel: 00 Id: 01 Lun: 00
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 1 1 ...
    OLD: Host: scsi1 Channel: 00 Id: 01 Lun: 01
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 1 2 ...
    OLD: Host: scsi1 Channel: 00 Id: 01 Lun: 02
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 1 3 ...
    OLD: Host: scsi1 Channel: 00 Id: 01 Lun: 03
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 1 5 ...
    OLD: Host: scsi1 Channel: 00 Id: 01 Lun: 05
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 1 9 ...
    OLD: Host: scsi1 Channel: 00 Id: 01 Lun: 09
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 1 10 ...
    OLD: Host: scsi1 Channel: 00 Id: 01 Lun: 10
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 1 0 1 11 ...
    OLD: Host: scsi1 Channel: 00 Id: 01 Lun: 11
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
    Scanning host 2 for  SCSI target IDs  0 1 2 3 4 5 6 7, all LUNs
     Scanning for device 2 0 0 0 ...
    OLD: Host: scsi2 Channel: 00 Id: 00 Lun: 00
          Vendor: HPE      Model: Smart Adapter    Rev: 3.53
          Type:   Enclosure                        ANSI SCSI revision: 05
     Scanning for device 2 1 0 0 ... 0 ...
    OLD: Host: scsi2 Channel: 01 Id: 00 Lun: 00
          Vendor: HPE      Model: LOGICAL VOLUME   Rev: 3.53
          Type:   Direct-Access                    ANSI SCSI revision: 05
     Scanning for device 2 2 0 0 ... 0 ...
    OLD: Host: scsi2 Channel: 02 Id: 00 Lun: 00
          Vendor: HPE      Model: P408i-a SR Gen10 Rev: 3.53
          Type:   RAID                             ANSI SCSI revision: 05
    Scanning host 3 for  all SCSI target IDs, all LUNs
     Scanning for device 3 0 0 0 ...
    OLD: Host: scsi3 Channel: 00 Id: 00 Lun: 00
          Vendor: DGC      Model: VRAID            Rev: 0532
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 3 0 0 1 ...
    OLD: Host: scsi3 Channel: 00 Id: 00 Lun: 01
          Vendor: DGC      Model: VRAID            Rev: 0532
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 3 0 0 2 ...
    OLD: Host: scsi3 Channel: 00 Id: 00 Lun: 02
          Vendor: DGC      Model: VRAID            Rev: 0532
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 3 0 1 0 ...
    OLD: Host: scsi3 Channel: 00 Id: 01 Lun: 00
          Vendor: DGC      Model: VRAID            Rev: 0532
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 3 0 1 1 ...
    OLD: Host: scsi3 Channel: 00 Id: 01 Lun: 01
          Vendor: DGC      Model: VRAID            Rev: 0532
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 3 0 1 2 ...
    OLD: Host: scsi3 Channel: 00 Id: 01 Lun: 02
          Vendor: DGC      Model: VRAID            Rev: 0532
          Type:   Direct-Access                    ANSI SCSI revision: 04
    Scanning host 4 for  all SCSI target IDs, all LUNs
     Scanning for device 4 0 0 0 ...
    OLD: Host: scsi4 Channel: 00 Id: 00 Lun: 00
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 0 1 ...
    OLD: Host: scsi4 Channel: 00 Id: 00 Lun: 01
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 0 2 ...
    OLD: Host: scsi4 Channel: 00 Id: 00 Lun: 02
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 0 3 ...
    OLD: Host: scsi4 Channel: 00 Id: 00 Lun: 03
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 0 5 ...
    OLD: Host: scsi4 Channel: 00 Id: 00 Lun: 05
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 0 9 ...
    OLD: Host: scsi4 Channel: 00 Id: 00 Lun: 09
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 0 10 ...
    OLD: Host: scsi4 Channel: 00 Id: 00 Lun: 10
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 0 11 ...
    OLD: Host: scsi4 Channel: 00 Id: 00 Lun: 11
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 1 0 ...
    OLD: Host: scsi4 Channel: 00 Id: 01 Lun: 00
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 1 1 ...
    OLD: Host: scsi4 Channel: 00 Id: 01 Lun: 01
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 1 2 ...
    OLD: Host: scsi4 Channel: 00 Id: 01 Lun: 02
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 1 3 ...
    OLD: Host: scsi4 Channel: 00 Id: 01 Lun: 03
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 1 5 ...
    OLD: Host: scsi4 Channel: 00 Id: 01 Lun: 05
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 1 9 ...
    OLD: Host: scsi4 Channel: 00 Id: 01 Lun: 09
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 1 10 ...
    OLD: Host: scsi4 Channel: 00 Id: 01 Lun: 10
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
     Scanning for device 4 0 1 11 ...
    OLD: Host: scsi4 Channel: 00 Id: 01 Lun: 11
          Vendor: DGC      Model: VRAID            Rev: 0430
          Type:   Direct-Access                    ANSI SCSI revision: 04
    Scanning host 5 for  all SCSI target IDs, all LUNs
    0 new or changed device(s) found.
    0 remapped or resized device(s) found.
    0 device(s) removed.
    
    


    Once the rescan is completed on all KVM hosts, the next step is to increase the Data Domain from the storage side.

    Keep in mind that even if you extend the LUN at the SAN level, the change will not automatically reflect in the Data Domain.

    From OLVM : Navigate to Storage >  Storage Domain > (Select respective data domain) > Select Manage domain as higlighted below.

                                                           
                                                        Figure 1 : Select Manage Domain

    The Manage Windows interface will display the updated size, allowing you to increase it as needed.


                                                   Figure 2 : Manage window

    Now, select the desired size and click OK to apply the increase.



                                                   Figure 3: Increase in size.

    Now Data Domain will reflect the new size.


    Figure: Data domain after an increase in size. 

    Conclusion 

    In today's evolving IT landscape, organizations are under increasing pressure to modernize infrastructure while maintaining flexibility, control, and cost-efficiency. As AI and data workloads grow, the need for robust, scalable virtualization solutions becomes even more critical.

    With Broadcom’s licensing changes pushing many to reconsider their reliance on VMware, OLVM offers a compelling path forward. It not only fills the functionality gaps but also provides enterprise-grade reliability, backed by Oracle’s 24/7 support.

    Whether you're planning a full migration or building out a hybrid environment, OLVM is well-positioned to meet the demands of modern workloads. In this article, we explored how to extend Fiber Channel (FC) capabilities in OLVM using Data Domain, helping organizations take a step forward in building a resilient and future-ready virtual infrastructure.


    Performance issue : Handling SQL Version Count Issues with High-Volume Kafka Inserts on ExaCS

      Intro  We are in the era of AI, where increasing processing power is crucial for handling growing and complex workloads. As ent...