PL/SQL
-
Understanding Oracle’s Deterministic Functions

Introduction Disclaimer This article on Oracle deterministic functions includes observations and statements related to performance that are inherently context-dependent and, in some cases, open to debate. Performance characteristics can vary significantly based on factors such as data volume, execution plans, database configuration, and specific use cases. The intent of this article is not to present…
-
Effective String Manipulation with Oracle REPLACE

The Oracle REPLACE function is a versatile string manipulation tool for substituting substrings in SQL and PL/SQL. It facilitates data cleaning, formatting, and normalization while being case-sensitive. Common use cases include removing special characters, masking sensitive data, and handling HTML tags. When pattern matching is necessary, REGEXP_REPLACE is recommended.
-
Unlock Oracle’s DBMS_APPLICATION_INFO: A Guide

DBMS_APPLICATION_INFO is a PL/SQL package designed for Oracle that helps developers and DBAs monitor and debug database sessions. It allows tagging sessions with specific module and action names, enhancing visibility into long-running operations. Proper usage of this feature can streamline troubleshooting and improve application performance.
-
Boosting Oracle Performance with PL/SQL Result Cache

The PL/SQL Result Cache is an Oracle feature that stores function call results in memory, enhancing performance by eliminating redundant computations. It is beneficial for repeated queries, lookup functions, and expensive calculations. Developers should use it with rarely changing data and deterministic functions while monitoring cache usage for optimal results.
-
Understanding Oracle SQL INSERT RETURNING Syntax and Usage

This article elaborates on the Oracle SQL INSERT … RETURNING clause, which allows retrieval of values from affected rows in DML statements without a separate query. It highlights its use in obtaining auto-generated keys, reduces database round-trips, and improves performance. The article includes syntax details, examples of usage, performance benefits, and best practices for effective…
-
Oracle SQL: Efficient DELETE with Subqueries Explained

The article discusses strategies for using the DELETE statement in Oracle SQL, emphasizing its reliance on subqueries, EXISTS conditions, and correlated methods due to the absence of JOINs in DELETE operations. Also, it addresses performance considerations, best practices for handling large deletes, and common errors, while underscoring the importance of referential integrity.
-
Oracle SQL: DELETE … RETURNING: Efficient Data Removal with Immediate Feedback

The article discusses the Oracle Database feature “DELETE … RETURNING,” which allows for the deletion of rows while simultaneously retrieving data from those rows. This simplifies operations, reduces network round-trips, and enhances performance. It highlights Oracle’s advanced capabilities, making it invaluable for efficient data manipulation and maintaining records in enterprise systems.
-
Control DDL Commands in Oracle Databases

This article discusses implementing a database-level trigger to manage and restrict DDL operations by limiting access to specific users. Unauthorized users attempting DDL actions will encounter a custom error message. The trigger code is provided, along with examples of error stacks generated from prohibited actions such as adding a column or truncating a table. This…
-
How to Detect Unused PL/SQL Objects in Oracle

To identify unused PL/SQL code in an Oracle database, several methods are recommended. Strategies include auditing PL/SQL execution, using DBA_DEPENDENCIES views to track dependencies, and analyzing execution data through DBMS_PROFILER. A process for safely removing unused code should be established, including renaming suspected units and ensuring backups before deletion.
-
Oracle Database: Constraints Tutorial

This article compiles various queries and code blocks used to manage disabled constraints in a database schema. It includes SQL statements to identify and enable these constraints. The content will be updated regularly with new insights, and it lists the tested database versions, starting with Oracle Database 23ai.
-
Ensuring PL/SQL Code Integrity with Checksums

The content explains how to implement a checksum for PL/SQL procedures to detect unauthorized modifications. It details steps for generating a checksum using Oracle’s DBMS_CRYPTO, storing it for future verification, and comparing it against current values. This approach helps ensure the integrity of PL/SQL procedures over time.