Scripts
Oracle Database: Understanding Rows per Block for Efficient Storage Purpose This Oracle SQL query helps you analyze the average, maximum, and minimum number of rows stored within each data block for a specific table. Understanding this metric is critical for optimizing storage efficiency, query performance, and overall …
Read MoreOracle Buffer Cache Advisory: v$db_cache_advice Tuning
Oracle Database: Deciphering the Buffer Cache Advisory for Performance Gains Purpose This Oracle SQL query, coupled with the necessary system setting, unveils the Buffer Cache Advisory, a valuable tool for optimizing your database's buffer cache size. By estimating the potential reduction in physical reads at various …
Read MoreOracle Disabled Foreign Key Constraints: dba_constraints
Identifying Disabled Foreign Key Constraints in Oracle Database using dba_constraints Purpose This SQL query is designed to identify and list all disabled foreign key constraints within an Oracle database. It provides information about the table and constraint name for each disabled foreign key. Sample SQL Command 1set …
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 Moredba_constraints: Query All Oracle Table Constraints
Jun 19, 2024 / · 8 min read · Oracle SQL Administration dba_constraints all_constraints dba_cons_columns ·dba_constraints: Query All Oracle Table Constraints Purpose A DDL export shows every constraint as text, and a design tool shows them as a diagram. Neither lets you filter, sort or count. DBA_CONSTRAINTS does. It holds one row per constraint, so a single query can list the constraints on one table, show which are …
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 Undo: Check Extent Status in DBA_UNDO_EXTENTS
May 11, 2024 / · 8 min read · oracle undo dba_undo_extents dba_rollback_segs dba_tablespaces v$undostat ·Oracle Undo: Check Extent Status in DBA_UNDO_EXTENTS Purpose A report query runs for forty minutes on a busy system and ends with ORA-01555: snapshot too old. The query is correct. The undo it needed to build a consistent picture of the data was overwritten before the query finished. Somewhere between the size of the …
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 MoreUnderstanding ALTER DATABASE DROP LOGFILE MEMBER in Oracle Databases Learn how to use ALTER DATABASE DROP LOGFILE MEMBER to remove redo log file members in Oracle databases. Get insights, explanations, and best practices. Sample SQL Command 1alter database drop logfile member '<filename>'; Purpose of ALTER DATABASE …
Read More