Database-Administration
Oracle DBMS_STATS: Delete Database Statistics
Jan 16, 2025 / · 3 min read · Oracle Database Performance Tuning SQL Database Administration Statistics Management DBMS_STATS ·Oracle Database: Deleting Statistics with DBMS_STATS Package Deleting optimizer statistics leaves a table with none, and the optimizer then falls back to dynamic statistics: it samples a few table blocks at parse time. The DBMS_STATS package has one delete procedure for each level, from the whole database down to a …
Read MoreOracle DBMS_STATS.GATHER_SYSTEM_STATS for Query Tuning
Jan 15, 2025 / · 2 min read · Oracle Database Performance Tuning SQL Database Administration Query Optimization GATHER_SYSTEM_STATS DBMS_STATS ·Optimizing Oracle Database Performance with GATHER_SYSTEM_STATS Oracle Database's DBMS_STATS package is a powerful tool for gathering and managing database statistics. This post focuses on the GATHER_SYSTEM_STATS procedure, which is crucial for optimizing query performance by collecting system-level statistics. …
Read MoreOracle Lock Conflicts with dba_lock and SQL*Plus Format
Sep 6, 2024 / · 3 min read · Database SQL Performance Troubleshooting Oracle Database Administration Performance Tuning dba_lock ·Oracle Database: Understanding Lock Conflicts with dba_lock and Column Formatting Purpose DBA_LOCK lists all locks or latches held in the database, and all outstanding requests for a lock or latch. This query reads that view to show which sessions hold or want each lock, the lock modes involved, and whether a lock is …
Read MoreIdentifying Locked Rows in Oracle Using v$session
Identifying Locked Rows in Oracle Database using tables v$session and dba_objects Purpose At 09:00 a user reports that an order screen has frozen. The user pressed Save, and nothing happens. The session is not busy with work. It is waiting. Another transaction changed the same row and has not finished, so the database …
Read MoreIdentify Locked Objects in Oracle Database
Sep 3, 2024 / · 16 min read · Oracle Database Administration SQL v$locked_object dba_objects v$lock v$session v$transaction ·Identify Locked Objects in Oracle Database using v$locked_object, dba_objects, v$lock and v$session Purpose A developer reports that an INSERT that should finish in seconds is still running after ten minutes. No error has come back to the application, no timeout has fired, and nothing is moving. In the vast majority of …
Read MoreOracle: Enable Disabled Foreign Key Constraints
Aug 3, 2024 / · 2 min read · Oracle SQL database DBA troubleshooting constraints Database Administration dba_constraints ·Enabling Disabled Foreign Key Constraints in Oracle Database using dba_constraints Purpose This SQL query generates a list of SQL statements that can be executed to enable all disabled foreign key constraints in an Oracle database. Sample SQL Command 1set lines 100 pages 999 2select 'alter table …
Read MoreOracle: List Tables Using a Table as a Foreign Key
Jun 18, 2024 / · 6 min read · Oracle Database Administration SQL dba_constraints all_constraints user_constraints ·List Tables That Are Using the Specified Table as a Foreign Key using dba_constraints Which tables point at SALES.CUSTOMER? You need the answer before you truncate it, drop it, reload it or change its primary key, because every child table with a foreign key to it will either block the change or be affected by it. …
Read MoreOracle Undo Retention Tuning: ALTER SYSTEM Guide
May 12, 2024 / · 2 min read · Database Administration SQL Commands Performance Optimization Data Management undo_retention oracle dba v$undostat ·Optimizing Undo Retention in Oracle Databases We will explain how to optimize the undo_retention parameter in Oracle databases using the SQL command ALTER SYSTEM SET undo_retention = 500 SCOPE = MEMORY;. Understanding this parameter is crucial for effective transaction management, rollback capabilities, and maintaining …
Read MoreOracle Rollback Detection: Monitor Active Transactions
May 10, 2024 / · 3 min read · Oracle Database SQL Database Administration Performance Tuning Troubleshooting v$session v$transaction ·Real-Time Oracle Rollback Detection: Is Your Database Undoing Changes? This SQL query monitors real-time rollbacks in Oracle databases. It identifies which sessions are actively undoing changes and tracks their progress by observing the used_ublk value (the number of undo blocks in use). When used_ublk reaches zero, …
Read MoreCreating a Temporary Tablespace in Oracle Database This guide explains an Oracle Database SQL code snippet for creating a temporary tablespace named temp, its purpose, key points, and insights. Sample SQL Command 1create temporary tablespace temp 2tempfile '<file_name>' size 500M 3/ Create a Temporary Tablespace named …
Read More