Oracle Scripts
Move a Datafile Online with ALTER DATABASE MOVE DATAFILE
Aug 28, 2026 / · 11 min read · Oracle DBA ALTER DATABASE Move Datafile Online Datafile Move OMF Oracle 12c Datafile Management Oracle Administration dba_data_files v$datafile ·Move a Datafile Online with ALTER DATABASE MOVE DATAFILE Purpose Oracle 12.1 closed a gap that had existed since the earliest releases: moving or renaming a datafile always meant taking something offline first. A DBA had three choices — switch the tablespace offline, switch the individual datafile offline, or shut the …
Read MoreFlush the Shared Pool and Buffer Cache with ALTER SYSTEM
Flush the Shared Pool and Buffer Cache with ALTER SYSTEM Purpose Where DBMS_SHARED_POOL.PURGE removes one cursor or one package from the library cache, ALTER SYSTEM FLUSH SHARED_POOL clears every parsed statement, stored procedure, function, package, and trigger cached in the shared pool at once — a blunt instrument …
Read MoreReview Job Run History with DBA_SCHEDULER_JOB_RUN_DETAILS
Review Job Run History with DBA_SCHEDULER_JOB_RUN_DETAILS Purpose A stuck job that fails silently overnight rarely announces itself. The next morning's dependent process just doesn't have the data it expected, and by then the only trace of what actually happened lives in the Scheduler's own run log. …
Read MoreLocate the Alert Log and Trace Files with V$DIAG_INFO
Aug 3, 2026 / · 11 min read · Oracle DBA V$DIAG_INFO Alert Log ADR Trace Files Automatic Diagnostic Repository Oracle Administration Diagnostic Data DIAGNOSTIC_DEST gv$diag_info ·Locate the Alert Log and Trace Files with V$DIAG_INFO Purpose Before Oracle 11g, finding the alert log meant knowing the value of BACKGROUND_DUMP_DEST and constructing the filename by hand. 11g replaced that parameter, along with USER_DUMP_DEST and CORE_DUMP_DEST, with a single DIAGNOSTIC_DEST parameter and moved every …
Read MoreKill and Disconnect Oracle Sessions with ALTER SYSTEM
Jul 20, 2026 / · 11 min read · Oracle DBA ALTER SYSTEM Kill Session Disconnect Session V$SESSION Oracle Administration Session Termination ORA-00031 ·Kill and Disconnect Oracle Sessions with ALTER SYSTEM Purpose V$SESSION exposes the SID and SERIAL# pair that both ALTER SYSTEM KILL SESSION and ALTER SYSTEM DISCONNECT SESSION require as their targeting key — a DBA cannot terminate a stuck session without pulling that pair first, and getting it wrong means terminating …
Read MoreCheck Redo Log Switch Frequency with V$LOG_HISTORY
Jul 12, 2026 / · 12 min read · Oracle DBA V$LOG_HISTORY Redo Log Log Switch Frequency Oracle Administration Dynamic Performance Views Redo Log Sizing Oracle Performance v$log ·Check Redo Log Switch Frequency with V$LOG_HISTORY Purpose How many times does the online redo log switch in a single hour, and does that number spike during the nightly batch window or stay flat around the clock? A redo log sizing decision made from a single "switches per day" total hides the answer to that question. …
Read MoreEnable a 10046 Trace for an Oracle Session
Jul 10, 2026 / · 14 min read · Oracle DBA SQL Trace 10046 Trace Performance Diagnostics ORADEBUG DBMS_MONITOR Oracle Performance Trace File v$diag_info v$process v$session ·Enable a 10046 Trace for an Oracle Session Purpose A 10046 trace returns wait events only if the level includes them. Enabling the trace at level 1 and then wondering why the file shows no waits is the most common 10046 mistake in production diagnosis — the output has elapsed times and call counts, but none of the db …
Read MoreRun a Consistent Export with expdp FLASHBACK_TIME
Jul 10, 2026 / · 10 min read · Oracle DBA Data Pump expdp FLASHBACK_TIME Consistent Export Oracle Administration Undo Retention Oracle Backup dba_free_space v$database v$parameter v$undostat ·Run a Consistent Export with expdp FLASHBACK_TIME Purpose A schema export reads many tables over a span of time, and for schemas where rows in one table reference rows in another, you usually want every table in the dump to reflect the same moment. Community Data Pump documentation puts it directly: expdp exports are …
Read MoreMonitor Data Pump Progress with V$SESSION_LONGOPS
Jul 5, 2026 / · 10 min read · Oracle DBA V$SESSION_LONGOPS Data Pump expdp impdp Oracle Monitoring Dynamic Performance Views Oracle Administration dba_datapump_jobs v$session ·Monitor Data Pump Progress with V$SESSION_LONGOPS Purpose V$SESSION_LONGOPS shows how far a running expdp or impdp job has got. That matters on a full-database export scheduled overnight, or an import that has been running for six hours. The dynamic performance view gives a number to plan around instead of a guess. …
Read MoreInsert Control Characters in vi with Ctrl-V for Oracle Prompts
Jun 20, 2026 / · 7 min read · Oracle DBA Unix Commands vi SQL*Plus Shell Terminal Oracle Administration Text Editing ·Insert Control Characters in vi with Ctrl-V for Oracle Prompts Purpose A custom SQL*Plus prompt that prints the connected instance name in colour, or a login script that clears the screen before the banner, both need one thing the keyboard cannot type directly: a literal control character embedded in the file. Press …
Read More