• cursordump sql text

    Finding failed sql queries with 10035 event tracing and database triggers in Oracle

    Cursordump is essential for detecting failed SQL parses in Oracle, as these failures are not stored in the data dictionary. Starting from Oracle 10g, event 10035 reports failed parses. With the 19.16 Release Update, SQL statements failing at parsing are logged with error numbers and OSPIDs but not in the alert.log. Using tools like the x$kglob table can help, but long statements may be undetectable. Implementing triggers for error logging can capture failures, but caution is needed to handle sensitive data and manage log sizes effectively.


  • select * from dba_mviews takes too long

    Why queries to the DBA_MVIEWS view are slow and Insights on SMON_SCN_TIME

    The execution time for the “Select * from dba_mviews” query in a specific database is 45 seconds, which is unacceptable and requires improvement. The complexity of the dba_mviews view, particularly the inclusion of specific columns and full table scans of internal tables like SYS.SUMDELTA$ and SYS.SMON_SCN_TIME, contributes to this delay. Solutions suggested include excluding certain columns, creating a new view, or even indexing. Ultimately, optimizing refresh periods and managing data efficiently significantly reduced execution time, demonstrating the importance of these adjustments for performance enhancement.


  • FBDA process uses excessive memory

    Flashback Data Archiver (FBDA) Queries are not using Bind Variables

    The excessive memory usage for SQL queries was discovered in a critical database, traced back to internal queries by the FBDA process. Hard parses, which are resource-intensive, were identified as the cause. The issue was detected through SQL plan and memory consumption analysis. A solution involving the use of bind variables and a workaround for the problem were proposed. A bug related to queries without bind variables was identified and it was revealed that a similar issue did not exist in another database using the flashback feature efficiently. The proposed workaround involved removing the quota clause from flashback data archives.