
How to Find and Fix Stale Statistics in Oracle
See how stale statistics mislead the optimizer on new data, find stale and missing statistics, and gather them again with DBMS_STATS.

See how stale statistics mislead the optimizer on new data, find stale and missing statistics, and gather them again with DBMS_STATS.

See how skewed data fools the optimizer without histograms, how SIZE AUTO creates them, and how frequency and hybrid histograms fix plans.

Read index usage from DBA_INDEX_USAGE, see why sampled tracking can miss rare uses, and remove unused indexes safely.

Six common reasons Oracle does a full scan despite an index, each shown in a real plan with the change that makes the index work.

Rank SQL statements by total and per-execution time with V$SQLSTATS, read child cursors in V$SQL, and show the top statement's plan.

See nested loops, hash joins and sort-merge joins in real Oracle plans, learn when each is chosen, and compare their cost on one query.

See every common Oracle access path in a real plan, learn when the optimizer picks it, and why a full scan is sometimes faster than an index.

Get a plan with EXPLAIN PLAN and DBMS_XPLAN, read its operations in the right order, and compare the estimates with actual rows.

Release an APEX application and its schema changes together with SQLcl Projects and Git, deploy them to production, and check what arrived.

Export an APEX application with SQLcl, split it into files for Git, review a change, and install it in another workspace under a new ID.

Reproduce a full temporary tablespace, let its file grow to a limit, and find the statements that use the most temp space.

Grant CREATE SESSION, or a role that includes it, so a new user can connect, with the error and fix run on a real database.

See why CREATE TABLE works but INSERT fails without a quota, and grant the user a sized quota on the tablespace.

Check which container the session is in, create application users in the pluggable database, and use C## only for common users.

Change an expired password at logon or as an administrator, and check the profile limits that make passwords expire.

Reproduce an account lock from failed logins, read LOCKED and LOCKED(TIMED) in DBA_USERS, and unlock the account.

Find why a logon is denied, from case-sensitive passwords to the wrong pluggable database, and reset the password as an administrator.

List the services the listener knows, connect to the pluggable database's service, and get a database registered again.