• Send email using notify and listen in PostgreSQL

    How to send mail from PostgreSQL database

    This content discusses methods for sending emails directly from a PostgreSQL database. Three approaches are highlighted: using PostgreSQL extensions like pgMail or pgSmtp, creating custom stored procedures with untrusted languages, and employing the LISTEN/NOTIFY mechanism to communicate with external services. The LISTEN/NOTIFY method is implemented in detailed steps: configuring Postfix for email delivery, creating a PostgreSQL table for email records, setting up a trigger, writing a Python listener, creating a systemd service, and managing logs. This solution provides a reliable method for managing emails directly from the database.


  • ACFS does not use inode architecture

    Oracle ACFS File System: Inode Limitations Explained

    This content discusses an issue with running out of inodes on a directory in the ACFS (Oracle Automatic Storage Management Cluster File System) file system after a large table export. Generally, even with sufficient disk space, a high number of small files can exhaust available inodes, prompting alerts. In this case, we have seen that ACFS doesn’t have a pre-allocated inode table; rather, it estimates inodes based on available space, leading to confusion during inode checks.


  • Improve RAC Network Performance

    Troubleshooting gc cr/current block lost events and Improving Oracle RAC Network Performance

    The Enterprise Manager Cloud Control’s Overview of Incidents and Problems section identified ‘Metrics Global Cache Blocks Lost at XXX’ for a relatively new database, suggesting a potential network issue, likely related to the private network interfaces. Troubleshooting was guided by My Oracle Support documents, which outline common causes and initial diagnostic steps. Further actions included making adjustments across nearly all OSI Model Layers; such as enabling jumbo frames, tuning NIC buffers, adjusting IP fragmentation parameters, and optimizing socket buffers as well as refining the database layer. These measures collectively reduced ‘gc block lost’ events to nearly zero.


  • Enq TX row lock analysis

    Resolving Enq: TX – Row Lock Contention with Real-life Scenario Analysis

    When encountering the Enq: TX – row lock contention wait event, it’s crucial to identify the root cause before taking action. This contention arises when multiple sessions attempt to modify the same row in a table simultaneously. To resolve it, database administrators should pinpoint the blocking session and sql statement. A detailed analysis of specific SQL statements can provide valuable insights for the development team, facilitating faster resolution.


  • Sql cursors invalidated

    v$sql INVALIDATION column and Prevent SQL Cursor Invalidation

    This content highlights the impact of SQL cursor invalidation on system performance and suggests solutions to reduce the number of hard parses. It emphasizes the importance of avoiding hard parses in OLTP systems and discusses reasons for SQL cursor invalidation, such as schema changes, statistics updates and parameter changes. The implementation of atomic refresh for materialized views is presented as a solution to reduce SQL cursor invalidations leading to improved performance in OLTP systems.


  • haproxy external sql check

    How to configure HAProxy with external-check to query PostgreSQL database directly

    The blog post discusses configuring HAProxy with an external check to query PostgreSQL directly for database server health monitoring. Choosing to deploy PgBouncer on database hosts led to the decision to use an external check in HAProxy. The configuration and benefits of this setup are detailed, along with sample HAProxy configurations for external checks. Deploying PgBouncer directly on PostgreSQL servers minimized network latency and simplified architecture while securing local connections.