Category: Guide
-
Oracle SQL Tuning with AWR and ASH, Part 3: SQL Tuning Advisor, sqltrpt.sql, and Plan Stabilization
Use the evidence from AWR and ASH to evaluate tuning recommendations and stabilize a proven execution plan.
-
Oracle SQL Tuning with AWR and ASH, Part 2: Diagnose with ASH and Runtime Plans
Use ASH to classify database activity and runtime execution plans to find where the time went during a slow SQL execution.
-
Oracle SQL Tuning with AWR and ASH, Part 1: Find and Prove the Regression
Define the incident and use AWR evidence to identify the SQL, compare execution plans, and prove whether performance regressed.
-
Fast Guide: PL/SQL
PL/SQL is Oracle’s procedural extension to SQL. It lets you combine SQL statements with variables, conditions, loops, reusable subprograms, and exception handling. This quick guide covers the pieces you will use most often. 1. The basic PL/SQL block A block has an optional declaration section, a required executable section, and an optional exception section. The…
-
Oracle Bind Variable Peeking and Plan Instability
Bind variables improve cursor sharing, but a plan chosen for one bind value can perform poorly for another. Oracle calls the first-value optimization behavior bind variable peeking. How peeking affects a plan During a hard parse, the optimizer can inspect the current bind values and estimate selectivity as though literals were present. This helps when…
-
Oracle: CPU Used by Each Database Session
Oracle exposes cumulative database CPU time for each session through V$SESSTAT. Join it to V$STATNAME by name—never hard-code a statistic number, because statistic numbers can change between releases. Current CPU by session The statistic is cumulative for the life of the session and is traditionally recorded in hundredths of a second. It is Oracle database…
-
Trigger RMAN Archivelog Backups Based on Filesystem Usage
A rapidly growing archive destination can fill during bulk loads or data migrations. A usage-triggered RMAN job is a useful emergency backstop, but it should complement—not replace—scheduled archivelog backups, monitoring, and capacity planning. If you use the fast recovery area Measure the Oracle-managed recovery area from the database rather than parsing a filesystem command: V$RECOVERY_AREA_USAGE…
-
SQL Server: Safely Attach Multiple Databases
The old sp_attach_db procedure is deprecated. Modern SQL Server uses CREATE DATABASE … FOR ATTACH, and every data and log file must be accounted for. Prefer backup and restore For planned migrations, a tested full backup and restore is usually safer and easier to audit. Attach is appropriate when you have a cleanly detached, trusted…
-
Oracle DBNEWID (NID): Change a DBID or Database Name
Oracle’s DBNEWID utility, invoked as nid, can change a database identifier (DBID), a database name (DBNAME), or both. This is useful after cloning a database that must be distinguished from its source in an RMAN repository. Understand the consequences Changing the DBID makes backups and archived logs created under the old DBID unusable for the…
-
Changing an Oracle DBID: Oracle 8i and 9i Considerations
A DBID is Oracle’s internal identifier for a database. RMAN uses it to distinguish databases, so a physical clone that retains the source DBID can conflict with the source in the same recovery catalog. Oracle 9i Release 2 and later Oracle 9i Release 2 introduced the supported DBNEWID utility. Use nid rather than manually editing…
