
How to Write Logon Triggers in Oracle
Record who connects with AFTER LOGON triggers and keep a history of schema changes with AFTER DDL triggers, and manage your triggers.
Explore comprehensive Oracle SQL resources designed for database developers and administrators. Our guides cover everything from basic query construction to advanced techniques for complex joins, analytical functions, and hierarchical data manipulation. Learn practical approaches to performance optimization through execution plan analysis, smart indexing strategies, and efficient table partitioning. Discover best practices for data modeling, constraint management, and large dataset handling that solve real business challenges. Whether you're writing reports, building data warehouses, or maintaining enterprise databases, enhance your Oracle SQL proficiency with our actionable insights.

Record who connects with AFTER LOGON triggers and keep a history of schema changes with AFTER DDL triggers, and manage your triggers.

Let many transactions update seats, stock, or balances on the same row at once with reservable columns, while constraints still hold.

See how a deadlock happens and how Oracle breaks it with ORA-00060, where it is recorded, and how to keep deadlocks from recurring.

Lock the rows you read until you update them with SELECT FOR UPDATE, and use NOWAIT, WAIT, and SKIP LOCKED to control waiting.

Choose between READ COMMITTED, SERIALIZABLE, and READ ONLY transactions in Oracle, and know what each query sees and when ORA-08177 appears.

Reuse an expression across queries with a function marked SQL_MACRO(SCALAR), which Oracle expands into plain SQL when the query is parsed.

Create a subtype that inherits from a supertype, override its methods, and test and narrow values with IS OF and TREAT.

Replace slow row-by-row loops with FORALL, which sends one DML statement for a whole collection, and see how much faster it is.

See how concatenated input rewrites a query, stop it with bind variables, and validate table and column names with DBMS_ASSERT.

Make views over joins and aggregates updatable with INSTEAD OF triggers that turn DML on the view into the changes you choose on its tables.

Combine statement-level and row-level trigger logic in one compound trigger with shared variables, to read once, check each row, and report once.

Understand why a row trigger cannot query its own table, and fix ORA-04091 with a compound trigger that reads the data before the rows change.

Run trigger logic once per statement instead of once per row, to forbid operations such as deletes or to log batch changes.

Reset package variables with every database call using PRAGMA SERIALLY_REUSABLE, and see how it differs from normal session-long state.

Give package functions one name for different kinds of arguments with overloading, and avoid the ambiguous versions that cause PLS-00307.

Protect internal helper code by listing the only program units allowed to call it with ACCESSIBLE BY, checked when callers compile.

Decide whether a PL/SQL unit runs with its owner's or its caller's privileges with AUTHID, and when each choice is the right one.

Cut the cost of switching between SQL and PL/SQL for functions called from queries with PRAGMA UDF, and know the alternatives.