<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Oracle Scripts</title><link>https://www.oraclescripts.com/</link><description>Recent content on Oracle Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>OracleScripts.com</copyright><lastBuildDate>Wed, 20 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.oraclescripts.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Enable a 10046 Trace for an Oracle Session</title><link>https://www.oraclescripts.com/post/oracle-enable-10046-trace/</link><pubDate>Fri, 10 Jul 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-enable-10046-trace/</guid><description>
&lt;h2 id="enable-a-10046-trace-for-an-oracle-session"&gt;Enable a 10046 Trace for an Oracle Session&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;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 &lt;code&gt;db file sequential read&lt;/code&gt;, &lt;code&gt;latch: cache buffers chains&lt;/code&gt;, or &lt;code&gt;enq: TX - row lock contention&lt;/code&gt; events that explain where those seconds actually went. Choosing the wrong level produces a trace file that answers a different question than the one being investigated.&lt;/p&gt;</description></item><item><title>Run a Consistent Export with expdp FLASHBACK_TIME</title><link>https://www.oraclescripts.com/post/oracle-expdp-flashback-time-systimestamp/</link><pubDate>Fri, 10 Jul 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-expdp-flashback-time-systimestamp/</guid><description>
&lt;h2 id="run-a-consistent-export-with-expdp-flashback_time"&gt;Run a Consistent Export with expdp FLASHBACK_TIME&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;A Data Pump export that reads one table at 02:00 and the next at 02:15 is not a consistent snapshot — it is a photograph taken in pieces over time. For schemas where rows in one table reference rows in another, that time spread means the export can capture parent rows whose child records were not yet committed, or child records whose parents were deleted during the export window. The dump file looks intact until the import runs and foreign key constraints reveal the mismatch, or an ETL pipeline reports orphaned surrogate keys.&lt;/p&gt;</description></item><item><title>Monitor Data Pump Progress with V$SESSION_LONGOPS</title><link>https://www.oraclescripts.com/post/oracle-data-pump-progress-vsession-longops/</link><pubDate>Sun, 05 Jul 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-data-pump-progress-vsession-longops/</guid><description>
&lt;h2 id="monitor-data-pump-progress-with-vsession_longops"&gt;Monitor Data Pump Progress with V$SESSION_LONGOPS&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Where the expdp and impdp log files record a status line per completed object — writing output at each table boundary, not while a large table is mid-transfer — &lt;code&gt;V$SESSION_LONGOPS&lt;/code&gt; records progress while the operation is still running. That gap matters on a full-database export scheduled overnight or an import that has been running for six hours with no new log output. The log file will not tell you how far along the current table is. &lt;code&gt;V$SESSION_LONGOPS&lt;/code&gt; will.&lt;/p&gt;</description></item><item><title>Insert Control Characters in vi with Ctrl-V for Oracle Prompts</title><link>https://www.oraclescripts.com/post/vi-insert-control-character-oracle-prompt/</link><pubDate>Sat, 20 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/vi-insert-control-character-oracle-prompt/</guid><description>
&lt;h2 id="insert-control-characters-in-vi-with-ctrl-v-for-oracle-prompts"&gt;Insert Control Characters in vi with Ctrl-V for Oracle Prompts&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;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 &lt;code&gt;Esc&lt;/code&gt; while editing and vi leaves insert mode. Press &lt;code&gt;Enter&lt;/code&gt; and vi opens a new line instead of writing a carriage return into the buffer. The control codes a terminal escape sequence is built from are exactly the keys vi reserves for its own commands, so typing them does the wrong thing.&lt;/p&gt;</description></item><item><title>Check RESUMABLE_TIMEOUT and RESUMABLE Status in V$SESSION</title><link>https://www.oraclescripts.com/post/oracle-resumable-timeout-vsession/</link><pubDate>Fri, 19 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-resumable-timeout-vsession/</guid><description>
&lt;h2 id="check-resumable_timeout-and-resumable-status-in-vsession"&gt;Check RESUMABLE_TIMEOUT and RESUMABLE Status in V$SESSION&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;V$SESSION&lt;/code&gt; carries two columns that tell you whether a session can survive running out of space: &lt;code&gt;RESUMABLE&lt;/code&gt; and the resumable timeout that governs it. When resumable space allocation is enabled, a statement that hits a space error — a full tablespace, a maxed-out datafile, an exceeded user quota — does not fail immediately. Oracle suspends it, raises a &lt;code&gt;RESUMABLE&lt;/code&gt; alert, and waits. If a DBA frees the space inside the timeout window, the statement wakes up and continues from where it stopped. If the window expires first, the statement fails with the original space error.&lt;/p&gt;</description></item><item><title>Monitor PGA Aggregate Target with V$PGASTAT in Oracle</title><link>https://www.oraclescripts.com/post/oracle-pga-aggregate-target-vpgastat/</link><pubDate>Thu, 18 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-pga-aggregate-target-vpgastat/</guid><description>
&lt;h2 id="monitor-pga-aggregate-target-with-vpgastat-in-oracle"&gt;Monitor PGA Aggregate Target with V$PGASTAT in Oracle&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Is &lt;code&gt;PGA_AGGREGATE_TARGET&lt;/code&gt; set high enough for the work the instance actually does? &lt;code&gt;V$PGASTAT&lt;/code&gt; answers that question. It is the instance-level statistics view for the Program Global Area — the private memory Oracle hands to each server process for sorting, hashing, and bitmap operations. Where a per-session PGA view tells you what one connection is using, &lt;code&gt;V$PGASTAT&lt;/code&gt; rolls every process into one set of instance-wide numbers: the target you asked for, the bytes actually allocated, the high-water mark, and the cache hit percentage that says whether work-area operations are running in memory or spilling to temp.&lt;/p&gt;</description></item><item><title>Oracle Scheduler Job Monitoring with DBA_SCHEDULER_RUNNING_JOBS</title><link>https://www.oraclescripts.com/post/oracle-scheduler-job-monitoring-dba-scheduler-running-jobs/</link><pubDate>Tue, 09 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-scheduler-job-monitoring-dba-scheduler-running-jobs/</guid><description>
&lt;h2 id="oracle-scheduler-job-monitoring-with-dba_scheduler_running_jobs"&gt;Oracle Scheduler Job Monitoring with DBA_SCHEDULER_RUNNING_JOBS&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Which Oracle Scheduler jobs are executing at this instant, and how long has each been running? &lt;code&gt;DBA_SCHEDULER_RUNNING_JOBS&lt;/code&gt; answers that directly. It lists only the jobs that are active right now — not the full job catalog, not the run history, just the live set. Joining it to &lt;code&gt;DBA_SCHEDULER_JOBS&lt;/code&gt; adds the job's owner, program, and schedule, so a single query turns &amp;quot;is anything stuck?&amp;quot; into a concrete list of names, session IDs, and elapsed times.&lt;/p&gt;</description></item><item><title>Oracle DBMS_SCHEDULER: Create and Manage Jobs with PL/SQL</title><link>https://www.oraclescripts.com/post/oracle-dbms-scheduler-create-manage-jobs/</link><pubDate>Mon, 08 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-dbms-scheduler-create-manage-jobs/</guid><description>
&lt;h2 id="oracle-dbms_scheduler-create-and-manage-jobs-with-plsql"&gt;Oracle DBMS_SCHEDULER: Create and Manage Jobs with PL/SQL&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Automating a recurring task — a nightly statistics gather, a log purge, an end-of-month rollup — is a standard part of running an Oracle database. &lt;code&gt;DBMS_SCHEDULER.CREATE_JOB&lt;/code&gt; is the procedure that registers that task with the database so it runs on a calendar schedule without an external cron entry. The job, its action, and its schedule all live inside the database, which means they are backed up, replicated to a standby, and visible in the data dictionary.&lt;/p&gt;</description></item><item><title>Query Wait Events by Session with Oracle V$SESSION_WAIT</title><link>https://www.oraclescripts.com/post/oracle-vsession-wait-events-by-session/</link><pubDate>Sun, 07 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-vsession-wait-events-by-session/</guid><description>
&lt;h2 id="query-wait-events-by-session-with-oracle-vsession_wait"&gt;Query Wait Events by Session with Oracle V$SESSION_WAIT&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;V$SESSION_WAIT&lt;/code&gt; is the real-time view that shows what each Oracle session is waiting on this very second. For every session it exposes the wait event name, how long the session has been in that wait, and three event-specific parameters (&lt;code&gt;P1&lt;/code&gt;, &lt;code&gt;P2&lt;/code&gt;, &lt;code&gt;P3&lt;/code&gt;) that pinpoint the resource — a file and block number, a lock type, a latch address. It is the view to reach for when the database &amp;quot;feels slow right now&amp;quot; and you need the current state, not a post-mortem from AWR.&lt;/p&gt;</description></item><item><title>Oracle Index Rebuild and Coalesce with ALTER INDEX</title><link>https://www.oraclescripts.com/post/oracle-index-rebuild-coalesce-alter-index/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-index-rebuild-coalesce-alter-index/</guid><description>
&lt;h2 id="oracle-index-rebuild-and-coalesce-with-alter-index"&gt;Oracle Index Rebuild and Coalesce with ALTER INDEX&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Over months of heavy delete and update activity, a B-tree index can accumulate empty and half-full leaf blocks. The index keeps working, but it grows wider than the data it points to, so range scans read more blocks than they need and the segment holds space that is no longer doing useful work. &lt;code&gt;ALTER INDEX ... REBUILD&lt;/code&gt; and &lt;code&gt;ALTER INDEX ... COALESCE&lt;/code&gt; are the two commands that address this — one rebuilds the index from scratch, the other merges adjacent sparse leaf blocks in place.&lt;/p&gt;</description></item><item><title>Search UNIX Man Pages for Oracle DBA Tools with man -k</title><link>https://www.oraclescripts.com/post/oracle-dba-man-page-search-keyword/</link><pubDate>Mon, 25 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-dba-man-page-search-keyword/</guid><description>
&lt;h2 id="search-unix-man-pages-for-oracle-dba-tools-with-man--k"&gt;Search UNIX Man Pages for Oracle DBA Tools with man -k&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Where Google answers most &amp;quot;how do I do X in UNIX&amp;quot; questions for a DBA today, &lt;code&gt;man -k&lt;/code&gt; answers the narrower one — what tools the host actually has installed, and what each one does, without leaving the SSH session. Production Oracle hosts often run in change-controlled networks with no outbound HTTP, no browser, and a tight maintenance window; &lt;code&gt;man -k&lt;/code&gt; and its synonym &lt;code&gt;apropos&lt;/code&gt; are the offline discovery commands that close the gap between knowing a vague capability exists and finding the binary that delivers it.&lt;/p&gt;</description></item><item><title>Enable vi Command-Line Editing in ksh for Oracle DBA Shells</title><link>https://www.oraclescripts.com/post/ksh-vi-mode-shell-history-dba/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/ksh-vi-mode-shell-history-dba/</guid><description>
&lt;h2 id="enable-vi-command-line-editing-in-ksh-for-oracle-dba-shells"&gt;Enable vi Command-Line Editing in ksh for Oracle DBA Shells&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Recalling and editing the prior command without retyping it is the single most-used operation in a long DBA shift on an Oracle host. On the Korn shell (&lt;code&gt;ksh&lt;/code&gt;) — the default login shell on AIX 7.x, Solaris 11, HP-UX 11i, and many older Oracle 11g/12c reference builds — that operation is gated behind one line in &lt;code&gt;.profile&lt;/code&gt;: &lt;code&gt;set -o vi&lt;/code&gt;. Without it, the up-arrow key prints a literal escape sequence and the only way to repeat a long &lt;code&gt;RMAN BACKUP DATABASE PLUS ARCHIVELOG ...&lt;/code&gt; invocation is to type it again.&lt;/p&gt;</description></item><item><title>Disable vi Autoindent Before Pasting SQL Scripts on Oracle Hosts</title><link>https://www.oraclescripts.com/post/vi-disable-autoindent-pasting-sql/</link><pubDate>Sat, 23 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/vi-disable-autoindent-pasting-sql/</guid><description>
&lt;h2 id="disable-vi-autoindent-before-pasting-sql-scripts-on-oracle-hosts"&gt;Disable vi Autoindent Before Pasting SQL Scripts on Oracle Hosts&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Pasting a SQL script copied from email, a Confluence page, or a ticket comment into a vi buffer over SSH — and watching every line shift one indent right of the previous one — is the most common and most frustrating vi failure mode an Oracle DBA encounters. The script that ran fine when executed directly from the wiki snippet now fails on the host with &lt;code&gt;SP2-0042: unknown command &amp;quot; INSERT&amp;quot;&lt;/code&gt; on every line. The cause is &lt;code&gt;autoindent&lt;/code&gt;: vi assumed each new line should match the indentation of the previous one, and the terminal cannot distinguish a real keypress from a pasted character, so the indent compounds.&lt;/p&gt;</description></item><item><title>vi Editor Commands Reference for Oracle DBAs</title><link>https://www.oraclescripts.com/post/vi-editor-commands-reference-for-oracle-dbas/</link><pubDate>Wed, 20 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/vi-editor-commands-reference-for-oracle-dbas/</guid><description>
&lt;h2 id="vi-editor-commands-reference-for-oracle-dbas"&gt;vi Editor Commands Reference for Oracle DBAs&lt;/h2&gt;
&lt;p&gt;Every Oracle DBA on Unix or Linux ends up in vi whether they planned to or not. It opens by default when you &lt;code&gt;crontab -e&lt;/code&gt;, it is what &lt;code&gt;visudo&lt;/code&gt; drops you into, and it is the editor on most Oracle Linux and AIX hosts before anyone has installed &lt;code&gt;nano&lt;/code&gt; or configured &lt;code&gt;EDITOR&lt;/code&gt;. Knowing the core commands is not optional — it is the difference between a clean parameter change and a corrupted &lt;code&gt;init.ora&lt;/code&gt; that brings down the instance.&lt;/p&gt;</description></item><item><title>Scan Every Oracle Alert and Trace Log for ORA- Errors with grep</title><link>https://www.oraclescripts.com/post/grep-ora-errors-across-all-oracle-logs/</link><pubDate>Sun, 17 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/grep-ora-errors-across-all-oracle-logs/</guid><description>
&lt;h2 id="scan-every-oracle-alert-and-trace-log-for-ora--errors-with-grep"&gt;Scan Every Oracle Alert and Trace Log for ORA- Errors with grep&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Every Oracle environment generates alert logs and process trace files recording instance events, errors, and diagnostics. When a support call comes in — &amp;quot;the database was slow last night, can you check the logs?&amp;quot; — the fastest first pass is a single grep across every log file in the diagnostic directory. This one-liner, drawn from the shutdownabort.com DBA Quick Guides (Andrew Barry, 2007–2013, preserved via the Wayback Machine), scans all alert logs under the Oracle diagnostic root and prints every line containing an ORA- error code.&lt;/p&gt;</description></item><item><title>Find the Biggest Files First When an Oracle Filesystem Fills Up</title><link>https://www.oraclescripts.com/post/ls-du-sorted-by-size-oracle-filesystem-full/</link><pubDate>Sat, 16 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/ls-du-sorted-by-size-oracle-filesystem-full/</guid><description>
&lt;h2 id="find-the-biggest-files-first-when-an-oracle-filesystem-fills-up"&gt;Find the Biggest Files First When an Oracle Filesystem Fills Up&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;A full Oracle filesystem is a five-alarm incident. Whether it is the &lt;code&gt;/u01/oradata&lt;/code&gt; mount holding datafiles, the Fast Recovery Area filling with archive logs, or the &lt;code&gt;diag&lt;/code&gt; directory overflowing with trace files, the first question is always the same: which files are consuming the space? The two commands below — taken from the shutdownabort.com DBA Quick Guides (Andrew Barry, 2007–2013, preserved via the Wayback Machine) — are the DBA's first-response toolkit for answering that question within thirty seconds on any UNIX host without any Oracle database tools.&lt;/p&gt;</description></item><item><title>Recursive find and grep to Search Oracle Trace Files for Any String</title><link>https://www.oraclescripts.com/post/find-grep-recursive-oracle-tracefiles/</link><pubDate>Fri, 15 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/find-grep-recursive-oracle-tracefiles/</guid><description>
&lt;h2 id="recursive-find-and-grep-to-search-oracle-trace-files-for-any-string"&gt;Recursive find and grep to Search Oracle Trace Files for Any String&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Oracle's Automatic Diagnostic Repository (ADR) accumulates hundreds or thousands of trace files — one per background process event, one per incident, one per session that hits an error deep enough to dump. Finding the trace file that contains evidence of a specific error or a specific SQL statement requires searching the content of all of them, not just their names. The two-command pipeline below — from the shutdownabort.com DBA Quick Guides (Andrew Barry, 2007–2013, preserved via the Wayback Machine) — uses &lt;code&gt;find&lt;/code&gt; to enumerate trace files and &lt;code&gt;grep -l&lt;/code&gt; to identify which ones contain the target string.&lt;/p&gt;</description></item><item><title>Oracle Export Through a Named Pipe with mknod for Space-Constrained Hosts</title><link>https://www.oraclescripts.com/post/oracle-export-via-named-pipe-mknod/</link><pubDate>Thu, 14 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-export-via-named-pipe-mknod/</guid><description>
&lt;h2 id="oracle-export-through-a-named-pipe-with-mknod-for-space-constrained-hosts"&gt;Oracle Export Through a Named Pipe with mknod for Space-Constrained Hosts&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Oracle's original Export utility (&lt;code&gt;exp&lt;/code&gt;) writes a binary dump file. On production hosts where disk space is tight — where staging a full-database dump and its compressed copy simultaneously would exhaust the filesystem — the classic workaround is a named pipe (FIFO). A named pipe looks like a file on the filesystem but has no storage: bytes written to one end are immediately readable from the other. By piping the Export directly through gzip or netcat, the dump never touches disk as an uncompressed file.&lt;/p&gt;</description></item><item><title>Unpacking Oracle Patch and Install Media with cpio</title><link>https://www.oraclescripts.com/post/cpio-unzip-oracle-patch-media/</link><pubDate>Wed, 13 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/cpio-unzip-oracle-patch-media/</guid><description>
&lt;h2 id="unpacking-oracle-patch-and-install-media-with-cpio"&gt;Unpacking Oracle Patch and Install Media with cpio&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Before Oracle began shipping all patches as &lt;code&gt;.zip&lt;/code&gt; files, the standard delivery format for Oracle install media and large patch bundles was &lt;code&gt;cpio&lt;/code&gt; — a tape archive format that predates tar and is still the underlying format used inside every RPM package. DBAs working with Oracle 8i, 9i, and early 10g installations, or with older patch archives from Oracle MetaLink, received media on tape or in &lt;code&gt;.cpio&lt;/code&gt; files and used &lt;code&gt;cpio -idmv&lt;/code&gt; to stage it for installation.&lt;/p&gt;</description></item><item><title>Diagnose Oracle Net and RAC Interconnect Routing with netstat -r</title><link>https://www.oraclescripts.com/post/netstat-r-oracle-net-routing-diagnostics/</link><pubDate>Tue, 12 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/netstat-r-oracle-net-routing-diagnostics/</guid><description>
&lt;h2 id="diagnose-oracle-net-and-rac-interconnect-routing-with-netstat--r"&gt;Diagnose Oracle Net and RAC Interconnect Routing with netstat -r&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Oracle Net connections and Oracle RAC private interconnect traffic both depend on correct IP routing. When an Oracle client cannot connect to the listener, when RAC Cache Fusion or heartbeat traffic is routing over the wrong interface, or when &lt;code&gt;sqlnet.ora&lt;/code&gt; logs show unexpected source addresses, the OS routing table is the first place to look. &lt;code&gt;netstat -r&lt;/code&gt; prints the kernel routing table — the same table that determines where every TCP packet on the Oracle server goes.&lt;/p&gt;</description></item><item><title>Find Oracle Archive Logs Older Than N Days with find -mtime</title><link>https://www.oraclescripts.com/post/find-archive-logs-older-than-n-days-oracle/</link><pubDate>Sun, 03 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/find-archive-logs-older-than-n-days-oracle/</guid><description>
&lt;h2 id="find-oracle-archive-logs-older-than-n-days-with-find--mtime"&gt;Find Oracle Archive Logs Older Than N Days with find -mtime&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Oracle databases in archivelog mode write a stream of &lt;code&gt;.ARC&lt;/code&gt; (archived redo log) files to a destination directory. The directory fills up. When it fills up, the database hangs. The four &lt;code&gt;find -mtime&lt;/code&gt; commands below let a DBA list, delete, compress, or move archive logs by age — the daily housekeeping that keeps the archive destination from filling.&lt;/p&gt;</description></item><item><title>Write Text Files from Oracle PLSQL with UTL_FILE Example</title><link>https://www.oraclescripts.com/post/oracle-utl-file-write-text-example/</link><pubDate>Sat, 02 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-utl-file-write-text-example/</guid><description>
&lt;h2 id="write-text-files-from-oracle-plsql-with-utl_file-example"&gt;Write Text Files from Oracle PL/SQL with UTL_FILE Example&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;UTL_FILE&lt;/code&gt; is the built-in Oracle PL/SQL package for reading and writing operating-system files from inside the database. The procedure below — taken straight from the shutdownabort.com DBA Quick Guides (Andrew Barry, 2007–2013, preserved via the Wayback Machine as the anchor source for this post) — opens a file in write mode, writes one line, and closes the handle. It is the smallest possible &amp;quot;hello world&amp;quot; for &lt;code&gt;UTL_FILE&lt;/code&gt; and the right starting point for any DBA who needs to spool data to disk from PL/SQL.&lt;/p&gt;</description></item><item><title>Sample tnsnames.ora Dedicated Server Entry (with ASM)</title><link>https://www.oraclescripts.com/post/oracle-tnsnames-ora-dedicated-connection-example/</link><pubDate>Fri, 01 May 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-tnsnames-ora-dedicated-connection-example/</guid><description>
&lt;h2 id="sample-tnsnamesora-dedicated-server-entry-with-asm"&gt;Sample tnsnames.ora Dedicated Server Entry (with ASM)&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;tnsnames.ora&lt;/code&gt; file is the client-side address book for Oracle Net. Each entry maps a short alias (&lt;code&gt;SCR9&lt;/code&gt;) to a full network address — protocol, host, port, and target service. Without a working &lt;code&gt;tnsnames.ora&lt;/code&gt; entry, &lt;code&gt;sqlplus&lt;/code&gt;, &lt;code&gt;rman&lt;/code&gt;, and any application using OCI cannot reach the database.&lt;/p&gt;
&lt;p&gt;The two entries below — taken straight from the shutdownabort.com DBA Quick Guides (Andrew Barry, 2007–2013, preserved via the Wayback Machine as the anchor source for this post) — are the smallest possible reference: one dedicated-server connection to a database service, and one connection to a non-default listener used by ASM.&lt;/p&gt;</description></item><item><title>Sample listener.ora with Static SID_LIST and Extproc</title><link>https://www.oraclescripts.com/post/oracle-listener-ora-static-sid-list-example/</link><pubDate>Thu, 30 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-listener-ora-static-sid-list-example/</guid><description>
&lt;h2 id="sample-listenerora-with-static-sid_list-and-extproc"&gt;Sample listener.ora with Static SID_LIST and Extproc&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;listener.ora&lt;/code&gt; file is the server-side configuration for the Oracle Net listener — the process that accepts incoming client connections and hands them off to a database server process. The sample below — taken straight from the shutdownabort.com DBA Quick Guides (Andrew Barry, 2007–2013, preserved via the Wayback Machine as the anchor source for this post) — shows two fundamental patterns: a &lt;strong&gt;LISTENER block&lt;/strong&gt; that names the network endpoints the listener listens on, and a &lt;strong&gt;SID_LIST_LISTENER block&lt;/strong&gt; that statically registers two services: a regular database and the &lt;code&gt;PLSExtProc&lt;/code&gt; agent for PL/SQL external procedures.&lt;/p&gt;</description></item><item><title>Delete the 500 Oldest Files in a Directory (Oracle DBA)</title><link>https://www.oraclescripts.com/post/delete-500-oldest-files-unix-dba/</link><pubDate>Wed, 29 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/delete-500-oldest-files-unix-dba/</guid><description>
&lt;h2 id="delete-the-500-oldest-files-in-a-directory-oracle-dba"&gt;Delete the 500 Oldest Files in a Directory (Oracle DBA)&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Oracle's diagnostic destination (&lt;code&gt;DIAGNOSTIC_DEST&lt;/code&gt;), audit file destination (&lt;code&gt;AUDIT_FILE_DEST&lt;/code&gt;, also known as &lt;code&gt;adump&lt;/code&gt;), and per-process trace directories collect thousands of small files over time. Inode counts, not bytes, are usually the limit that bites first — many filesystems cap directory entries or per-filesystem inodes well below the disk's byte capacity. The one-liner below — taken straight from the shutdownabort.com DBA Quick Guides (Andrew Barry, 2007–2013, preserved via the Wayback Machine as the anchor source for this post) — deletes the &lt;strong&gt;500 oldest files&lt;/strong&gt; in the current directory in one shot. It is the quickest way to free up enough headroom to keep the database running while a longer-term retention strategy is put in place.&lt;/p&gt;</description></item><item><title>List Files Opened by an Oracle Process with lsof -p</title><link>https://www.oraclescripts.com/post/lsof-find-files-opened-by-process-oracle/</link><pubDate>Tue, 28 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/lsof-find-files-opened-by-process-oracle/</guid><description>
&lt;h2 id="list-files-opened-by-an-oracle-process-with-lsof--p"&gt;List Files Opened by an Oracle Process with lsof -p&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;lsof&lt;/code&gt; (LiSt Open Files) is the UNIX tool for inspecting which processes have which files open. For an Oracle DBA it is the fastest answer to four common questions: which datafiles is this server process touching, which trace file is &lt;code&gt;PMON&lt;/code&gt; writing into right now, why is &lt;code&gt;df&lt;/code&gt; reporting more space used than &lt;code&gt;du&lt;/code&gt;, and which library is the database currently mapped against. The one-liner below — taken straight from the shutdownabort.com DBA Quick Guides (Andrew Barry, 2007–2013, preserved via the Wayback Machine as the anchor source for this post) — is the smallest possible invocation: list every file held open by one process, identified by its PID.&lt;/p&gt;</description></item><item><title>Oracle CREATE DIRECTORY Command Explained</title><link>https://www.oraclescripts.com/post/oracle-create-directory-command-explained/</link><pubDate>Sun, 12 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-create-directory-command-explained/</guid><description>
&lt;h2 id="oracle-create-directory-command-explained"&gt;Oracle CREATE DIRECTORY Command Explained&lt;/h2&gt;
&lt;p&gt;The Oracle &lt;code&gt;CREATE DIRECTORY&lt;/code&gt; command creates a &lt;strong&gt;directory object&lt;/strong&gt; — a logical alias inside the Oracle database that points to a real folder on the server's file system. This is one of the most used setup steps for Oracle Data Pump exports and imports, UTL_FILE file operations, BFILEs, and external tables.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="what-is-an-oracle-directory-object"&gt;What Is an Oracle Directory Object?&lt;/h2&gt;
&lt;p&gt;A directory object does &lt;strong&gt;not&lt;/strong&gt; create a real folder on the operating system. It only creates a pointer — or alias — inside Oracle that maps a name you choose to a physical path on the database server. This keeps your PL/SQL code and Data Pump jobs clean because you use the Oracle directory name instead of hard-coding full OS paths in your scripts.&lt;/p&gt;</description></item><item><title>Oracle Data Pump: Create the DATA_PUMP_DIR Directory</title><link>https://www.oraclescripts.com/post/oracle-data-pump-create-the-data-pump-dir-directory/</link><pubDate>Sat, 11 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-data-pump-create-the-data-pump-dir-directory/</guid><description>
&lt;h2 id="oracle-data-pump-create-the-data_pump_dir-directory"&gt;Oracle Data Pump: Create the DATA_PUMP_DIR Directory&lt;/h2&gt;
&lt;p&gt;Before you can run any Oracle Data Pump export (&lt;code&gt;expdp&lt;/code&gt;) or import (&lt;code&gt;impdp&lt;/code&gt;) job, Oracle needs to know where to write and read dump files and log files on the server. You do this by creating a &lt;strong&gt;directory object&lt;/strong&gt; inside the database that points to a real folder on the operating system.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="what-this-script-does"&gt;What This Script Does&lt;/h2&gt;
&lt;p&gt;This one-line SQL command creates a database directory object named &lt;code&gt;DATA_PUMP_DIR&lt;/code&gt; that maps to the physical path &lt;code&gt;/u01/ora_backup/datapump&lt;/code&gt; on the server. Once created, Oracle Data Pump jobs can use this directory to store export dump files and log files.&lt;/p&gt;</description></item><item><title>Oracle Data Pump Export Schema with expdp Command Guide</title><link>https://www.oraclescripts.com/post/oracle-data-pump-export-schema-expdp-command-guide/</link><pubDate>Fri, 10 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-data-pump-export-schema-expdp-command-guide/</guid><description>
&lt;h2 id="oracle-data-pump-export-schema-with-expdp-command-guide"&gt;Oracle Data Pump Export Schema with expdp Command Guide&lt;/h2&gt;
&lt;p&gt;Oracle Data Pump's &lt;code&gt;expdp&lt;/code&gt; utility lets you take a fast, flexible logical backup of any schema in your Oracle database. This post breaks down a simple schema-level export command, explains each parameter, and shows you how to run it safely.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="what-this-command-does"&gt;What This Command Does&lt;/h2&gt;
&lt;p&gt;The command below exports all objects and data from the &lt;code&gt;andy&lt;/code&gt; schema into a binary dump file stored in an Oracle directory object called &lt;code&gt;my_dir&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Oracle expdp Schema Export Using Data Pump</title><link>https://www.oraclescripts.com/post/oracle-expdp-schema-export-data-pump/</link><pubDate>Thu, 09 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-expdp-schema-export-data-pump/</guid><description>
&lt;h2 id="oracle-expdp-schema-export-using-data-pump"&gt;Oracle expdp Schema Export Using Data Pump&lt;/h2&gt;
&lt;p&gt;Oracle Data Pump's &lt;code&gt;expdp&lt;/code&gt; utility lets you export a full database schema — including tables, indexes, constraints, and data — into a portable dump file. This guide breaks down the single-line command that does exactly that for the &lt;code&gt;andy&lt;/code&gt; schema.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="purpose-of-this-command"&gt;Purpose of This Command&lt;/h2&gt;
&lt;p&gt;The goal of this command is to create a &lt;strong&gt;logical backup&lt;/strong&gt; of a single Oracle database schema called &lt;code&gt;andy&lt;/code&gt;. The export produces a binary dump file (&lt;code&gt;andy.dp&lt;/code&gt;) saved to a pre-defined Oracle directory object (&lt;code&gt;my_dir&lt;/code&gt;) on the server. This backup can later be imported into the same or a different Oracle database using &lt;code&gt;impdp&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Oracle DBMS_FLASHBACK.ENABLE_AT_TIME: Session Flashback</title><link>https://www.oraclescripts.com/post/oracle-dbms-flashback-enable-at-time-set-session-back-in-time/</link><pubDate>Thu, 12 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-dbms-flashback-enable-at-time-set-session-back-in-time/</guid><description>
&lt;h2 id="oracle-dbms_flashback-enable-at-time-session-flashback-guide"&gt;Oracle DBMS_FLASHBACK Enable At Time: Session Flashback Guide&lt;/h2&gt;
&lt;p&gt;Oracle's &lt;code&gt;DBMS_FLASHBACK.ENABLE_AT_TIME&lt;/code&gt; is a powerful procedure that lets you travel back in time within your database session — letting you query data exactly as it existed at a specific past moment, without needing a full database restore.&lt;/p&gt;
&lt;h2 id="what-this-code-does"&gt;What This Code Does&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
This one-line call puts your entire Oracle session into &amp;quot;flashback mode,&amp;quot; pointed at a specific past date and time. All &lt;code&gt;SELECT&lt;/code&gt; queries you run after this call will return data as it was at that moment — not the current data. This is ideal for investigating accidental deletes, data corruption, or auditing historical states.&lt;/p&gt;</description></item><item><title>Oracle: Disable Flashback with DBMS_FLASHBACK.DISABLE</title><link>https://www.oraclescripts.com/post/oracle-how-to-disable-flashback-using-dbms_flashback-disable/</link><pubDate>Wed, 11 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-how-to-disable-flashback-using-dbms_flashback-disable/</guid><description>
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;When working with Oracle Database, there are times when you need to look at data from the past — like rewinding a video to see what happened earlier. Oracle gives you a tool called &lt;strong&gt;Flashback&lt;/strong&gt; to do this. But once you are done looking at past data, you must turn Flashback off. The command to do that is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;EXEC DBMS_FLASHBACK.DISABLE;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This post explains what this command does, how it works, and when to use it.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Flashback Query: Copy Historical Data to a Table</title><link>https://www.oraclescripts.com/post/oracle-flashback-copy-historical-data-into-new-table/</link><pubDate>Tue, 10 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-flashback-copy-historical-data-into-new-table/</guid><description>
&lt;h2 id="oracle-flashback-query-copy-historical-data-into-a-new-table"&gt;Oracle Flashback Query: Copy Historical Data Into a New Table&lt;/h2&gt;
&lt;p&gt;Sometimes you need to go back in time and recover data the way it looked at a specific moment — without restoring the full database. Oracle makes this possible with &lt;strong&gt;Flashback Query&lt;/strong&gt;, using the &lt;code&gt;AS OF TIMESTAMP&lt;/code&gt; clause to read historical data directly from the undo tablespace. This post shows a clean, two-step pattern to create an empty copy of a table and then fill it with data from a past point in time.&lt;/p&gt;</description></item><item><title>Oracle exp: Export Database with FLASHBACK_TIME</title><link>https://www.oraclescripts.com/post/export-oracle-database-point-in-time-flashback-time/</link><pubDate>Mon, 09 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/export-oracle-database-point-in-time-flashback-time/</guid><description>
&lt;h2 id="export-an-oracle-database-from-a-point-in-time-using-flashback_time"&gt;Export an Oracle Database from a Point in Time Using FLASHBACK_TIME&lt;/h2&gt;
&lt;p&gt;The Oracle &lt;code&gt;exp&lt;/code&gt; utility supports a &lt;code&gt;FLASHBACK_TIME&lt;/code&gt; parameter that lets a database administrator export a full database with all data consistent to a &lt;strong&gt;single point in time&lt;/strong&gt;. This is critical for large, active databases where export duration may span minutes or hours and data must not drift between tables.&lt;/p&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
When you run a standard Oracle export on a live database, different tables may be captured at slightly different moments. This can produce an inconsistent dump file where related tables are out of sync. The &lt;code&gt;FLASHBACK_TIME&lt;/code&gt; parameter solves this by anchoring all exported data to one specific timestamp — Oracle translates that timestamp into a System Change Number (SCN) and uses Flashback Query internally to read data as it was at that exact moment.&lt;/p&gt;</description></item><item><title>Oracle: Get Current SCN with DBMS_FLASHBACK</title><link>https://www.oraclescripts.com/post/how-to-find-the-current-scn-in-oracle-database-using-dbms-flashback/</link><pubDate>Sun, 08 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-find-the-current-scn-in-oracle-database-using-dbms-flashback/</guid><description>
&lt;h2 id="how-to-find-the-current-scn-in-oracle-database-using-dbms_flashback"&gt;How to Find the Current SCN in Oracle Database Using DBMS_FLASHBACK&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;System Change Number (SCN)&lt;/strong&gt; is Oracle's internal logical clock. Every DBA needs to know how to read it. This post shows you the simplest SQL query to get the current SCN from any Oracle Database session, and explains exactly why it matters.&lt;/p&gt;
&lt;h2 id="what-is-an-scn"&gt;What Is an SCN?&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;System Change Number (SCN)&lt;/strong&gt; is a monotonically increasing integer that Oracle assigns to every committed transaction. It is the foundation of Oracle's consistency and recovery model. Think of it as Oracle's version of a timestamp — except it is more precise and more reliable than wall-clock time.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
Oracle uses the SCN for:&lt;/p&gt;</description></item><item><title>Oracle Fast Recovery Area: Set db_recovery_file_dest</title><link>https://www.oraclescripts.com/post/oracle-fast-recovery-area-set-db-recovery-file-dest-and-size/</link><pubDate>Sat, 07 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-fast-recovery-area-set-db-recovery-file-dest-and-size/</guid><description>
&lt;h2 id="oracle-fast-recovery-area-set-db-recovery-file-dest-and-size"&gt;Oracle Fast Recovery Area: Set DB Recovery File Dest and Size&lt;/h2&gt;
&lt;p&gt;The Oracle &lt;strong&gt;Fast Recovery Area (FRA)&lt;/strong&gt; is a disk location where Oracle stores and manages files related to backup and recovery. Two dynamic initialization parameters — &lt;code&gt;db_recovery_file_dest&lt;/code&gt; and &lt;code&gt;db_recovery_file_dest_size&lt;/code&gt; — control its location and maximum size, and both can be changed without restarting the database.&lt;/p&gt;
&lt;h2 id="the-code"&gt;The Code&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;-- Set the database recovery directory and size
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;-- These settings are dynamic
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;ALTER SYSTEM SET db_recovery_file_dest=&amp;#39;&amp;lt;path&amp;gt;&amp;#39; SCOPE=BOTH;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;ALTER SYSTEM SET db_recovery_file_dest_size=&amp;lt;size&amp;gt; SCOPE=BOTH;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;Replace `&amp;lt;path&amp;gt;` with a valid file system path, ASM disk group, or NFS mount point, and replace `&amp;lt;size&amp;gt;` with a value like `100G`, `2T`, or `500M`.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="what-this-code-does"&gt;What This Code Does&lt;/h2&gt;
&lt;p&gt;These two commands configure the Oracle Fast Recovery Area at the system level while the database is running. The &lt;code&gt;SCOPE=BOTH&lt;/code&gt; clause means the change takes effect immediately in the running instance &lt;strong&gt;and&lt;/strong&gt; is saved to the server parameter file (SPFILE), so it persists across database restarts.&lt;/p&gt;</description></item><item><title>DB_FLASHBACK_RETENTION_TARGET: Set Oracle Flashback Window</title><link>https://www.oraclescripts.com/post/set-oracle-flashback-database-retention-target-with-alter-system/</link><pubDate>Fri, 06 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/set-oracle-flashback-database-retention-target-with-alter-system/</guid><description>
&lt;h2 id="set-oracle-flashback-database-retention-target-with-alter-system"&gt;Set Oracle Flashback Database Retention Target with ALTER SYSTEM&lt;/h2&gt;
&lt;p&gt;Oracle Flashback Database lets you rewind your entire database to a past point in time without a full restore. The command &lt;code&gt;ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET&lt;/code&gt; controls how far back in time that rewind can go.&lt;/p&gt;
&lt;h2 id="what-this-command-does"&gt;What This Command Does&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;DB_FLASHBACK_RETENTION_TARGET&lt;/code&gt; parameter sets the &lt;strong&gt;upper limit, in minutes&lt;/strong&gt;, on how far back you can flashback your database. Oracle uses this setting to decide how much flashback log data to keep inside the &lt;strong&gt;Fast Recovery Area (FRA)&lt;/strong&gt;. Think of it as a time window — anything older than the target may be cleaned up to free space.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Flashback: Enable with Shutdown, Mount, ALTER</title><link>https://www.oraclescripts.com/post/oracle-database-enable-flashback-shutdown-mount-alter/</link><pubDate>Thu, 05 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-enable-flashback-shutdown-mount-alter/</guid><description>
&lt;h2 id="how-to-enable-oracle-database-flashback-shutdown-mount-and-alter-commands"&gt;How to Enable Oracle Database Flashback: Shutdown, Mount, and ALTER Commands&lt;/h2&gt;
&lt;p&gt;Oracle Flashback Database is one of the most powerful data protection tools available to a DBA. This guide walks you through the four commands needed to turn on Oracle Flashback — from a clean shutdown to opening the database in flashback mode.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="what-is-oracle-flashback-database"&gt;What Is Oracle Flashback Database?&lt;/h2&gt;
&lt;p&gt;Oracle Flashback Database lets you rewind your entire database to a previous point in time — without a full restore. Think of it like an &amp;quot;undo&amp;quot; button for your whole database. Instead of restoring from backup tapes, Oracle reads special &lt;strong&gt;flashback logs&lt;/strong&gt; stored in the &lt;strong&gt;Fast Recovery Area (FRA)&lt;/strong&gt; and rolls the database back in minutes.&lt;/p&gt;</description></item><item><title>resumable_timeout and v$session: Monitor Oracle Resumable Jobs</title><link>https://www.oraclescripts.com/post/oracle-resumable-import-parameters-monitor-dba-resumable/</link><pubDate>Wed, 04 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-resumable-import-parameters-monitor-dba-resumable/</guid><description>
&lt;h2 id="oracle-resumable-import-parameters-monitor-and-manage-dba_resumable"&gt;Oracle Resumable Import Parameters: Monitor and Manage DBA_RESUMABLE&lt;/h2&gt;
&lt;p&gt;When you run a large Oracle Data Pump import (&lt;code&gt;impdp&lt;/code&gt;), the job can fail mid-way if a tablespace runs out of space. Oracle's &lt;strong&gt;resumable import&lt;/strong&gt; feature prevents this by &lt;em&gt;suspending&lt;/em&gt; the job instead of failing it, giving you time to fix the problem and then letting the job continue automatically.&lt;/p&gt;
&lt;h2 id="what-is-a-resumable-import"&gt;What Is a Resumable Import?&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
A resumable operation is a database operation that can be paused when it hits a correctable error — such as a full tablespace — and then automatically resumed once the problem is fixed. Instead of losing all progress and restarting from zero, you simply add space and the import picks up where it left off.&lt;/p&gt;</description></item><item><title>Oracle Full Export via Named Pipe and Gzip in KSH</title><link>https://www.oraclescripts.com/post/oracle-full-export-compressed-named-pipe-ksh-script/</link><pubDate>Tue, 03 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-full-export-compressed-named-pipe-ksh-script/</guid><description>
&lt;h2 id="oracle-full-database-export-using-a-named-pipe-and-gzip-compression-in-ksh"&gt;Oracle Full Database Export Using a Named Pipe and Gzip Compression in KSH&lt;/h2&gt;
&lt;p&gt;Exporting a full Oracle database can produce very large dump files. This script solves that problem by streaming the export directly through a Linux named pipe into &lt;code&gt;gzip&lt;/code&gt;, compressing the output on the fly — without ever writing an uncompressed file to disk.&lt;/p&gt;
&lt;h2 id="what-this-script-does"&gt;What This Script Does&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
This KSH shell script performs a full Oracle database export (&lt;code&gt;exp&lt;/code&gt;) and compresses the output simultaneously using &lt;code&gt;gzip&lt;/code&gt; and a Linux named pipe (FIFO). It is designed to run as a background or &lt;code&gt;nohup&lt;/code&gt; job on a Unix/Linux server where Oracle is installed.&lt;/p&gt;</description></item><item><title>Oracle exp/imp Parfile: Direct Path Schema Migration</title><link>https://www.oraclescripts.com/post/oracle-exp-imp-par-or-parameter-file-direct-path-user-migration/</link><pubDate>Mon, 02 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-exp-imp-par-or-parameter-file-direct-path-user-migration/</guid><description>
&lt;h2 id="oracle-expimp-parameter-file-direct-path-user-to-user-data-migration"&gt;Oracle exp/imp Parameter File: Direct Path User-to-User Data Migration&lt;/h2&gt;
&lt;p&gt;Using a parameter file (&lt;code&gt;parfile&lt;/code&gt;) with Oracle's legacy &lt;code&gt;exp&lt;/code&gt; and &lt;code&gt;imp&lt;/code&gt; utilities is a clean, repeatable way to move schema data between users — especially when you need speed, control over what gets transferred, and a consistent log trail. This post breaks down a real-world Oracle export/import parameter file that uses OS authentication, direct path mode, and selective object filtering.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Export and Import via Gzip Named Pipe</title><link>https://www.oraclescripts.com/post/oracle-database-export-import-gzip-named-pipe/</link><pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-export-import-gzip-named-pipe/</guid><description>
&lt;h2 id="oracle-database-export-and-import-to-gzip-through-a-named-pipe"&gt;Oracle Database Export and Import to Gzip Through a Named Pipe&lt;/h2&gt;
&lt;p&gt;When you need to export a large Oracle database but do not have enough disk space for a full uncompressed dump file, piping the export directly through &lt;code&gt;gzip&lt;/code&gt; using a Unix named pipe is a proven technique. This method compresses data on the fly, producing a &lt;code&gt;.dmp.gz&lt;/code&gt; file that is typically &lt;strong&gt;only 20% of the size&lt;/strong&gt; of the original uncompressed dump.&lt;/p&gt;</description></item><item><title>Oracle RMAN Delete Obsolete Backups with Maintenance Channel</title><link>https://www.oraclescripts.com/post/oracle-rman-delete-obsolete-backups-maintenance-channel/</link><pubDate>Tue, 17 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-delete-obsolete-backups-maintenance-channel/</guid><description>
&lt;h2 id="oracle-rman-delete-obsolete-backups-with-maintenance-channel"&gt;Oracle RMAN Delete Obsolete Backups with Maintenance Channel&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The Oracle RMAN (Recovery Manager) commands shown in this script help database administrators manage backup storage by automatically removing old, unnecessary backup files. These commands allocate a maintenance channel for disk operations and delete obsolete backups based on specific redundancy policies, freeing up valuable storage space while maintaining the required number of backup copies for database recovery.&lt;/p&gt;
&lt;h2 id="code"&gt;Code&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;DELETE OBSOLETE REDUNDANCY = 4 device type disk;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;DELETE OBSOLETE REDUNDANCY = 2 device type disk;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;h3 id="line-1-allocate-channel-for-maintenance-device-type-disk"&gt;Line 1: ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command manually allocates a maintenance channel for disk-based operations. A maintenance channel is required before executing CHANGE, DELETE, or CROSSCHECK commands in RMAN. The maintenance channel tells RMAN which storage device (in this case, DISK) to use when managing backup files.&lt;/p&gt;</description></item><item><title>LIST BACKUPSET OF DATABASE: Oracle RMAN Command Guide</title><link>https://www.oraclescripts.com/post/list-backupset-of-database-oracle-rman/</link><pubDate>Mon, 16 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/list-backupset-of-database-oracle-rman/</guid><description>
&lt;h2 id="list-backupset-of-database-oracle-rman-command-guide"&gt;LIST BACKUPSET OF DATABASE: Oracle RMAN Command Guide&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;LIST BACKUPSET OF DATABASE&lt;/code&gt; command in Oracle Recovery Manager (RMAN) displays detailed information about all backup sets that contain database datafiles. This command helps database administrators verify backup existence, check backup status, find backup keys for restore operations, and audit backup history for compliance and recovery planning.&lt;/p&gt;
&lt;h2 id="command"&gt;Command&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;LIST BACKUPSET OF DATABASE;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="breakdown-of-code"&gt;Breakdown of Code&lt;/h2&gt;
&lt;h3 id="command-structure"&gt;Command Structure&lt;/h3&gt;
&lt;p&gt;The command combines three key components to query the RMAN repository:&lt;/p&gt;</description></item><item><title>Oracle RMAN Delete Expired Backup: Repository Cleanup</title><link>https://www.oraclescripts.com/post/oracle-rman-delete-expired-backup-guide/</link><pubDate>Sun, 15 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-delete-expired-backup-guide/</guid><description>
&lt;h2 id="oracle-rman-delete-expired-backup-complete-guide-to-repository-maintenance"&gt;Oracle RMAN Delete Expired Backup: Complete Guide to Repository Maintenance&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;DELETE EXPIRED BACKUP&lt;/code&gt; command in Oracle RMAN (Recovery Manager) removes expired backup records from the RMAN repository after they have been identified as inaccessible during a crosscheck operation. This command is essential for maintaining an accurate and synchronized RMAN repository, especially when backup files have been deleted at the operating system level without using RMAN commands.&lt;/p&gt;
&lt;h2 id="purpose-of-delete-expired-backup"&gt;Purpose of Delete Expired Backup&lt;/h2&gt;
&lt;p&gt;The primary purpose of this command is to clean up the RMAN repository by removing metadata entries for backups that no longer exist physically on disk or tape. When someone accidentally deletes RMAN backup files using operating system utilities, the RMAN repository becomes out of sync with the actual backup files. The &lt;code&gt;DELETE EXPIRED BACKUP&lt;/code&gt; command helps maintain repository accuracy by removing these orphaned records.&lt;/p&gt;</description></item><item><title>Oracle RMAN REPORT SCHEMA Command: Display Database Files</title><link>https://www.oraclescripts.com/post/oracle-rman-report-schema-command/</link><pubDate>Sat, 14 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-report-schema-command/</guid><description>
&lt;h2 id="oracle-rman-report-schema-command-display-database-files"&gt;Oracle RMAN REPORT SCHEMA Command: Display Database Files&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;REPORT SCHEMA&lt;/code&gt; command is an essential Oracle RMAN (Recovery Manager) tool that displays comprehensive information about all database files in your Oracle database. This command provides database administrators with a quick view of the current database structure, including permanent datafiles, temporary files, tablespaces, and their associated details. Unlike SQL queries that target specific data dictionary views, &lt;code&gt;REPORT SCHEMA&lt;/code&gt; retrieves information directly from the RMAN repository stored in the control file, making it a fast and reliable way to assess your database file structure before performing backup or recovery operations.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN RESTORE DATABASE VALIDATE Backup Check</title><link>https://www.oraclescripts.com/post/oracle-rman-restore-database-validate-check-backup/</link><pubDate>Fri, 13 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-restore-database-validate-check-backup/</guid><description>
&lt;h2 id="oracle-rman-restore-database-validate---check-backup-integrity"&gt;Oracle RMAN Restore Database Validate - Check Backup Integrity&lt;/h2&gt;
&lt;p&gt;The RESTORE DATABASE VALIDATE command is one of the most critical proactive health check operations in Oracle Recovery Manager (RMAN) that allows database administrators to verify backup integrity without performing an actual restore operation. This command checks whether backups are readable, accessible, and free from corruption, ensuring your database can be recovered when disaster strikes.&lt;/p&gt;
&lt;h2 id="purpose-of-restore-database-validate"&gt;Purpose of RESTORE DATABASE VALIDATE&lt;/h2&gt;
&lt;p&gt;The main purpose of the RESTORE DATABASE VALIDATE command is to check for corrupt blocks, missing files, and determine whether a backup set can be successfully restored. RMAN scans backup pieces and validates that all necessary files exist and are not corrupted, providing confidence in your backup strategy without impacting production systems. By default, this command validates only datafile backups and does not check control files, archive logs, or server parameter files unless explicitly specified.&lt;/p&gt;</description></item><item><title>Oracle RMAN Delete Obsolete - Remove Unneeded Backups</title><link>https://www.oraclescripts.com/post/oracle-rman-delete-obsolete-remove-unneeded-backups/</link><pubDate>Thu, 12 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-delete-obsolete-remove-unneeded-backups/</guid><description>
&lt;h2 id="oracle-rman-delete-obsolete---remove-unneeded-backups"&gt;Oracle RMAN Delete Obsolete - Remove Unneeded Backups&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;DELETE OBSOLETE&lt;/code&gt; command in Oracle RMAN (Recovery Manager) is a powerful maintenance tool that automatically removes backup files that are no longer needed for database recovery. This command helps database administrators manage storage space by deleting backups that fall outside the configured retention policy.&lt;/p&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The primary purpose of the &lt;code&gt;DELETE OBSOLETE&lt;/code&gt; command is to clean up old backups that are no longer required based on your retention policy. RMAN determines which backups are obsolete by comparing them against the configured retention policy, which can be based on either redundancy (number of backups to keep) or a recovery window (time period for point-in-time recovery). When backups become obsolete, they consume valuable storage space without providing additional recovery capabilities.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN Report Obsolete Redundancy Command Guide</title><link>https://www.oraclescripts.com/post/oracle-rman-report-obsolete-redundancy-command/</link><pubDate>Wed, 11 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-report-obsolete-redundancy-command/</guid><description>
&lt;h2 id="oracle-rman-report-obsolete-redundancy-command-guide"&gt;Oracle RMAN Report Obsolete Redundancy Command Guide&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;report obsolete redundancy = 2&lt;/code&gt; command in Oracle Recovery Manager (RMAN) identifies database backups that are no longer necessary for recovery operations based on a redundancy-based retention policy. This command helps database administrators determine which backups can be safely deleted to free up storage space while maintaining a minimum of two backup copies for each database file.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN Report Obsolete Command Guide</title><link>https://www.oraclescripts.com/post/oracle-rman-report-obsolete-command-guide/</link><pubDate>Tue, 10 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-report-obsolete-command-guide/</guid><description>
&lt;h2 id="oracle-rman-report-obsolete-command"&gt;Oracle RMAN Report Obsolete Command&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
The &lt;code&gt;REPORT OBSOLETE&lt;/code&gt; command in Oracle Recovery Manager (RMAN) helps database administrators identify backup files that are no longer required for recovery operations. This command compares existing backups against your configured retention policy and marks outdated backups as obsolete.&lt;/p&gt;
&lt;h3 id="code"&gt;Code&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;report obsolete;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;REPORT OBSOLETE&lt;/code&gt; command serves a critical function in database backup management by identifying backups that can be safely removed The command does not delete any files automatically; it only marks files as obsolete based on your retention policy. This allows administrators to review which backups are no longer necessary before performing cleanup operations.&lt;/p&gt;</description></item><item><title>List Backup of Archivelog All: Oracle RMAN Command Guide</title><link>https://www.oraclescripts.com/post/list-backup-of-archivelog-all-oracle-rman-command/</link><pubDate>Mon, 09 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/list-backup-of-archivelog-all-oracle-rman-command/</guid><description>
&lt;h2 id="list-backup-of-archivelog-all-oracle-rman-command-guide"&gt;List Backup of Archivelog All: Oracle RMAN Command Guide&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;LIST BACKUP OF ARCHIVELOG ALL&lt;/code&gt; command in Oracle Recovery Manager (RMAN) displays all existing backups of archived redo log files stored in the RMAN repository. This command helps database administrators track and manage archived log backups, verify backup completion, and plan recovery operations. Archive log backups are essential for point-in-time recovery and maintaining database consistency during restore operations.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN List Backup of Database Command</title><link>https://www.oraclescripts.com/post/oracle-rman-list-backup-of-database-command/</link><pubDate>Sun, 08 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-list-backup-of-database-command/</guid><description>
&lt;h2 id="oracle-rman-list-backup-of-database-command"&gt;Oracle RMAN List Backup of Database Command&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;LIST BACKUP OF DATABASE&lt;/code&gt; command is an Oracle Recovery Manager (RMAN) utility that displays all existing database backups stored in the RMAN repository. This command helps database administrators verify backup availability, review backup history, and plan recovery operations by providing detailed information about all datafile backups for the target database.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="code"&gt;Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;list backup of database;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="breakdown-of-code"&gt;Breakdown of Code&lt;/h2&gt;
&lt;p&gt;The command consists of three main components that work together to query the RMAN repository:&lt;/p&gt;</description></item><item><title>Oracle RMAN List Backupset Command Guide</title><link>https://www.oraclescripts.com/post/oracle-rman-list-backupset-command/</link><pubDate>Sat, 07 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-list-backupset-command/</guid><description>
&lt;h2 id="oracle-rman-list-backupset-command-guide"&gt;Oracle RMAN List Backupset Command Guide&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;list backupset;&lt;/code&gt; command in Oracle Recovery Manager (RMAN) displays detailed information about backup sets stored in the RMAN repository. This command helps database administrators view backup set metadata, including backup pieces, unique keys, completion times, and status information for recovery planning and backup verification.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="code"&gt;Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;list backupset;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="breakdown-of-the-command"&gt;Breakdown of the Command&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;list backupset;&lt;/code&gt; command is a simple RMAN reporting command that requires no additional parameters. When executed at the RMAN prompt, it queries the RMAN metadata stored in either the control file or recovery catalog and displays all registered backup sets.&lt;/p&gt;</description></item><item><title>Oracle RMAN Crosscheck Archivelog - Fix RMAN-06059 Error</title><link>https://www.oraclescripts.com/post/oracle-rman-crosscheck-archivelog-fix-rman-06059/</link><pubDate>Fri, 06 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-crosscheck-archivelog-fix-rman-06059/</guid><description>
&lt;h2 id="oracle-rman-crosscheck-archivelog---fix-rman-06059-error"&gt;Oracle RMAN Crosscheck Archivelog - Fix RMAN-06059 Error&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;change archivelog all crosscheck&lt;/code&gt; command is an Oracle Recovery Manager (RMAN) utility that synchronizes the RMAN repository metadata with the physical reality of archived redo log files. This command specifically resolves the RMAN-06059 error, which occurs when RMAN expects an archived log file but cannot find it on disk or tape storage. The crosscheck operation validates whether archived logs registered in the RMAN repository still exist at their recorded locations and updates their status accordingly.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Delete Archive Log Older Than 5 Days in Oracle RMAN</title><link>https://www.oraclescripts.com/post/delete-archive-log-older-than-five-days/</link><pubDate>Thu, 05 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/delete-archive-log-older-than-five-days/</guid><description>
&lt;h2 id="delete-archive-log-older-than-5-days-in-oracle-rman"&gt;Delete Archive Log Older Than 5 Days in Oracle RMAN&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;DELETE NOPROMPT ARCHIVELOG UNTIL TIME&lt;/code&gt; command removes old archive log files from your Oracle database to free up disk space and maintain storage efficiency. This RMAN (Recovery Manager) command automatically deletes archive logs that are older than a specified time period without requiring manual confirmation. Archive logs can quickly consume large amounts of disk space, making regular cleanup essential for database health and performance.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN Database Restore and Recovery Guide</title><link>https://www.oraclescripts.com/post/oracle-rman-database-restore-and-recovery-guide/</link><pubDate>Wed, 04 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-database-restore-and-recovery-guide/</guid><description>
&lt;h2 id="oracle-rman-database-restore-and-recovery-guide"&gt;Oracle RMAN Database Restore and Recovery Guide&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This guide provides complete Oracle RMAN (Recovery Manager) scripts for restoring and recovering Oracle databases in different scenarios. These scripts help database administrators perform full database recovery, point-in-time recovery (PITR), and verify controlfile backup records using RMAN commands. The scripts use parallel channel allocation to optimize backup and restore operations by running multiple channels simultaneously.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN Database Backup Commands Guide</title><link>https://www.oraclescripts.com/post/oracle-rman-database-backup-commands-guide/</link><pubDate>Tue, 03 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-database-backup-commands-guide/</guid><description>
&lt;h2 id="oracle-rman-database-backup-commands-guide"&gt;Oracle RMAN Database Backup Commands Guide&lt;/h2&gt;
&lt;p&gt;Oracle Recovery Manager (RMAN) is the primary tool for backing up and recovering Oracle databases, offering automated backup operations with built-in compression, encryption, and validation capabilities. This guide covers essential RMAN backup commands for hot backups, cold backups, archivelog management, and channel allocation strategies.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="purpose-of-rman-backup-commands"&gt;Purpose of RMAN Backup Commands&lt;/h2&gt;
&lt;p&gt;RMAN provides database administrators with powerful backup capabilities that ensure data protection and enable point-in-time recovery. The commands in this guide demonstrate four critical backup scenarios: complete database backups with archivelogs, controlled channel allocation for custom backup paths, archivelog-only backups, and cold backups for offline database protection.&lt;/p&gt;</description></item><item><title>Oracle RMAN: Delete Backup Pieces with Manual Channel</title><link>https://www.oraclescripts.com/post/how-to-delete-oracle-rman-backup-pieces-using-manual-channel-allocation/</link><pubDate>Mon, 02 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-delete-oracle-rman-backup-pieces-using-manual-channel-allocation/</guid><description>
&lt;h2 id="how-to-delete-oracle-rman-backup-pieces-using-manual-channel-allocation"&gt;How to Delete Oracle RMAN Backup Pieces Using Manual Channel Allocation&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The RMAN (Recovery Manager) delete backuppiece command removes specific backup pieces from Oracle database storage and updates the RMAN repository. This manual method allocates a maintenance channel to establish a direct connection between RMAN and the storage device (disk or tape), executes the deletion of a specific backup piece by its number, and then releases the channel. This approach gives database administrators precise control over which individual backup files to remove, making it useful for targeted cleanup operations when automated retention policies are not sufficient.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN Resync Catalog Command Guide</title><link>https://www.oraclescripts.com/post/oracle-rman-resync-catalog-command-guide/</link><pubDate>Sun, 01 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-resync-catalog-command-guide/</guid><description>
&lt;h2 id="oracle-rman-resync-catalog-command-guide"&gt;Oracle RMAN Resync Catalog Command Guide&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;RESYNC CATALOG&lt;/code&gt; command synchronizes the metadata stored in your Oracle RMAN recovery catalog with the current information in the target database control file. This ensures that all backup, restore, and recovery operations use the most accurate and up-to-date database information. The command performs a full comparison between the recovery catalog and control file, updating any missing or changed records.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN CROSSCHECK BACKUP Command Explained</title><link>https://www.oraclescripts.com/post/oracle-rman-crosscheck-backup-command/</link><pubDate>Sat, 31 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-crosscheck-backup-command/</guid><description>
&lt;h2 id="oracle-rman-crosscheck-backup-command---verify-backup-availability"&gt;Oracle RMAN Crosscheck Backup Command - Verify Backup Availability&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;CROSSCHECK BACKUP&lt;/code&gt; command is an essential Oracle RMAN (Recovery Manager) tool that verifies whether backup files recorded in the RMAN repository still physically exist on storage media. This command synchronizes the logical records in your RMAN repository with the actual physical reality of your backups on disk or tape. When backups are deleted outside of RMAN control or become unavailable due to hardware failures, the crosscheck command identifies these missing files and marks them as &amp;quot;EXPIRED&amp;quot;. This process ensures your backup catalog remains accurate and prevents restore failures during critical recovery operations.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN Reset Database After RESETLOGS Recovery</title><link>https://www.oraclescripts.com/post/oracle-rman-reset-database-after-resetlogs/</link><pubDate>Fri, 09 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-reset-database-after-resetlogs/</guid><description>
&lt;h2 id="oracle-rman-reset-database-after-resetlogs-recovery"&gt;Oracle RMAN Reset Database After RESETLOGS Recovery&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;RESET DATABASE&lt;/code&gt; command in Oracle Recovery Manager (RMAN) notifies the recovery catalog that a new database incarnation has been created after opening the database with the RESETLOGS option. This command is essential for maintaining synchronization between the RMAN repository and the target database following incomplete recovery, point-in-time recovery, or recovery using a backup control file.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle RMAN Unregister Database from Recovery Catalog</title><link>https://www.oraclescripts.com/post/oracle-rman-unregister-database-from-recovery-catalog/</link><pubDate>Thu, 08 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rman-unregister-database-from-recovery-catalog/</guid><description>
&lt;h2 id="oracle-rman-unregister-database-from-recovery-catalog"&gt;Oracle RMAN Unregister Database from Recovery Catalog&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Unregistering a database from an Oracle RMAN (Recovery Manager) recovery catalog removes all backup metadata and database information from the catalog repository. This process is essential when a database is decommissioned, no longer needs catalog-based backups, or when you need to clean up old database entries that are no longer accessible. The DBMS_RCVCAT package provides a direct SQL method to remove database registrations without requiring access to the target database.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>How to Register an Oracle Database with RMAN Catalog</title><link>https://www.oraclescripts.com/post/how-to-register-an-oracle-database-with-rman-catalog/</link><pubDate>Wed, 07 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-register-an-oracle-database-with-rman-catalog/</guid><description>
&lt;h2 id="how-to-register-an-oracle-database-with-rman-catalog"&gt;How to Register an Oracle Database with RMAN Catalog&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The RMAN register database command adds a target database to the recovery catalog so that Recovery Manager can track and maintain backup metadata. This allows RMAN to store backup information, recovery points, and database structure details in a central repository instead of relying only on the control file.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Before registering a database with RMAN catalog, the target database must have a password file created. The password file enables remote authentication for SYSDBA or SYSBACKUP privileges, which RMAN requires to connect and manage backups. You can create a password file using the &lt;code&gt;orapwd&lt;/code&gt; utility with the command
&lt;code&gt;orapwd file=orapw&amp;lt;SID&amp;gt; password=&amp;lt;password&amp;gt; entries=&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/p&gt;</description></item><item><title>How to Create Oracle RMAN Recovery Catalog Step by Step</title><link>https://www.oraclescripts.com/post/how-to-create-oracle-rman-recovery-catalog-step-by-step/</link><pubDate>Tue, 06 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-create-oracle-rman-recovery-catalog-step-by-step/</guid><description>
&lt;h2 id="how-to-create-oracle-rman-recovery-catalog-step-by-step"&gt;How to Create Oracle RMAN Recovery Catalog Step by Step&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The Oracle Recovery Manager (RMAN) recovery catalog is a dedicated database schema that stores metadata about backup and recovery operations for one or more target databases. This script demonstrates how to create a recovery catalog by establishing a separate tablespace, creating a catalog owner user, granting necessary privileges, and initializing the catalog schema. Using a recovery catalog provides better backup tracking, supports longer retention policies, and enables advanced RMAN features compared to using only the target database's control file.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Data Guard: V$ARCHIVE_DEST Log Destinations</title><link>https://www.oraclescripts.com/post/oracle-display-log-destinations-options/</link><pubDate>Mon, 05 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-display-log-destinations-options/</guid><description>
&lt;h2 id="display-log-destinations-options-for-oracle-data-guard-primary-database"&gt;Display Log Destinations Options for Oracle Data Guard Primary Database&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This SQL script displays detailed information about all configured archive log destinations on an Oracle Data Guard primary database. The query retrieves critical configuration parameters from the V$ARCHIVE_DEST view, allowing database administrators to monitor how redo logs are transmitted to standby databases and archived locally. This monitoring is essential for ensuring proper log shipping, identifying configuration issues, and maintaining high availability in Data Guard environments.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Data Guard Log Destinations Monitoring Script</title><link>https://www.oraclescripts.com/post/oracle-database-log-destinations-monitoring-script/</link><pubDate>Sun, 04 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-log-destinations-monitoring-script/</guid><description>
&lt;h2 id="oracle-database-log-destinations-monitoring-script-for-data-guard"&gt;Oracle Database Log Destinations Monitoring Script for Data Guard&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL script monitors all log destinations in a Data Guard configuration from the primary database. The query provides real-time information about archive log destinations, their status, operational modes, and standby redo log activity. Database administrators use this script to verify that archive logs are being shipped correctly to standby databases and to identify any issues with log transmission.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Check Oracle Data Guard Standby Synchronization Status</title><link>https://www.oraclescripts.com/post/check-oracle-data-guard-standby-synchronization-status/</link><pubDate>Sat, 03 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/check-oracle-data-guard-standby-synchronization-status/</guid><description>
&lt;h2 id="how-to-check-physical-standby-database-synchronization"&gt;How to Check Physical Standby Database Synchronization&lt;/h2&gt;
&lt;p&gt;Physical standby databases in Oracle Data Guard need regular monitoring to ensure they stay synchronized with the primary database. The most effective way to check synchronization status is by comparing the current sequence number on the primary database with the applied sequence number on the standby database.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;These SQL queries help database administrators quickly identify if a physical standby database is lagging behind the primary database. By comparing sequence numbers, you can determine the replication gap and take corrective action if the standby falls too far behind. This monitoring is essential for disaster recovery readiness and maintaining your Recovery Point Objective (RPO).&lt;/p&gt;</description></item><item><title>Oracle Logical Standby Apply Stop and Start Commands</title><link>https://www.oraclescripts.com/post/oracle-logical-standby-apply-stop-start/</link><pubDate>Fri, 02 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-logical-standby-apply-stop-start/</guid><description>
&lt;h2 id="oracle-logical-standby-apply-stop-and-start-commands"&gt;Oracle Logical Standby Apply Stop and Start Commands&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The logical standby apply commands control the SQL Apply process in Oracle Data Guard logical standby databases. These commands allow database administrators to stop and start the application of redo log data from the primary database to the logical standby database, which is essential for maintenance tasks, troubleshooting, and configuration changes.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>How to Check Oracle Database Role Using V$DATABASE View</title><link>https://www.oraclescripts.com/post/how-to-check-oracle-database-role-using-vdatabase-view/</link><pubDate>Thu, 01 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-check-oracle-database-role-using-vdatabase-view/</guid><description>
&lt;h2 id="how-to-check-oracle-database-role-using-vdatabase-view"&gt;How to Check Oracle Database Role Using V$DATABASE View&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The SQL query &lt;code&gt;SELECT database_role FROM v$database&lt;/code&gt; is a fundamental Oracle Database command used to determine the current operational role of a database instance. This query is essential for Database Administrators (DBAs) working with Oracle Data Guard configurations, as it quickly identifies whether the database is functioning as a PRIMARY database, PHYSICAL STANDBY, LOGICAL STANDBY, or SNAPSHOT STANDBY.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Data Guard Standby Redo Log Query: Groups and Members</title><link>https://www.oraclescripts.com/post/oracle-standby-redo-logs-list-query/</link><pubDate>Thu, 01 Jan 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-standby-redo-logs-list-query/</guid><description>
&lt;h2 id="list-all-standby-redo-logs-in-oracle-data-guard"&gt;List All Standby Redo Logs in Oracle Data Guard&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;A switchover attempted on a busy Friday afternoon reveals the gap: the standby has been synchronized for months, but no standby redo log group was sized to match the primary's 500 MB online redo logs. The configuration worked fine for the archived-log transport model, but enabling real-time apply requires SRL groups that were never created. The query below surfaces exactly this class of misconfiguration before it becomes a switchover incident.&lt;/p&gt;</description></item><item><title>Oracle Data Guard: Stop Broker with ALTER SYSTEM</title><link>https://www.oraclescripts.com/post/oracle-data-guard-stop-broker/</link><pubDate>Sat, 29 Nov 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-data-guard-stop-broker/</guid><description>
&lt;h2 id="how-to-stop-oracle-data-guard-broker-using-alter-system-command"&gt;How to Stop Oracle Data Guard Broker Using ALTER SYSTEM Command&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The command &lt;code&gt;ALTER SYSTEM SET dg_broker_start=false&lt;/code&gt; stops the Oracle Data Guard broker by shutting down the Data Guard monitor (DMON) background process. This command is essential when you need to disable broker management temporarily for maintenance tasks, troubleshooting, or configuration changes. Setting this parameter to FALSE prevents the broker from automatically starting when the database instance restarts.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Enable FAL Tracing on Primary Database</title><link>https://www.oraclescripts.com/post/oracle-enable-fal-tracing-primary-database/</link><pubDate>Fri, 28 Nov 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-enable-fal-tracing-primary-database/</guid><description>
&lt;h2 id="oracle-enable-fal-tracing-on-primary-database"&gt;Oracle Enable FAL Tracing on Primary Database&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Enabling FAL (Fetch Archive Log) tracing on the primary database helps database administrators monitor and troubleshoot archive log gap resolution between primary and standby databases in Oracle Data Guard environments. This command activates detailed trace logging for the FAL server process, which handles requests from standby databases when they detect missing archive logs. The trace output provides valuable diagnostic information for resolving synchronization issues and understanding redo transport behavior.&lt;/p&gt;</description></item><item><title>How to Disable and Enable Oracle Archive Log Destinations</title><link>https://www.oraclescripts.com/post/disable-enable-archive-log-destinations/</link><pubDate>Thu, 27 Nov 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/disable-enable-archive-log-destinations/</guid><description>
&lt;h2 id="how-to-disable-and-enable-oracle-archive-log-destinations"&gt;How to Disable and Enable Oracle Archive Log Destinations&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The Oracle commands for disabling and enabling archive log destinations allow database administrators to control the availability of archive destinations without removing the configuration. These commands are commonly used in Oracle Data Guard environments to temporarily stop or resume redo log shipping to standby databases during maintenance operations, troubleshooting, or planned outages.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Check Missing Archive Logs in Oracle Data Guard</title><link>https://www.oraclescripts.com/post/check-missing-archive-logs-oracle-data-guard-standby/</link><pubDate>Wed, 26 Nov 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/check-missing-archive-logs-oracle-data-guard-standby/</guid><description>
&lt;h2 id="check-missing-archive-logs-in-oracle-data-guard-standby-database"&gt;Check Missing Archive Logs in Oracle Data Guard Standby Database&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This SQL query helps database administrators identify missing archive logs on an Oracle Data Guard standby database. When archive logs fail to transfer from the primary to the standby database, it creates gaps that prevent proper synchronization. Running this query on the standby database reveals which log sequences are present locally but missing at the destination, allowing administrators to take corrective action before the gap becomes too large.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Data Guard: Fix FAL and Logfile Registration</title><link>https://www.oraclescripts.com/post/oracle-data-guard-fal-physical-logfile-registration-standby-recovery/</link><pubDate>Tue, 25 Nov 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-data-guard-fal-physical-logfile-registration-standby-recovery/</guid><description>
&lt;h2 id="troubleshooting-oracle-data-guard-fal-and-physical-logfile-registration-issues"&gt;Troubleshooting Oracle Data Guard FAL and Physical Logfile Registration Issues&lt;/h2&gt;
&lt;p&gt;Oracle Data Guard environments sometimes encounter issues when the Fetch Archive Log (FAL) process fails to automatically transfer missing archive logs to standby databases. When FAL reports that a log is already registered or cannot retrieve missing logs, database administrators need manual intervention to restore synchronization between primary and standby databases. This guide provides step-by-step commands to register physical logfiles and recover standby databases when automatic processes fail.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Register Missing Log File in Oracle Data Guard Database</title><link>https://www.oraclescripts.com/post/register-missing-log-file-oracle-data-guard-database/</link><pubDate>Sun, 26 Oct 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/register-missing-log-file-oracle-data-guard-database/</guid><description>
&lt;h2 id="register-missing-log-file-in-oracle-database"&gt;Register Missing Log File in Oracle Database&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;ALTER DATABASE REGISTER PHYSICAL LOGFILE&lt;/code&gt; command is used to manually register archived redo log files in an Oracle Data Guard environment, specifically for physical standby databases. This command becomes essential when automatic log registration fails or when gaps occur in the archive log sequence on standby databases.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h3 id="purpose"&gt;Purpose&lt;/h3&gt;
&lt;p&gt;This SQL command serves a critical role in Oracle Data Guard configurations by allowing database administrators to manually register archived redo log files that were not automatically registered by the standby database. The primary purpose is to resolve gaps in the archive log sequence, ensuring that the standby database remains synchronized with the primary database and can successfully apply all redo data. When the automatic gap resolution mechanism fails or when logs are manually copied to the standby location, this command enables the control file to recognize and catalog these log files for recovery operations.&lt;/p&gt;</description></item><item><title>Cancel Oracle Data Guard Managed Recovery</title><link>https://www.oraclescripts.com/post/cancel-oracle-data-guard-managed-recovery/</link><pubDate>Sat, 25 Oct 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/cancel-oracle-data-guard-managed-recovery/</guid><description>
&lt;h2 id="how-to-cancel-oracle-data-guard-managed-recovery"&gt;How to Cancel Oracle Data Guard Managed Recovery&lt;/h2&gt;
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL&lt;/code&gt; command stops the Managed Recovery Process (MRP) on an Oracle Data Guard physical standby database. This command is essential when you need to perform maintenance operations, open the database in read-only mode, or troubleshoot synchronization issues between primary and standby databases.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;-- Cancel managed recovery
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The cancel managed recovery command serves several critical purposes in Oracle Data Guard environments:&lt;/p&gt;</description></item><item><title>Removing Standby Database Apply Delay in Oracle Data Guard</title><link>https://www.oraclescripts.com/post/removing-standby-database-apply-delay-oracle-data-guard/</link><pubDate>Fri, 24 Oct 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/removing-standby-database-apply-delay-oracle-data-guard/</guid><description>
&lt;h2 id="removing-standby-database-apply-delay-in-oracle-data-guard"&gt;Removing Standby Database Apply Delay in Oracle Data Guard&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This script removes the apply delay from an Oracle Data Guard physical standby database. Apply delays are safety features that create a time lag between when redo data arrives at the standby database and when it is applied, protecting against corrupted or incorrect data from the primary database. These commands cancel any existing recovery process and restart it immediately without delay.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Data Guard Standby Database Startup Commands</title><link>https://www.oraclescripts.com/post/oracle-data-guard-standby-database-startup-commands/</link><pubDate>Thu, 23 Oct 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-data-guard-standby-database-startup-commands/</guid><description>
&lt;h2 id="oracle-data-guard-standby-database-startup-commands"&gt;Oracle Data Guard Standby Database Startup Commands&lt;/h2&gt;
&lt;p&gt;Oracle Data Guard standby database startup commands enable database administrators to initialize and maintain physical standby databases that provide disaster recovery and high availability for production systems. These three essential commands work together to bring a standby database online and synchronize it with the primary database through automated redo log application.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The Oracle Data Guard startup sequence serves to establish and maintain a synchronized replica of the primary database at a remote location. These commands initialize the standby instance, mount the standby database, and activate the Managed Recovery Process (MRP) to continuously apply redo data from the primary database. This configuration enables organizations to protect against data loss, minimize downtime during disasters, and offload read-only workloads from production systems.&lt;/p&gt;</description></item><item><title>Oracle ASH Report: Generate with ashrpt.sql</title><link>https://www.oraclescripts.com/post/generate-active-session-history-ash-report-in-oracle-database/</link><pubDate>Fri, 03 Oct 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/generate-active-session-history-ash-report-in-oracle-database/</guid><description>
&lt;h2 id="generate-active-session-history-ash-report-in-oracle-database"&gt;Generate Active Session History ASH Report in Oracle Database&lt;/h2&gt;
&lt;p&gt;The Active Session History (ASH) report is a powerful diagnostic tool that helps database administrators analyze performance issues by capturing detailed snapshots of active database sessions every second. This report provides granular insights into what database sessions are doing at specific points in time, making it essential for troubleshooting performance problems.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Time Model Queries: v$sys_time_model Monitoring</title><link>https://www.oraclescripts.com/post/oracle-time-model-queries-system-and-session-performance-monitoring/</link><pubDate>Thu, 02 Oct 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-time-model-queries-system-and-session-performance-monitoring/</guid><description>
&lt;h2 id="oracle-time-model-queries-system-and-session-performance-monitoring"&gt;Oracle Time Model Queries: System and Session Performance Monitoring&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Oracle time model queries provide database administrators with powerful tools to measure and analyze where time is spent within the database system. These queries use two essential dynamic performance views that track accumulated time for various database operations in microseconds. The primary purpose is to identify performance bottlenecks by examining how much time the database spends on different operations, helping administrators prioritize tuning efforts effectively.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
Time model statistics measure DB time, which represents the total time spent in database calls by foreground sessions and serves as an indicator of total instance workload. By analyzing these metrics, database professionals can determine whether the system is constrained by CPU resources or waiting for other operations to complete.&lt;/p&gt;</description></item><item><title>Oracle: Enable or Disable GATHER_STATS_JOB</title><link>https://www.oraclescripts.com/post/enable-or-disable-the-oracle-gather-stats-job-using-dbms-scheduler/</link><pubDate>Wed, 01 Oct 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/enable-or-disable-the-oracle-gather-stats-job-using-dbms-scheduler/</guid><description>
&lt;h2 id="enable-or-disable-oracle-gather_stats_job-for-automatic-statistics-collection"&gt;Enable or Disable Oracle GATHER_STATS_JOB for Automatic Statistics Collection&lt;/h2&gt;
&lt;p&gt;The GATHER_STATS_JOB is a critical Oracle Database scheduled job that automatically collects optimizer statistics to ensure the database query optimizer generates efficient execution plans. This job is enabled by default when creating a new Oracle database and runs during predefined maintenance windows.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h3 id="purpose"&gt;Purpose&lt;/h3&gt;
&lt;p&gt;The GATHER_STATS_JOB maintains &lt;strong&gt;optimal query performance&lt;/strong&gt; by automatically gathering optimizer statistics for database objects that have missing or stale statistics. The job executes the internal procedure DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROC, which prioritizes objects that most urgently need updated statistics. This ensures critical statistics are collected before the maintenance window closes.&lt;/p&gt;</description></item><item><title>How to Remove an Oracle AWR Baseline Using DROP_BASELINE</title><link>https://www.oraclescripts.com/post/how-to-remove-an-oracle-awr-baseline-using-dbms-workload-repository-drop-baseline/</link><pubDate>Tue, 30 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-remove-an-oracle-awr-baseline-using-dbms-workload-repository-drop-baseline/</guid><description>
&lt;h2 id="how-to-remove-an-oracle-awr-baseline-using-drop_baseline"&gt;How to Remove an Oracle AWR Baseline Using DROP_BASELINE&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;DROP_BASELINE&lt;/code&gt; procedure removes a previously-defined AWR (Automatic Workload Repository) baseline from an Oracle database. This command is essential for database administrators who need to conserve storage space by deleting unused or outdated performance baselines while maintaining the flexibility to preserve or purge the underlying snapshot data.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h3 id="breakdown-of-code"&gt;Breakdown of Code&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Query:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle AWR Baseline with DBMS_WORKLOAD_REPOSITORY</title><link>https://www.oraclescripts.com/post/use-oracle-dbms-workload-repository-to-create-an-awr-baseline-for-performance-monitoring/</link><pubDate>Mon, 29 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/use-oracle-dbms-workload-repository-to-create-an-awr-baseline-for-performance-monitoring/</guid><description>
&lt;h2 id="oracle-awr-create-baseline-for-performance-monitoring-dbms_workload_repositorycreate_baseline"&gt;Oracle AWR Create Baseline for Performance Monitoring DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE&lt;/h2&gt;
&lt;h2 id="what-is-oracle-awr-create-baseline"&gt;What is Oracle AWR Create Baseline&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE&lt;/code&gt; procedure creates a baseline by preserving a specific range of AWR snapshots for future performance comparisons. A baseline protects performance data from automatic purging and allows database administrators to compare current performance against known good performance periods.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="purpose-of-creating-awr-baselines"&gt;Purpose of Creating AWR Baselines&lt;/h2&gt;
&lt;p&gt;AWR baselines serve as reference points for database performance analysis by capturing system behavior during optimal or significant time periods. These preserved snapshots help identify performance degradation over time and provide a foundation for comparing different workload patterns. Baselines are excluded from automatic AWR purging processes and remain available indefinitely for analysis.&lt;/p&gt;</description></item><item><title>List All Oracle AWR Baselines Using DBA_HIST_BASELINE</title><link>https://www.oraclescripts.com/post/list-all-oracle-awr-baselines-using-dba-hist-baseline/</link><pubDate>Sun, 28 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/list-all-oracle-awr-baselines-using-dba-hist-baseline/</guid><description>
&lt;h2 id="list-all-oracle-awr-baselines-using-dba_hist_baseline"&gt;List All Oracle AWR Baselines Using DBA_HIST_BASELINE&lt;/h2&gt;
&lt;p&gt;This SQL script retrieves all AWR baselines stored in an Oracle Database, displaying critical information about each baseline including its identifier, name, and associated snapshot range. AWR baselines preserve specific periods of database performance statistics that are excluded from automatic purging, allowing database administrators to compare current performance against historical optimal periods.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h3 id="purpose"&gt;Purpose&lt;/h3&gt;
&lt;p&gt;The primary purpose of this query is to display all existing AWR baselines in the database system. Baselines are essential for performance diagnostics because they preserve typical runtime statistics in the AWR repository, enabling administrators to compare current database performance against established performance benchmarks. This script helps identify which time periods have been preserved for performance analysis and troubleshooting.&lt;/p&gt;</description></item><item><title>Oracle AWR Manual Snapshot: DBMS_WORKLOAD_REPOSITORY</title><link>https://www.oraclescripts.com/post/mannually-take-an-oracle-database-awr-snapshot-dbms-workload-repository/</link><pubDate>Sat, 27 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/mannually-take-an-oracle-database-awr-snapshot-dbms-workload-repository/</guid><description>
&lt;h2 id="how-to-manually-take-an-awr-snapshot-in-oracle-database-with-dbms_workload_repositorycreate_snapshot"&gt;How to Manually Take an AWR Snapshot in Oracle Database with dbms_workload_repository.create_snapshot&lt;/h2&gt;
&lt;h2 id="what-is-oracle-awr-snapshot-creation"&gt;What is Oracle AWR Snapshot Creation?&lt;/h2&gt;
&lt;p&gt;Creating a manual AWR snapshot in Oracle Database allows database administrators to capture performance statistics at specific points in time, providing precise data for troubleshooting and performance analysis. The &lt;code&gt;DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT&lt;/code&gt; procedure creates an on-demand snapshot outside the automatic hourly collection schedule.&lt;/p&gt;
&lt;h2 id="purpose-of-manual-awr-snapshots"&gt;Purpose of Manual AWR Snapshots&lt;/h2&gt;
&lt;p&gt;Manual AWR snapshot creation serves critical purposes for Oracle database administrators and performance engineers. The primary purpose is to capture database performance metrics during specific time windows that require detailed analysis. Database administrators use manual snapshots when investigating performance issues that occur at irregular intervals or when testing changes before and after implementation. This allows for precise comparison of database behavior during shorter intervals than the default one-hour automatic snapshot period.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle AWR: Change Retention Period to 14 Days</title><link>https://www.oraclescripts.com/post/how-to-change-oracle-awr-retention-period-to-14-days-using-dbms-workload-repository/</link><pubDate>Fri, 26 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-change-oracle-awr-retention-period-to-14-days-using-dbms-workload-repository/</guid><description>
&lt;h2 id="how-to-change-oracle-awr-retention-period-to-14-days-using-dbms_workload_repositorymodify_snapshot_settings"&gt;How to Change Oracle AWR Retention Period to 14 Days using dbms_workload_repository.modify_snapshot_settings&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The Oracle code changes the Automatic Workload Repository (AWR) retention period from the default 8 days to 14 days (two weeks). This allows database administrators to store performance snapshots for a longer period, enabling better historical analysis and trend identification across extended time frames.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="query-and-code-breakdown"&gt;Query and Code Breakdown&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;User Query:&lt;/strong&gt; Change the retention period to two weeks (14 days)&lt;/p&gt;</description></item><item><title>Oracle AWR Snapshot Interval: modify_snapshot_settings</title><link>https://www.oraclescripts.com/post/oracle-awr-snapshot-interval-change-dbms-workload-repository/</link><pubDate>Thu, 25 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-awr-snapshot-interval-change-dbms-workload-repository/</guid><description>
&lt;h2 id="how-to-change-oracle-awr-snapshot-interval-to-30-minutes-using-dbms_workload_repositorymodify_snapshot_settings"&gt;How to Change Oracle AWR Snapshot Interval to 30 Minutes using dbms_workload_repository.modify_snapshot_settings&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
The Oracle Database Automatic Workload Repository (AWR) collects and stores performance statistics to help database administrators monitor and analyze database performance over time. The code modifies the snapshot collection interval from the default 60 minutes to 30 minutes, allowing for more frequent and detailed performance data capture. This adjustment provides better visibility into database behavior and helps identify short-lived performance issues that might be missed with longer intervals.&lt;/p&gt;</description></item><item><title>Oracle AWR Interval and Retention: DBA_HIST_WR_CONTROL</title><link>https://www.oraclescripts.com/post/oracle-awr-snapshot-interval-retention-settings-using-dba-hist-wr-control/</link><pubDate>Wed, 24 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-awr-snapshot-interval-retention-settings-using-dba-hist-wr-control/</guid><description>
&lt;h2 id="how-to-check-oracle-awr-snapshot-interval-and-retention-settings-using-table-dba_hist_wr_control"&gt;How to Check Oracle AWR Snapshot Interval and Retention Settings using table dba_hist_wr_control&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The Oracle Database Automatic Workload Repository (AWR) is a critical component for performance monitoring and database tuning that automatically collects and stores performance statistics at regular intervals. This SQL script allows database administrators to quickly view the current AWR snapshot interval (how often snapshots are taken) and retention period (how long snapshots are kept) by querying the DBA_HIST_WR_CONTROL view. Understanding these settings is essential for effective performance analysis, as they determine the granularity and historical depth of performance data available for troubleshooting and optimization tasks.&lt;/p&gt;</description></item><item><title>Oracle AWR Report Generation Using awrrpt.sql Script</title><link>https://www.oraclescripts.com/post/oracle-awr-report-generation-using-awrrpt-sql-script/</link><pubDate>Tue, 23 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-awr-report-generation-using-awrrpt-sql-script/</guid><description>
&lt;h2 id="oracle-awr-report-generation-using-awrrptsql-script"&gt;Oracle AWR Report Generation Using awrrpt.sql Script&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;awrrpt.sql&lt;/code&gt; script is a powerful Oracle tool that generates comprehensive performance reports from the Automatic Workload Repository (AWR), providing database administrators with detailed insights into database performance over specific time periods. This script is essential for troubleshooting performance issues, identifying bottlenecks, and optimizing Oracle database operations.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h3 id="what-is-the-command"&gt;What is the Command&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;@?/rdbms/admin/awrrpt.sql
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command executes the AWR report generation script located in the Oracle RDBMS admin directory. The question mark (&lt;code&gt;?&lt;/code&gt;) is a SQL*Plus substitution variable that automatically represents the &lt;code&gt;ORACLE_HOME&lt;/code&gt; directory path, eliminating the need to type the full path.&lt;/p&gt;</description></item><item><title>Oracle AWR Snapshots: Query dba_hist_snapshot</title><link>https://www.oraclescripts.com/post/display-a-list-of-oracle-awr-snapshots-using-dba-hist-snapshot/</link><pubDate>Mon, 22 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/display-a-list-of-oracle-awr-snapshots-using-dba-hist-snapshot/</guid><description>
&lt;h2 id="understanding-oracle-awr-snapshot-display"&gt;Understanding Oracle AWR Snapshot Display&lt;/h2&gt;
&lt;p&gt;The Oracle Automatic Workload Repository (AWR) is a performance diagnostic tool that collects, processes, and stores database statistics automatically. Displaying a list of available snapshots is essential for database administrators who need to generate AWR reports, analyze performance trends, and troubleshoot database issues. This script provides a quick and efficient way to view all available snapshots in the system with their snapshot IDs, levels, and start times.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Statspack: Automate Snapshots with spauto.sql</title><link>https://www.oraclescripts.com/post/oracle-statspack-automation-scheduling-hourly-database-performance-snapshots/</link><pubDate>Sun, 07 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-statspack-automation-scheduling-hourly-database-performance-snapshots/</guid><description>
&lt;h2 id="oracle-statspack-automation-scheduling-hourly-database-performance-snapshots"&gt;Oracle Statspack Automation: Scheduling Hourly Database Performance Snapshots&lt;/h2&gt;
&lt;p&gt;Oracle Statspack automation provides database administrators with continuous performance monitoring capabilities through scheduled snapshot collection. The &lt;code&gt;spauto.sql&lt;/code&gt; script enables automated hourly snapshots that capture essential database performance metrics without manual intervention.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The Oracle Statspack automation script serves as a critical tool for proactive database performance management. By implementing automated snapshots, database administrators can maintain consistent performance monitoring, identify trends, and troubleshoot issues using historical performance data.&lt;/p&gt;</description></item><item><title>Oracle: Uninstall Statspack Using the spdrop Script</title><link>https://www.oraclescripts.com/post/how-to-uninstall-oracle-statspack-using-the-spdrop-script-complete-guide/</link><pubDate>Sat, 06 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-uninstall-oracle-statspack-using-the-spdrop-script-complete-guide/</guid><description>
&lt;h2 id="how-to-uninstall-oracle-statspack-using-the-spdrop-script---complete-guide"&gt;How to Uninstall Oracle Statspack Using the spdrop Script - Complete Guide&lt;/h2&gt;
&lt;p&gt;Oracle Statspack uninstallation is accomplished using the &lt;code&gt;@?/rdbms/admin/spdrop&lt;/code&gt; command, which completely removes the Statspack performance monitoring framework from your Oracle database. This command removes all associated objects including the PERFSTAT user, tables, procedures, and collected performance data.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="understanding-the-query-breakdown"&gt;Understanding the Query Breakdown&lt;/h2&gt;
&lt;p&gt;The user query &amp;quot;Uninstall statspack @?/rdbms/admin/spdrop&amp;quot; represents a common Oracle DBA task for removing the Statspack performance monitoring tool. The command structure breaks down into specific components that work together to cleanly remove all Statspack components from the database environment.&lt;/p&gt;</description></item><item><title>Oracle Statspack Installation Guide: spcreate Setup</title><link>https://www.oraclescripts.com/post/oracle-database-statspack-installation-guide-complete-setup-and-configuration/</link><pubDate>Fri, 05 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-statspack-installation-guide-complete-setup-and-configuration/</guid><description>
&lt;h2 id="oracle-database-statspack-installation-guide---complete-setup-and-configuration"&gt;Oracle Database Statspack Installation Guide - Complete Setup and Configuration&lt;/h2&gt;
&lt;p&gt;Oracle Statspack is a powerful database performance monitoring tool that collects and analyzes system statistics to help database administrators identify performance bottlenecks and optimize database operations.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="query-analysis-and-code-breakdown"&gt;Query Analysis and Code Breakdown&lt;/h2&gt;
&lt;p&gt;The original query involves installing Oracle Statspack with these essential steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Create a tablespace (minimum size 100MB)&lt;/strong&gt; - This provides dedicated storage space for Statspack objects and data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run @?/rdbms/admin/spcreate&lt;/strong&gt; - This executes the main Statspack installation script that creates the PERFSTAT user and required database objects&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let's examine each component in detail.&lt;/p&gt;</description></item><item><title>Oracle Statspack: List Snapshots with stats$snapshot</title><link>https://www.oraclescripts.com/post/how-to-list-oracle-statspack-snapshots-with-sql-query/</link><pubDate>Thu, 04 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-list-oracle-statspack-snapshots-with-sql-query/</guid><description>
&lt;h2 id="how-to-list-oracle-statspack-snapshots-with-sql-query"&gt;How to List Oracle Statspack Snapshots with SQL Query&lt;/h2&gt;
&lt;p&gt;This Oracle Database query provides a simple way to view all Statspack snapshots stored in your database. Statspack is Oracle's built-in performance monitoring tool that captures database statistics at regular intervals, helping database administrators analyze system performance over time.&lt;/p&gt;
&lt;h2 id="purpose-of-the-code"&gt;Purpose of the Code&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
The primary purpose of this SQL script is to retrieve and display a comprehensive list of all Statspack snapshots with their essential details. This information helps database administrators track when performance snapshots were taken and plan their performance analysis activities accordingly.&lt;/p&gt;</description></item><item><title>spreport.sql: Generate Oracle Statspack Performance Reports</title><link>https://www.oraclescripts.com/post/oracle-database-statspack-spreport-sql-script-complete-performance-tuning-guide/</link><pubDate>Wed, 03 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-statspack-spreport-sql-script-complete-performance-tuning-guide/</guid><description>
&lt;h2 id="oracle-database-statspack-spreportsql-script-complete-performance-tuning-guide"&gt;Oracle Database Statspack spreport.sql Script: Complete Performance Tuning Guide&lt;/h2&gt;
&lt;p&gt;The Oracle Database &lt;code&gt;@?/rdbms/admin/spreport.sql&lt;/code&gt; script is a comprehensive performance reporting tool that generates detailed Statspack reports for database analysis and optimization. This essential script provides database administrators with critical insights into instance-wide performance metrics, helping identify bottlenecks and optimization opportunities.&lt;/p&gt;
&lt;h2 id="overview-and-purpose"&gt;Overview and Purpose&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
Oracle Statspack is a performance diagnosis tool that uses SQL, PL/SQL, and SQL*Plus scripts to collect, automate, store, and view performance data. The &lt;code&gt;spreport.sql&lt;/code&gt; script specifically generates detailed reports by comparing performance statistics between two snapshot points, similar to the older UTLBSTAT/UTLESTAT scripts but with enhanced flexibility.&lt;/p&gt;</description></item><item><title>Oracle Statspack sppurge: Snapshot Purge Script Guide</title><link>https://www.oraclescripts.com/post/oracle-database-statspack-snapshot-purge-script-complete-guide-to-sppurge-administration/</link><pubDate>Tue, 02 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-statspack-snapshot-purge-script-complete-guide-to-sppurge-administration/</guid><description>
&lt;h2 id="oracle-database-statspack-snapshot-purge-script-complete-guide-to-sppurge-administration"&gt;Oracle Database Statspack Snapshot Purge Script: Complete Guide to sppurge Administration&lt;/h2&gt;
&lt;p&gt;The Oracle Database &lt;code&gt;@?/rdbms/admin/sppurge;&lt;/code&gt; command is a critical administrative script used to delete old Statspack snapshots and manage storage space in the PERFSTAT schema. This comprehensive guide explores the purpose, functionality, and best practices for using this essential database performance monitoring tool.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;sppurge.sql&lt;/code&gt; script serves as Oracle's official method for purging unnecessary Statspack snapshot data from the PERFSTAT schema. &lt;strong&gt;Statspack&lt;/strong&gt; is Oracle's performance monitoring and diagnosis tool that captures system statistics over time, allowing database administrators to analyze performance trends and identify bottlenecks. However, without proper maintenance, these snapshots can consume significant storage space, making the purge functionality essential for ongoing database administration.&lt;/p&gt;</description></item><item><title>Oracle Statspack Snapshot Levels: statspack.snap Guide</title><link>https://www.oraclescripts.com/post/oracle-statspack-snapshot-levels-complete-guide-to-database-performance-monitoring/</link><pubDate>Mon, 01 Sep 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-statspack-snapshot-levels-complete-guide-to-database-performance-monitoring/</guid><description>
&lt;h2 id="oracle-statspack-snapshot-levels-complete-guide-to-database-performance-monitoring"&gt;Oracle Statspack Snapshot Levels: Complete Guide to Database Performance Monitoring&lt;/h2&gt;
&lt;p&gt;Oracle Statspack snapshots are essential tools for database performance monitoring that capture system statistics at different granularity levels. Understanding how to properly execute snapshots and choose appropriate levels is crucial for effective Oracle database administration and performance tuning.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h3 id="purpose"&gt;Purpose&lt;/h3&gt;
&lt;p&gt;Statspack snapshots serve as the foundation for Oracle database performance analysis by capturing point-in-time statistics. These snapshots enable DBAs to analyze system performance trends, identify bottlenecks, and make informed decisions about database optimization. The snapshot levels determine the depth and scope of data collection, allowing administrators to balance monitoring overhead with diagnostic detail.&lt;/p&gt;</description></item><item><title>How to Monitor Oracle Shared Pool Usage with V$SGASTAT</title><link>https://www.oraclescripts.com/post/how-to-monitor-oracle-shared-pool-usage-with-vsgastat/</link><pubDate>Fri, 22 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-monitor-oracle-shared-pool-usage-with-vsgastat/</guid><description>
&lt;h2 id="how-to-monitor-oracle-shared-pool-usage-with-vsgastat"&gt;How to Monitor Oracle Shared Pool Usage with V$SGASTAT&lt;/h2&gt;
&lt;p&gt;Database Administrators (DBAs) frequently need to track memory allocation inside Oracle’s &lt;strong&gt;SGA (System Global Area)&lt;/strong&gt;, especially within the &lt;strong&gt;Shared Pool&lt;/strong&gt;. Monitoring the shared pool helps identify memory fragmentation, excessive parsing, and potential memory-related performance issues.&lt;/p&gt;
&lt;p&gt;One practical way to check shared pool usage is by querying the dynamic performance view &lt;strong&gt;&lt;code&gt;V$SGASTAT&lt;/code&gt;&lt;/strong&gt;.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Monitoring PGA Usage by Username in Oracle Database</title><link>https://www.oraclescripts.com/post/monitoring-pga-usage-by-username-in-oracle-database/</link><pubDate>Thu, 21 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/monitoring-pga-usage-by-username-in-oracle-database/</guid><description>
&lt;h2 id="monitoring-pga-usage-by-username-in-oracle-database"&gt;Monitoring PGA Usage by Username in Oracle Database&lt;/h2&gt;
&lt;p&gt;Effective &lt;strong&gt;memory management&lt;/strong&gt; is critical for Oracle Database administrators (DBAs) when diagnosing performance issues. Oracle uses the &lt;strong&gt;Program Global Area (PGA)&lt;/strong&gt; for managing session memory, including operations like sorting, hashing, and storing session context. Monitoring this memory usage helps identify inefficient SQL workloads and users consuming disproportionate memory.&lt;/p&gt;
&lt;p&gt;In this guide, we’ll break down a useful SQL script to &lt;strong&gt;check PGA usage by username&lt;/strong&gt; in Oracle Database.&lt;/p&gt;</description></item><item><title>Oracle SGA Breakdown Script Using v$sgastat</title><link>https://www.oraclescripts.com/post/oracle-database-sga-breakdown-script-for-performance-monitoring-using-vsgastat/</link><pubDate>Wed, 20 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-sga-breakdown-script-for-performance-monitoring-using-vsgastat/</guid><description>
&lt;h2 id="oracle-database-sga-breakdown-script-for-performance-monitoring"&gt;Oracle Database SGA Breakdown Script for Performance Monitoring&lt;/h2&gt;
&lt;p&gt;Monitoring memory usage in an Oracle Database is one of the most important tasks for a DBA. The &lt;strong&gt;System Global Area (SGA)&lt;/strong&gt; plays a crucial role in the performance of the database, as it stores data and control information used by Oracle processes.&lt;/p&gt;
&lt;p&gt;In this post, we will explore an SQL script that provides a &lt;strong&gt;breakdown of SGA memory pools&lt;/strong&gt; using the &lt;code&gt;v$sgastat&lt;/code&gt; dynamic performance view. We'll go over its &lt;strong&gt;purpose&lt;/strong&gt;, &lt;strong&gt;SQL breakdown&lt;/strong&gt;, &lt;strong&gt;key points&lt;/strong&gt;, and &lt;strong&gt;insights for DBAs&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Oracle SQL Execution Statistics Query with v$sqlarea</title><link>https://www.oraclescripts.com/post/oracle-sql-performance-analysis-query-monitor-sql-execution-statistics/</link><pubDate>Sat, 09 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-sql-performance-analysis-query-monitor-sql-execution-statistics/</guid><description>
&lt;h2 id="oracle-sql-performance-analysis-query---monitor-sql-execution-statistics"&gt;Oracle SQL Performance Analysis Query - Monitor SQL Execution Statistics&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL query is designed to analyze the performance characteristics of a specific SQL statement by examining key execution metrics stored in the &lt;code&gt;v$sqlarea&lt;/code&gt; dynamic performance view. Database administrators and performance analysts use this query to identify performance bottlenecks, resource consumption patterns, and optimization opportunities for SQL statements.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle SQL Hash Lookup: Retrieve SQL Text from V$SQLAREA</title><link>https://www.oraclescripts.com/post/oracle-sql-hash-lookup-query-using-v-sqlarea/</link><pubDate>Fri, 08 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-sql-hash-lookup-query-using-v-sqlarea/</guid><description>
&lt;h2 id="oracle-sql-hash-lookup-query---retrieving-sql-text-from-vsqlarea"&gt;Oracle SQL Hash Lookup Query - Retrieving SQL Text from V$SQLAREA&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle Database query is designed to retrieve the complete SQL statement text from the &lt;code&gt;V$SQLAREA&lt;/code&gt; view using a specific hash value. This is particularly useful for database administrators and developers who need to identify and analyze SQL statements during performance tuning, troubleshooting, or monitoring activities.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="the-code"&gt;The Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sql_text&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;v$sqlarea&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hash_value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;amp;hash&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;h3 id="select-statement-components"&gt;SELECT Statement Components&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Column Selection:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Database: Find Query Hash Value Using V$SQLAREA</title><link>https://www.oraclescripts.com/post/oracle-database-find-query-hash-value-using-v-sqlarea/</link><pubDate>Thu, 07 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-find-query-hash-value-using-v-sqlarea/</guid><description>
&lt;h2 id="oracle-database-find-query-hash-value-using-vsqlarea"&gt;Oracle Database: Find Query Hash Value Using V$SQLAREA&lt;/h2&gt;
&lt;p&gt;Finding specific SQL queries in Oracle Database can be challenging when dealing with large systems running thousands of statements. This guide demonstrates how to efficiently locate query hash values using the V$SQLAREA system view by searching for unique text patterns within SQL statements.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The primary purpose of this Oracle Database script is to:&lt;/p&gt;</description></item><item><title>Oracle EXPLAIN PLAN: SQL Performance Analysis Guide</title><link>https://www.oraclescripts.com/post/oracle-database-explain-plan-performance-tuning-guide/</link><pubDate>Wed, 06 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-explain-plan-performance-tuning-guide/</guid><description>
&lt;h2 id="oracle-database-explain-plan-complete-guide-to-sql-performance-analysis"&gt;Oracle Database EXPLAIN PLAN: Complete Guide to SQL Performance Analysis&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;EXPLAIN PLAN&lt;/strong&gt; is one of Oracle Database's most powerful tools for analyzing SQL query performance and understanding how the Oracle optimizer executes your statements. This comprehensive guide covers everything you need to know about using EXPLAIN PLAN effectively for database performance tuning.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="what-is-explain-plan"&gt;What is EXPLAIN PLAN?&lt;/h2&gt;
&lt;p&gt;EXPLAIN PLAN is an Oracle SQL statement that allows you to view the execution plan that the Oracle optimizer would use to execute a specific SQL statement &lt;strong&gt;without actually running the query&lt;/strong&gt;. This makes it invaluable for performance analysis, as you can examine query costs, access methods, and join operations before committing resources to execution.&lt;/p&gt;</description></item><item><title>Oracle Autotrace Commands: SQL Execution Plan Analysis</title><link>https://www.oraclescripts.com/post/oracle-database-autotrace-commands-complete-guide-to-sql-execution-plan-analysis/</link><pubDate>Tue, 05 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-autotrace-commands-complete-guide-to-sql-execution-plan-analysis/</guid><description>
&lt;h2 id="oracle-database-autotrace-commands-complete-guide-to-sql-execution-plan-analysis"&gt;Oracle Database Autotrace Commands: Complete Guide to SQL Execution Plan Analysis&lt;/h2&gt;
&lt;p&gt;Oracle Database's autotrace feature is a powerful built-in tool that enables database administrators and developers to analyze SQL statement performance by displaying execution plans and runtime statistics. This comprehensive guide covers all autotrace commands and their practical applications for database performance optimization.&lt;/p&gt;
&lt;h2 id="what-is-oracle-autotrace"&gt;What is Oracle Autotrace?&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
Oracle autotrace is a SQL*Plus feature that provides detailed information about how Oracle executes SQL statements. It reveals the execution path chosen by the Oracle optimizer and displays valuable performance metrics without requiring additional tools or complex setup procedures.&lt;/p&gt;</description></item><item><title>Oracle: Find Tables with Outdated Statistics via DBA_TABLES</title><link>https://www.oraclescripts.com/post/oracle-database-query-to-find-tables-with-outdated-statistics-monitor-analyze-progress/</link><pubDate>Tue, 01 Jul 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-query-to-find-tables-with-outdated-statistics-monitor-analyze-progress/</guid><description>
&lt;h2 id="oracle-database-query-find-tables-with-outdated-statistics"&gt;Oracle Database Query: Find Tables with Outdated Statistics&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle Database query helps &lt;strong&gt;database administrators monitor the progress of table statistics collection&lt;/strong&gt; by identifying tables that have analyze dates older than the current date. It's particularly useful when running large-scale &lt;code&gt;ANALYZE&lt;/code&gt; operations and you need to track how many tables still require statistics updates.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;This is useful if you are running an analyze and want to see how much is left to do&lt;/p&gt;</description></item><item><title>Show a Count of Analyzed Tables by Schema in Oracle Database</title><link>https://www.oraclescripts.com/post/show-a-count-of-analyzed-tables-broken-down-by-schema-in-oracle-database/</link><pubDate>Mon, 30 Jun 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-a-count-of-analyzed-tables-broken-down-by-schema-in-oracle-database/</guid><description>
&lt;h2 id="show-a-count-of-analyzed-tables-broken-down-by-schema-in-oracle-database"&gt;Show a Count of Analyzed Tables Broken Down by Schema in Oracle Database&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;br&gt;
This post explains how to use Oracle SQL to report the total number of tables and the number of &lt;em&gt;analyzed&lt;/em&gt; tables for each schema in your Oracle Database. This is crucial for database administrators who want to monitor the health and performance of their database, ensure accurate statistics for the optimizer, and identify schemas where statistics may be outdated or missing.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle PLAN_TABLE Setup and EXPLAIN PLAN Usage Guide</title><link>https://www.oraclescripts.com/post/oracle-plan-table-setup-and-explain-plan-usage-guide/</link><pubDate>Sun, 29 Jun 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-plan-table-setup-and-explain-plan-usage-guide/</guid><description>
&lt;h2 id="what-is-the-oracle-plan_table-and-how-do-you-use-it"&gt;What is the Oracle PLAN_TABLE and how do you use it?&lt;/h2&gt;
&lt;p&gt;Oracle's PLAN_TABLE is a fundamental component for SQL performance analysis and query optimization. This comprehensive guide explores the setup, usage, and best practices for leveraging Oracle's execution plan functionality to optimize database performance.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;@?/rdbms/admin/utlxplan.sql
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="understanding-the-oracle-plan_table"&gt;Understanding The Oracle PLAN_TABLE&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/tgsql/generating-and-displaying-execution-plans.html"&gt;The PLAN_TABLE serves as the default output repository for Oracle's EXPLAIN PLAN statement, storing detailed information about how the database optimizer intends to execute SQL queries&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Oracle ANALYZE Statement: Table and Index Statistics</title><link>https://www.oraclescripts.com/post/oracle-analyze-statement-old-style-table-and-index-statistics-collection/</link><pubDate>Sun, 11 May 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-analyze-statement-old-style-table-and-index-statistics-collection/</guid><description>
&lt;h2 id="oracle-analyze-statement-old-style-table-and-index-statistics-collection"&gt;Oracle ANALYZE Statement: Old-Style Table and Index Statistics Collection&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;ANALYZE&lt;/code&gt; statement in Oracle Database is a legacy tool used to collect statistics on tables and indexes. These statistics help the database optimizer make decisions about the most efficient way to execute SQL queries. Although Oracle now recommends using the &lt;code&gt;DBMS_STATS&lt;/code&gt; package for statistics gathering, understanding &lt;code&gt;ANALYZE&lt;/code&gt; is essential for maintaining legacy systems or interpreting older scripts.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-of-the-analyze-statement"&gt;Purpose of the ANALYZE Statement&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Collect statistics&lt;/strong&gt; about tables, indexes, and clusters to help the optimizer generate efficient execution plans.&lt;/p&gt;</description></item><item><title>Export/Import Oracle Optimizer Statistics: Complete Guide</title><link>https://www.oraclescripts.com/post/export-import-oracle-optimizer-statistics-a-complete-guide/</link><pubDate>Tue, 29 Apr 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/export-import-oracle-optimizer-statistics-a-complete-guide/</guid><description>
&lt;h2 id="oracle-optimizer-statistics-transfer-guide"&gt;Oracle Optimizer Statistics Transfer Guide&lt;/h2&gt;
&lt;p&gt;This guide demonstrates how to migrate schema statistics between Oracle databases using DBMS_STATS procedures - crucial for maintaining consistent execution plans across environments.&lt;/p&gt;
&lt;p&gt;Exporting and importing optimizer statistics in Oracle Database is essential for maintaining consistent query performance across different environments, such as migrating statistics from production to test systems. This process ensures that the Oracle optimizer has accurate data to generate optimal execution plans, minimizing the risk of performance degradation due to missing or stale statistics
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle DBMS_STATS: Delete Database Statistics</title><link>https://www.oraclescripts.com/post/oracle-database-deleting-statistics-with-dbms-stats-package/</link><pubDate>Thu, 16 Jan 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-deleting-statistics-with-dbms-stats-package/</guid><description>
&lt;h2 id="oracle-database-deleting-statistics-with-dbms_stats-package"&gt;Oracle Database: Deleting Statistics with DBMS_STATS Package&lt;/h2&gt;
&lt;p&gt;The Oracle Database DBMS_STATS package provides powerful procedures for managing database statistics. This post explores the delete_stats procedures, which are crucial for maintaining accurate query optimization.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="understanding-dbms_statsdelete_stats-procedures"&gt;Understanding DBMS_STATS.DELETE_STATS Procedures&lt;/h2&gt;
&lt;p&gt;The DBMS_STATS package offers several procedures to delete statistics at different levels:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Database-wide: &lt;code&gt;delete_database_stats&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Schema-level: &lt;code&gt;delete_schema_stats&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Table-level: &lt;code&gt;delete_table_stats&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Index-level: &lt;code&gt;delete_index_stats&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let's break down each procedure and its purpose:&lt;/p&gt;</description></item><item><title>Oracle DBMS_STATS.GATHER_SYSTEM_STATS for Query Tuning</title><link>https://www.oraclescripts.com/post/optimizing-oracle-database-performance-with-gather-system-stats/</link><pubDate>Wed, 15 Jan 2025 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/optimizing-oracle-database-performance-with-gather-system-stats/</guid><description>
&lt;h2 id="optimizing-oracle-database-performance-with-gather_system_stats"&gt;Optimizing Oracle Database Performance with GATHER_SYSTEM_STATS&lt;/h2&gt;
&lt;p&gt;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.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="understanding-gather_system_stats"&gt;Understanding GATHER_SYSTEM_STATS&lt;/h2&gt;
&lt;p&gt;The GATHER_SYSTEM_STATS procedure collects system statistics that reflect the performance characteristics of your hardware. These statistics help the Oracle optimizer make more accurate cost estimates for query execution plans.Let's break down the code:&lt;/p&gt;</description></item><item><title>Oracle Statistics Gathering with DBMS_STATS Explained</title><link>https://www.oraclescripts.com/post/understanding-oracle-database-statistics-gathering-using-dbms-stats-a-comprehensive-guide/</link><pubDate>Thu, 12 Dec 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/understanding-oracle-database-statistics-gathering-using-dbms-stats-a-comprehensive-guide/</guid><description>
&lt;h2 id="understanding-oracle-database-statistics-gathering-a-comprehensive-guide"&gt;Understanding Oracle Database Statistics Gathering: A Comprehensive Guide&lt;/h2&gt;
&lt;p&gt;Gathering database statistics is a crucial task in Oracle Database management, ensuring optimal performance for SQL queries and overall database operations. In this article, we will explore the purpose of gathering statistics, provide a breakdown of the relevant Oracle Database code, and highlight key insights for effective database management.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;Gather stats on the entire database...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;execute dbms_stats.gather_database_stats;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;Or...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;execute dbms_stats.gather_database_stats( -
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;estimate_percent =&amp;gt; 1, -
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;method_opt =&amp;gt; &amp;#39;FOR ALL COLUMNS SIZE 1&amp;#39;,-
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;cascade =&amp;gt; TRUE);
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="purpose-of-gathering-database-statistics"&gt;Purpose of Gathering Database Statistics&lt;/h2&gt;
&lt;p&gt;Database statistics provide essential information about the data stored within the database, including the number of rows, blocks, and data distribution. This information is used by the Oracle optimizer to create efficient execution plans for SQL queries, ultimately improving performance.&lt;/p&gt;</description></item><item><title>Oracle DBMS_STATS: Gather Schema and Table Statistics</title><link>https://www.oraclescripts.com/post/optimizing-performance-with-oracle-database-gathering-schema-and-table-statistics/</link><pubDate>Wed, 11 Dec 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/optimizing-performance-with-oracle-database-gathering-schema-and-table-statistics/</guid><description>
&lt;h2 id="optimizing-performance-with-oracle-database-gathering-schema-and-table-statistics"&gt;Optimizing Performance with Oracle Database: Gathering Schema and Table Statistics&lt;/h2&gt;
&lt;p&gt;In database management, ensuring optimal performance is crucial for effective data handling and query execution. One of the foundational tasks for maintaining an Oracle Database system is gathering statistics, which helps the Oracle optimizer make informed decisions about the most efficient way to execute SQL statements. This article will explore how to gather stats for a single schema in Oracle Database using &lt;code&gt;DBMS_STATS&lt;/code&gt;, breaking down the relevant code snippets, their purposes, and their implications for performance tuning.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Identifying Oracle Database Hot Blocks Using v$system_event</title><link>https://www.oraclescripts.com/post/identifying-oracle-database-hot-data-blocks/</link><pubDate>Tue, 01 Oct 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identifying-oracle-database-hot-data-blocks/</guid><description>
&lt;h2 id="identifying-oracle-database-hot-blocks-using-oracle-table-vsystem_event-a-comprehensive-guide"&gt;Identifying Oracle Database Hot Blocks using Oracle Table v$system_event: A Comprehensive Guide&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Understanding Hot Blocks&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In an Oracle database, a &amp;quot;hot block&amp;quot; refers to a data block in the buffer cache that experiences a disproportionately high volume of concurrent requests. This contention can lead to significant performance bottlenecks, particularly latch contention on the 'cache buffers chains' latch, which can severely impact the overall database performance.&lt;/p&gt;</description></item><item><title>Analyzing Oracle 'Data Block' Waits with v$waitstat</title><link>https://www.oraclescripts.com/post/oracle-data-block-waits-using-oracle-v-dollar-waitstat-to-identify-disk-contention/</link><pubDate>Mon, 30 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-data-block-waits-using-oracle-v-dollar-waitstat-to-identify-disk-contention/</guid><description>
&lt;h2 id="oracle-data-block-waits-using-oracle-table-vwaitstat-to-identify-disk-contention"&gt;Oracle &amp;quot;Data Block&amp;quot; Waits using Oracle table v$waitstat to identify disk Contention&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;In Oracle databases, waiting for &amp;quot;data blocks&amp;quot; signifies contention for specific data blocks in memory. This contention can lead to performance bottlenecks and slowdowns. Understanding the root cause of these waits is crucial to effectively addressing these issues.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Unmasking the Culprits with v$waitstat&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The v$waitstat view provides valuable insights into various wait events within the database instance. To get a comprehensive breakdown of &amp;quot;data block&amp;quot; waits, use the following query:&lt;/p&gt;</description></item><item><title>Oracle Buffer Busy Waits Analysis with v$session_wait</title><link>https://www.oraclescripts.com/post/analyzing-oracle-buffer-busy-waits-with-v-dollar-session-wait/</link><pubDate>Sun, 29 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/analyzing-oracle-buffer-busy-waits-with-v-dollar-session-wait/</guid><description>
&lt;h2 id="unmasking-buffer-busy-waits-in-oracle-a-deep-dive-with-vsession_wait"&gt;Unmasking Buffer Busy Waits in Oracle: A Deep Dive with v$session_wait&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&amp;quot;Buffer busy waits&amp;quot; are a common performance bottleneck in Oracle databases, occurring when multiple sessions try to access the same data block concurrently. Identifying the specific blocks and understanding the reasons behind these waits is crucial for effective troubleshooting and optimization. Pinpointing the Contention with v$session_wait The v$session_wait view provides real-time information about sessions waiting for specific events. To identify the file, block, and reason code associated with &amp;quot;buffer busy waits,&amp;quot; use the following query:
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle v$statname and v$sysstat Performance Stats</title><link>https://www.oraclescripts.com/post/analyzing-oracle-performance-statistics-with-vstatname-and-vsysstat/</link><pubDate>Sat, 28 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/analyzing-oracle-performance-statistics-with-vstatname-and-vsysstat/</guid><description>
&lt;h2 id="analyzing-oracle-performance-statistics-with-vstatname-and-vsysstat"&gt;Analyzing Oracle Performance Statistics with v$statname and v$sysstat&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Monitoring and understanding your Oracle database instance's performance is crucial for maintaining optimal efficiency. Oracle provides dynamic performance views, such as v$statname and v$sysstat, to access a wealth of performance statistics.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Unlocking Performance Insights&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To gain a comprehensive overview of your instance's performance, use the following query:
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select n.name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;, s.value
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;from v$statname n
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;, v$sysstat s
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;where n.statistic# = s.statistic#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;order by n.class
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;, n.name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;8&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;select n.name, s.value: This selects the statistic name and its corresponding value.&lt;/li&gt;
&lt;li&gt;from v$statname n, v$sysstat s: This specifies the v$statname and v$sysstat views as the data sources.&lt;/li&gt;
&lt;li&gt;where n.statistic# = s.statistic#: This joins the two views based on the statistic# column, linking each statistic value to its name.&lt;/li&gt;
&lt;li&gt;order by n.class, n.name: This sorts the output first by the statistic class and then by the statistic name for organized presentation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="key-points-and-insights"&gt;Key Points and Insights&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;v$statname&lt;/strong&gt;: This view provides names and descriptions for all available statistics in the database instance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;v$sysstat&lt;/strong&gt;: This view stores the actual values for various system statistics.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Statistic classes&lt;/strong&gt;: Statistics are grouped into classes (e.g., user, redo, cache, OS) for easier interpretation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="explanations"&gt;Explanations&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Performance monitoring&lt;/strong&gt;: Regularly reviewing performance statistics helps identify potential bottlenecks, resource usage trends, and areas for optimization.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dynamic performance views&lt;/strong&gt;: These views offer real-time insights into the database instance's activity and performance.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="interpreting-the-results"&gt;Interpreting the Results&lt;/h2&gt;
&lt;p&gt;The query output presents a comprehensive list of performance statistics. Analyze these statistics to understand:&lt;/p&gt;</description></item><item><title>Oracle Segment Waits Analysis with v$segment_statistics</title><link>https://www.oraclescripts.com/post/oracle-segment-waits-in-depth-code-analysis-and-insights/</link><pubDate>Wed, 25 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-segment-waits-in-depth-code-analysis-and-insights/</guid><description>
&lt;h2 id="demystifying-oracle-segment-waits-in-depth-code-analysis-and-insights-using-oracle-table-vsegment_statistics"&gt;Demystifying Oracle Segment Waits: In-Depth Code Analysis and Insights Using Oracle Table v$segment_statistics&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;In the realm of Oracle database performance tuning, understanding segment waits is crucial. Waits indicate areas where processes are contending for resources, potentially leading to bottlenecks. The code snippet we will explore helps pinpoint specific segments experiencing high waits, enabling targeted optimization.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;select object_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;, obj#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;, statistic_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;, value
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;from v$segment_statistics
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;where owner like &amp;#39;&amp;amp;owner&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;and statistic_name like &amp;#39;%waits%&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;and value &amp;gt; 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;order by statistic_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;, value desc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;p&gt;This code extracts information about wait events associated with specific segments owned by a given user (specified using the &lt;code&gt;&amp;amp;owner&lt;/code&gt; substitution variable). It identifies segments with non-zero wait counts and presents the results sorted by the type of wait and the number of waits.&lt;/p&gt;</description></item><item><title>Oracle Latch Contention Analysis with v$system_event</title><link>https://www.oraclescripts.com/post/understanding-and-optimizing-oracle-latch-waits-with-sql-code-analysis/</link><pubDate>Tue, 24 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/understanding-and-optimizing-oracle-latch-waits-with-sql-code-analysis/</guid><description>
&lt;h2 id="oracle-performance-tuning-analyzing-latch-contention-with-time-waited-for-latches-using-using-oracle-tables-vsystem_event-and-vsysstat"&gt;Oracle Performance Tuning: Analyzing Latch Contention with &amp;quot;Time Waited for Latches&amp;quot; using Using Oracle Tables v$system_event and v$sysstat&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;In the world of Oracle database performance tuning, identifying and resolving latch contention is critical for maintaining a responsive system. Latches are low-level serialization mechanisms that protect shared data structures within the Oracle SGA (System Global Area). When multiple processes compete for the same latch, it can lead to delays and impact overall database performance.&lt;/p&gt;</description></item><item><title>Oracle Top 10 Hot Objects by Touch Count with x$bh</title><link>https://www.oraclescripts.com/post/top-10-hottest-objects-in-oracle-by-touch-count/</link><pubDate>Fri, 20 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/top-10-hottest-objects-in-oracle-by-touch-count/</guid><description>
&lt;h2 id="top-10-hottest-objects-in-oracle-by-touch-count-using-tables-xbh-obj-and-user"&gt;Top 10 Hottest Objects in Oracle by Touch Count using tables x$bh obj$ and user$&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL query identifies the top 10 &amp;quot;hottest&amp;quot; objects within your database. In this context, &amp;quot;hot&amp;quot; refers to objects that have been accessed (or &amp;quot;touched&amp;quot;) the most frequently. Understanding which objects are frequently used can help you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Optimize performance: By identifying frequently accessed objects, you can consider strategies like indexing, data partitioning, or materializing views to improve query response times.&lt;/li&gt;
&lt;li&gt;Capacity planning: Knowing your &amp;quot;hot&amp;quot; objects can assist in predicting storage and resource needs as your database grows.&lt;/li&gt;
&lt;li&gt;Troubleshooting: High touch counts on certain objects could indicate areas of contention or bottlenecks within your database.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;col owner format a20 trunc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col object_name format a30
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col touches format 9,999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;select *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;from (
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt; select count(*)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt; , sum(tch) TOUCHES
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt; , u.name OWNER
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; , o.name OBJECT_NAME
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt; from x$bh x
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt; , obj$ o
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt; , user$ u
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt; where x.obj = o.obj#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt; and o.owner# = u.user#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt; group by u.name, o.name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; order by 2 desc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt; )
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;where rownum &amp;lt; 11
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;x$bh&lt;/code&gt;: This is a dynamic performance view that tracks buffer headers. The &lt;code&gt;tch&lt;/code&gt; column within it indicates the touch count for a buffer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;obj$&lt;/code&gt; and &lt;code&gt;user$&lt;/code&gt;: These are static data dictionary views containing information about database objects and users, respectively.&lt;/li&gt;
&lt;li&gt;The query joins these views to associate touch counts with the corresponding object and owner names.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;group by&lt;/code&gt;: The results are grouped by &lt;code&gt;OWNER&lt;/code&gt; and &lt;code&gt;OBJECT_NAME&lt;/code&gt; to calculate the total touch count for each object.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;order by 2 desc&lt;/code&gt;: The output is sorted in descending order based on the &lt;code&gt;TOUCHES&lt;/code&gt; column, showing the most frequently accessed objects first.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rownum &amp;lt; 11&lt;/code&gt;: The query limits the output to the top 10 rows.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Explanations:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle: Find Wait Events by Datafile with x$kcbfwait</title><link>https://www.oraclescripts.com/post/identify-waits-by-datafile-in-oracle/</link><pubDate>Thu, 19 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identify-waits-by-datafile-in-oracle/</guid><description>
&lt;h2 id="identify-waits-by-datafile-in-oracle-using-tables-vdatafile-and-xkcbfwait"&gt;Identify Waits by Datafile in Oracle using tables v$datafile and x$kcbfwait&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;In Oracle databases, waiting events often indicate performance bottlenecks. This SQL query helps you pinpoint which datafiles are associated with the most wait events. By understanding where waits are occurring, you can take targeted action to improve performance.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;col name format a60
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;select name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;, count
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;from x$kcbfwait
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;, v$datafile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;where indx + 1 = file#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;order by 2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;8&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Code Breakdown&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Lock Conflicts with dba_lock and SQL*Plus Format</title><link>https://www.oraclescripts.com/post/understanding-lock-conflicts-with-dba-lock-and-column-formatting/</link><pubDate>Fri, 06 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/understanding-lock-conflicts-with-dba-lock-and-column-formatting/</guid><description>
&lt;h2 id="oracle-database-understanding-lock-conflicts-with-dba_lock-and-column-formatting"&gt;Oracle Database: Understanding Lock Conflicts with dba_lock and Column Formatting&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL query is designed to investigate and understand lock conflicts within your database, particularly those causing performance bottlenecks. It leverages the dba_lock view to expose critical lock information in a human-readable format, thanks to explicit column formatting.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;column lock_type format a12
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;column mode_held format a10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;column mode_requested format a10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;column blocking_others format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;column username format a10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;SELECT session_id
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, lock_type
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, mode_held
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;, mode_requested
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;, blocking_others
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;, lock_id1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;FROM dba_lock l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;WHERE lock_type NOT IN (&amp;#39;Media Recovery&amp;#39;, &amp;#39;Redo Thread&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;column lock_type format a12&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;column mode_held format a10&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;column mode_requested format a10&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;column blocking_others format a20&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;column username format a10&lt;/code&gt; [&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These lines are not part of the core query. They are SQL*Plus (or similar client) commands that set the display width and format for specific columns, making the output more visually organized.&lt;/p&gt;</description></item><item><title>Identifying Locked Rows in Oracle Using v$session</title><link>https://www.oraclescripts.com/post/identifying-locked-rows-in-oracle-database/</link><pubDate>Thu, 05 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identifying-locked-rows-in-oracle-database/</guid><description>
&lt;h2 id="identifying-locked-rows-in-oracle-database-using-tables-vsession-and-dba_objects"&gt;Identifying Locked Rows in Oracle Database using tables v$session and dba_objects&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle query pinpoints the exact row a specific session is waiting on due to a lock. It first finds the locked object and row location, then constructs a ROWID to fetch and display the entire locked row from the table.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;/* Show which row is locked
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;select do.object_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;, row_wait_obj#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;, row_wait_file#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, row_wait_block#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, row_wait_row#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, dbms_rowid.rowid_create (1, ROW_WAIT_OBJ#, ROW_WAIT_FILE#,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; ROW_WAIT_BLOCK#, ROW_WAIT_ROW#)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;from v$session s
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;, dba_objects do
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;where sid=&amp;amp;sid
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;and s.ROW_WAIT_OBJ# = do.OBJECT_ID
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;/* Then select the row with that rowid...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;select * from &amp;lt;table&amp;gt; where rowid=&amp;lt;rowid&amp;gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Query 1:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Blocking Sessions Query with v$lock and v$session</title><link>https://www.oraclescripts.com/post/uncover-and-resolve-blocking-sessions-with-sql-in-the-oracle-database/</link><pubDate>Wed, 04 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/uncover-and-resolve-blocking-sessions-with-sql-in-the-oracle-database/</guid><description>
&lt;h2 id="oracle-database-uncover-blocking-sessions-with-a-powerful-sql-query-using-vlock"&gt;Oracle Database: Uncover Blocking Sessions with a Powerful SQL Query using v$lock&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Identify and resolve performance bottlenecks in your Oracle database by detecting blocking sessions using this powerful SQL query. Gain insights into the query's mechanics and learn how to optimize your database for smoother operations
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select &amp;#39;SID &amp;#39; || l1.sid ||&amp;#39; is blocking &amp;#39; || l2.sid blocking
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from v$lock l1, v$lock l2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;where l1.block =1 and l2.request &amp;gt; 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;and l1.id1=l2.id1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;and l1.id2=l2.id2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;p&gt;This query leverages the &lt;code&gt;v$lock&lt;/code&gt; dynamic performance view, which provides real-time information about locks held and requested by sessions within the database.&lt;/p&gt;</description></item><item><title>Identify Locked Objects in Oracle Database</title><link>https://www.oraclescripts.com/post/identifying-locked-objects-in-oracle-database/</link><pubDate>Tue, 03 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identifying-locked-objects-in-oracle-database/</guid><description>
&lt;h2 id="identify-locked-objects-in-oracle-database-using-vlocked_object-dba_objects-vlock-and-vsession"&gt;Identify Locked Objects in Oracle Database using v$locked_object, dba_objects, v$lock and v$session&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;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 such cases the root cause is a database lock: a session with an uncommitted DML transaction is holding a row or table lock, and the waiting session cannot proceed until that lock is released. The four-view join below makes the diagnosis immediate.&lt;/p&gt;</description></item><item><title>Oracle Currently Executing SQL via v$sqlarea Monitoring</title><link>https://www.oraclescripts.com/post/show-currently-executing-sql-statements-oracle-database/</link><pubDate>Mon, 02 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-currently-executing-sql-statements-oracle-database/</guid><description>
&lt;h2 id="oracle-database-show-currently-executing-sql-statements"&gt;Oracle Database: Show Currently Executing SQL Statements&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL query allows you to monitor and view the SQL statements that are actively running in your database. It provides insights into the current workload and helps identify resource-intensive or long-running queries that might impact performance.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select sql_text
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from v$sqlarea
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;where users_executing &amp;gt; 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;select sql_text&lt;/code&gt;: Selects the &lt;code&gt;sql_text&lt;/code&gt; column, which contains the actual text of the SQL statement being executed.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;from v$sqlarea&lt;/code&gt;: Queries the &lt;code&gt;v$sqlarea&lt;/code&gt; dynamic performance view, which provides statistics about SQL statements currently in the shared SQL area.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;where users_executing &amp;gt; 0&lt;/code&gt;: Filters the results to only include SQL statements that have at least one user actively executing them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt;: The forward slash at the end is required in SQL*Plus or similar command-line tools to execute the query.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle User Table Constraints Query with dba_constraints</title><link>https://www.oraclescripts.com/post/show-all-table-constraints-for-a-user-in-a-oracle-database/</link><pubDate>Sun, 01 Sep 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-all-table-constraints-for-a-user-in-a-oracle-database/</guid><description>
&lt;h2 id="oracle-database-show-all-table-constraints-for-a-user-using-dba_constraints"&gt;Oracle Database: Show All Table Constraints for a User using dba_constraints&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL query is designed to retrieve a comprehensive list of all constraints associated with tables owned by a specific user in your Oracle database. Constraints are essential rules that ensure data integrity and consistency. This query offers a clear and organized view of these constraints, aiding in database management and troubleshooting.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle: Find Parent Tables for Repair Using dba_constraints</title><link>https://www.oraclescripts.com/post/oracle-database-identifying-parent-tables-for-repair-or-re-import/</link><pubDate>Sat, 31 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-database-identifying-parent-tables-for-repair-or-re-import/</guid><description>
&lt;h2 id="oracle-database-identifying-parent-tables-for-repair-or-re-import-using-dba_constraints"&gt;Oracle Database: Identifying Parent Tables for Repair or Re-import using dba_constraints&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;When working with Oracle databases, ensuring data integrity is paramount. Foreign key constraints play a crucial role in maintaining relationships between tables, but disabled constraints can signal potential issues that may require fixing or re-importing parent tables. This article dives into an SQL query designed to pinpoint such parent tables.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>ORA-02298: Find Missing Foreign Key Values in Oracle</title><link>https://www.oraclescripts.com/post/oracle-sql-finding-missing-foreign-key-values-ora-02298/</link><pubDate>Fri, 30 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-sql-finding-missing-foreign-key-values-ora-02298/</guid><description>
&lt;h2 id="oracle-sql-finding-missing-foreign-key-values-ora-02298"&gt;Oracle SQL: Finding Missing Foreign Key Values (ORA-02298)&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL query is designed to help identify missing foreign key values within your database. This is particularly useful when troubleshooting the &lt;code&gt;ORA-02298: cannot validate (constraint_name) - parent keys not found&lt;/code&gt; error, which indicates a foreign key constraint violation.&lt;/p&gt;
&lt;p&gt;The query essentially generates a new &lt;code&gt;SELECT&lt;/code&gt; statement that, when executed, will return the specific values in the child table's foreign key column that do not have corresponding values in the parent table's primary or unique key column.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Session Statistics with v$sesstat and v$statname</title><link>https://www.oraclescripts.com/post/oracle-performance-tuning-session-statistics-with-sql/</link><pubDate>Thu, 29 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-performance-tuning-session-statistics-with-sql/</guid><description>
&lt;h2 id="oracle-database-deep-dive-into-session-statistics"&gt;Oracle Database: Deep Dive into Session Statistics&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL query is designed to retrieve a snapshot of active session statistics for a specific session within your Oracle database. Session statistics provide invaluable insights into the current activity and resource utilization of a particular database session. This information is invaluable for performance monitoring, troubleshooting and capacity planning.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select sn.name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;, st.value
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;from v$sesstat st
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;, v$statname sn
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;where st.STATISTIC# = sn.STATISTIC#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;and st.VALUE &amp;gt; 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;and st.SID = &amp;amp;SID
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;8&lt;/span&gt;&lt;span class="cl"&gt;order by value desc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;9&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;select sn.name, st.value&lt;/code&gt;: Selects two columns:&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sn.name&lt;/code&gt;: Extracts the descriptive name of the statistic from the &lt;code&gt;v$statname&lt;/code&gt; view.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;st.value&lt;/code&gt;: Retrieves the current value of the statistic for the specified session from the &lt;code&gt;v$sesstat&lt;/code&gt; view.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="2"&gt;
&lt;li&gt;&lt;code&gt;from v$sesstat st, v$statname sn&lt;/code&gt;: Joins two crucial data dictionary views:&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;v$sesstat&lt;/code&gt;: Contains statistics for each active session.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;v$statname&lt;/code&gt;: Stores the names and descriptions of all available statistics.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="3"&gt;
&lt;li&gt;&lt;code&gt;where st.STATISTIC# = sn.STATISTIC#&lt;/code&gt;: Links the two views based on the &lt;code&gt;STATISTIC#&lt;/code&gt; column, ensuring accurate mapping between statistic values and their names.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;and st.VALUE &amp;gt; 0&lt;/code&gt;: Filters the results to only show statistics that have a non-zero value, focusing on active metrics.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;and st.SID = &amp;amp;SID&lt;/code&gt;: Restricts the output to statistics for a specific session identified by its SID (Session ID). You'll be prompted to enter the SID when you execute this query.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;order by value desc&lt;/code&gt;: Sorts the output in descending order based on the &lt;code&gt;value&lt;/code&gt; column, presenting the most significant statistics first.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt;: The forward slash is necessary in SQL*Plus or similar command-line tools to execute the query.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Resource-Intensive SQL Queries via v$sqlarea</title><link>https://www.oraclescripts.com/post/pinpoint-resource-hungry-sql-in-oracle-a-performance-optimization-deep-dive/</link><pubDate>Wed, 28 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/pinpoint-resource-hungry-sql-in-oracle-a-performance-optimization-deep-dive/</guid><description>
&lt;h2 id="pinpoint-resource-hungry-sql-in-oracle-a-performance-optimization-deep-dive"&gt;Pinpoint Resource-Hungry SQL in Oracle: A Performance Optimization Deep Dive&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL query is your go-to tool for identifying SQL statements that are putting a strain on your database resources. By analyzing execution statistics, it highlights queries that are consuming significant disk reads and buffer gets, providing crucial insights for performance tuning and optimization.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;select sql_text
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;, executions
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;, to_char((((disk_reads+buffer_gets)/executions) * 8192)/1048576, &amp;#39;9,999,999,990.00&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt; as total_gets_per_exec_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;, to_char((( disk_reads /executions) * 8192)/1048576, &amp;#39;9,999,999,990.00&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt; as disk_reads_per_exec_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, to_char((( buffer_gets /executions) * 8192)/1048576, &amp;#39;9,999,999,990.00&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt; as buffer_gets_per_exec_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;, parsing_user_id
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;from v$sqlarea
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;where executions &amp;gt; 10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;order by 6 desc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;change 8192 to match block size&lt;/code&gt;: This initial comment serves as an important reminder to adjust the &lt;code&gt;8192&lt;/code&gt; value in the subsequent calculations to match your database's actual block size.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;select sql_text, executions&lt;/code&gt;: Selects the following columns:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sql_text&lt;/code&gt;: Retrieves the actual text of the SQL statement.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;executions&lt;/code&gt;: Shows the number of times the statement has been executed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;to_char((((disk_reads+buffer_gets)/executions) * 8192)/1048576, '9,999,999,990.00') as total_gets_per_exec_mb&lt;/code&gt;: Calculates and formats the total data gets (disk reads + buffer gets) per execution in megabytes (MB).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;to_char((( disk_reads /executions) * 8192)/1048576, '9,999,999,990.00') as disk_reads_per_exec_mb&lt;/code&gt;: Calculates and formats the disk reads per execution in MB.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;to_char((( buffer_gets /executions) * 8192)/1048576, '9,999,999,990.00') as buffer_gets_per_exec_mb&lt;/code&gt;: Calculates and formats the buffer gets per execution in MB.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;parsing_user_id&lt;/code&gt;: Shows the ID of the user who parsed the SQL statement.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;from v$sqlarea&lt;/code&gt;: Queries the &lt;code&gt;v$sqlarea&lt;/code&gt; dynamic performance view, which provides statistics about SQL statements currently in the shared SQL area.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;where executions &amp;gt; 10&lt;/code&gt;: Filters out SQL statements that have been executed less than 10 times, focusing on queries with a significant impact.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;order by 6 desc&lt;/code&gt;: Sorts the results in descending order based on the 6th column (&lt;code&gt;total_gets_per_exec_mb&lt;/code&gt;), highlighting the most resource-intensive queries first.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt;: The forward slash is required in SQL*Plus or similar command-line tools to execute the query.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle File IO Performance with v$datafile and v$filestat</title><link>https://www.oraclescripts.com/post/oracle-performance-tuning-unlocking-file-io-insights-with-sql/</link><pubDate>Tue, 27 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-performance-tuning-unlocking-file-io-insights-with-sql/</guid><description>
&lt;h2 id="oracle-database-unlocking-file-io-insights-for-performance-tuning"&gt;Oracle Database: Unlocking File I/O Insights for Performance Tuning&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle SQL query provides a crucial window into your database's file input/output (I/O) activity. It displays statistics like physical reads, writes, and associated timings for each data file, empowering you to identify I/O bottlenecks and optimize database performance.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set lines 80 pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col fname heading &amp;#34;File Name&amp;#34; format a60
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col sizemb heading &amp;#34;Size(Mb)&amp;#34; format 99,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col phyrds heading &amp;#34;Reads&amp;#34; format 999,999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;col readtim heading &amp;#34;Time&amp;#34; format 99.999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;col phywrts heading &amp;#34;Writes&amp;#34; format 9,999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;col writetim heading &amp;#34;Time&amp;#34; format 99.999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;select lower(name) fname
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;, (bytes / 1048576) sizemb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;, phyrds
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;, readtim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;, phywrts
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;, writetim
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;from v$datafile df
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;, v$filestat fs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;where df.file# = fs.file#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;order by 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;Requires timed_statistics=true&lt;/code&gt;: The initial comment emphasizes the necessity of enabling the &lt;code&gt;timed_statistics&lt;/code&gt; parameter for capturing time-related file I/O metrics.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;set lines 80 pages 999&lt;/code&gt;: Configures output formatting for improved readability.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col fname heading &amp;quot;File Name&amp;quot; format a60&lt;/code&gt;: Defines a column alias (&lt;code&gt;fname&lt;/code&gt;) with a specific heading and format for the file name.&lt;/li&gt;
&lt;li&gt;Similar &lt;code&gt;col&lt;/code&gt; commands define column aliases, headings, and formats for size, reads, read time, writes, and write time.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;select lower(name) fname, (bytes / 1048576) sizemb, phyrds, readtim, phywrts, writetim&lt;/code&gt;: Selects the following columns:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;lower(name) fname&lt;/code&gt;: Retrieves the data file name in lowercase for consistency.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(bytes / 1048576) sizemb&lt;/code&gt;: Calculates and displays the file size in megabytes (MB).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;phyrds&lt;/code&gt;: Shows the number of physical reads performed on the file.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;readtim&lt;/code&gt;: Displays the total time spent on physical reads (in seconds).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;phywrts&lt;/code&gt;: Shows the number of physical writes performed on the file.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;writetim&lt;/code&gt;: Displays the total time spent on physical writes (in seconds).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;from v$datafile df, v$filestat fs&lt;/code&gt;: Joins two vital data dictionary views:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;v$datafile&lt;/code&gt;: Contains information about database data files.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;v$filestat&lt;/code&gt;: Provides I/O statistics for data files.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;where df.file# = fs.file#&lt;/code&gt;: Links the two views based on the &lt;code&gt;file#&lt;/code&gt; column, ensuring correct matching of file information and I/O statistics.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;order by 1&lt;/code&gt;: Sorts the results alphabetically by the first column (&lt;code&gt;fname&lt;/code&gt;), making it easier to locate specific files.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt;: The forward slash is essential for executing the query in SQL*Plus or similar command-line tools.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle In-Session SQL Tracing with DBMS_SYSTEM</title><link>https://www.oraclescripts.com/post/oracle-performance-tuning-master-in-session-sql-tracing-for-deep-insights/</link><pubDate>Mon, 26 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-performance-tuning-master-in-session-sql-tracing-for-deep-insights/</guid><description>
&lt;h2 id="oracle-database-real-time-sql-tracing-for-in-depth-performance-insights"&gt;Oracle Database: Real-Time SQL Tracing for In-depth Performance Insights&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle database technique empowers you to dynamically enable or disable SQL tracing for specific sessions. SQL tracing captures detailed information about SQL statements executed within a session, providing valuable insights into query performance, execution plans, and resource usage. This capability is indispensable for diagnosing performance bottlenecks, troubleshooting issues, and fine-tuning SQL statements.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle SQL Tracing with Event 10046 Performance Tuning</title><link>https://www.oraclescripts.com/post/oracle-performance-tuning-advanced-sql-tracing-with-event-10046/</link><pubDate>Sun, 25 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-performance-tuning-advanced-sql-tracing-with-event-10046/</guid><description>
&lt;h2 id="oracle-performance-tuning-harness-the-power-of-event-10046-tracing"&gt;Oracle Performance Tuning: Harness the Power of Event 10046 Tracing&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This Oracle Database technique allows you to enable extended SQL tracing using Event 10046. This produces highly detailed trace files capturing SQL statements, bind variables, wait events, and more, making it an indispensable tool for performance tuning and troubleshooting.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;To switch it on:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;alter session set events &amp;#39;10046 trace name context forever, level 8&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;To switch it off:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;alter session set events &amp;#39;10046 trace name context off&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;1. To Switch It On:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Storage: Analyze Rows per Block with SQL</title><link>https://www.oraclescripts.com/post/optimize-oracle-database-storage-analyze-rows-per-block-with-sql/</link><pubDate>Sat, 24 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/optimize-oracle-database-storage-analyze-rows-per-block-with-sql/</guid><description>
&lt;h2 id="oracle-database-understanding-rows-per-block-for-efficient-storage"&gt;Oracle Database: Understanding Rows per Block for Efficient Storage&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;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 database health.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select avg(row_count) avg
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;, max(row_count) max
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;, min(row_count) min
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;from (
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt; select count(*) row_count
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt; from &amp;amp;table_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt; group by substr(rowid, 1, 15)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;8&lt;/span&gt;&lt;span class="cl"&gt; )
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;9&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="code-breakdown"&gt;Code Breakdown&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;select avg(row_count) avg, max(row_count) max, min(row_count) min&lt;/code&gt;: Selects three calculated columns:&lt;/p&gt;</description></item><item><title>Oracle Buffer Cache Advisory: v$db_cache_advice Tuning</title><link>https://www.oraclescripts.com/post/oracle-performance-tuning-leverage-the-buffer-cache-advisory-for-optimal-performance/</link><pubDate>Fri, 23 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-performance-tuning-leverage-the-buffer-cache-advisory-for-optimal-performance/</guid><description>
&lt;h2 id="oracle-database-deciphering-the-buffer-cache-advisory-for-performance-gains"&gt;Oracle Database: Deciphering the Buffer Cache Advisory for Performance Gains&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;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 cache sizes, it empowers you to make informed decisions about adjusting your buffer cache, ultimately improving query performance.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Disabled Foreign Key Constraints: dba_constraints</title><link>https://www.oraclescripts.com/post/identifying-disabled-foreign-key-constraints-in-oracle-database/</link><pubDate>Sun, 04 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identifying-disabled-foreign-key-constraints-in-oracle-database/</guid><description>
&lt;h2 id="identifying-disabled-foreign-key-constraints-in-oracle-database-using-dba_constraints"&gt;Identifying Disabled Foreign Key Constraints in Oracle Database using dba_constraints&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;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.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt; &lt;span class="mi"&gt;999&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt; &lt;span class="n"&gt;a60&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="n"&gt;constraint_name&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt; &lt;span class="n"&gt;a30&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;select&lt;/span&gt; &lt;span class="n"&gt;owner&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="n"&gt;table_name&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;table&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;constraint_name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dba_constraints&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;where&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;DISABLED&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;constraint_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;R&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;owner&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SYS&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SYSTEM&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle: Enable Disabled Foreign Key Constraints</title><link>https://www.oraclescripts.com/post/enabling-disabled-foreign-key-constraints-in-oracle-database/</link><pubDate>Sat, 03 Aug 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/enabling-disabled-foreign-key-constraints-in-oracle-database/</guid><description>
&lt;h2 id="enabling-disabled-foreign-key-constraints-in-oracle-database-using-dba_constraints"&gt;Enabling Disabled Foreign Key Constraints in Oracle Database using dba_constraints&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;This SQL query generates a list of SQL statements that can be executed to enable all disabled foreign key constraints in an Oracle database.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt; &lt;span class="mi"&gt;999&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;select&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;alter table &amp;#39;&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="n"&gt;owner&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="n"&gt;table_name&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39; enable constraint&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;&amp;#39;||constraint_name||&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39; &amp;#34;enable&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dba_constraints&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;where&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;DISABLED&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;constraint_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;R&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;owner&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SYS&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SYSTEM&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;8&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;9&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="understanding-the-oracle-sql-code"&gt;Understanding the Oracle SQL Code&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; This SQL query generates a list of SQL statements that can be executed to enable all disabled foreign key constraints in an Oracle database.&lt;/p&gt;</description></item><item><title>dba_constraints: Query All Oracle Table Constraints</title><link>https://www.oraclescripts.com/post/show-all-oracle-database-table-constraints/</link><pubDate>Wed, 19 Jun 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-all-oracle-database-table-constraints/</guid><description>
&lt;h2 id="show-all-oracle-database-table-constraints-using-dba_constraints"&gt;Show All Oracle Database Table Constraints using dba_constraints&lt;/h2&gt;
&lt;p&gt;This article delves into the world of Oracle Database constraints, empowering you to understand their types, statuses, and modification history. We'll dissect a powerful SQL query that retrieves this crucial information, making you a database management pro.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt; &lt;span class="n"&gt;a10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="n"&gt;cons_name&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt; &lt;span class="n"&gt;a30&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;select&lt;/span&gt; &lt;span class="n"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;constraint_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;C&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Check&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;O&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;R/O View&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;P&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Primary&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;R&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Foreign&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;U&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Unique&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;V&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Check view&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;constraint_name&lt;/span&gt; &lt;span class="n"&gt;cons_name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;last_change&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dba_constraints&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;where&lt;/span&gt; &lt;span class="n"&gt;owner&lt;/span&gt; &lt;span class="n"&gt;like&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;amp;owner&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;table_name&lt;/span&gt; &lt;span class="n"&gt;like&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;amp;table_name&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle: List Tables Using a Table as a Foreign Key</title><link>https://www.oraclescripts.com/post/list-oracle-tables-that-are-using-the-specified-oracle-table-as-a-foreign-key/</link><pubDate>Tue, 18 Jun 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/list-oracle-tables-that-are-using-the-specified-oracle-table-as-a-foreign-key/</guid><description>
&lt;h2 id="list-tables-that-are-using-the-specified-table-as-a-foreign-key-using-dba_constraints"&gt;List Tables That Are Using the Specified Table as a Foreign Key using dba_constraints&lt;/h2&gt;
&lt;p&gt;Learn how to use an Oracle SQL query to identify tables referencing a specific table with foreign keys, understand database relationships, and ensure data integrity
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt; &lt;span class="mi"&gt;999&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;select&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;owner&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;table_name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;constraint_name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dba_constraints&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dba_constraints&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;where&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;constraint_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;R&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r_constraint_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;constraint_name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r_owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;owner&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;amp;table_owner&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;table_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;amp;table_name&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="same-as-above-but-produces-disable-constraint-statements"&gt;Same as above, but produces 'disable constraint' statements&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt; &lt;span class="mi"&gt;999&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;select&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;owner&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;table_name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;constraint_name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dba_constraints&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dba_constraints&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;where&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;constraint_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;R&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r_constraint_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;constraint_name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r_owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;owner&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;amp;table_owner&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;table_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;amp;table_name&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Undo Retention Tuning: ALTER SYSTEM Guide</title><link>https://www.oraclescripts.com/post/optimizing-undo-retention-in-oracle-databases/</link><pubDate>Sun, 12 May 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/optimizing-undo-retention-in-oracle-databases/</guid><description>
&lt;h2 id="optimizing-undo-retention-in-oracle-databases"&gt;Optimizing Undo Retention in Oracle Databases&lt;/h2&gt;
&lt;p&gt;We will explain how to optimize the undo_retention parameter in Oracle databases using the SQL command &lt;code&gt;ALTER SYSTEM SET undo_retention = 500 SCOPE = MEMORY;&lt;/code&gt;. Understanding this parameter is crucial for effective transaction management, rollback capabilities, and maintaining read consistency. Learn how to fine-tune it based on your workload, ensuring sufficient undo information is retained without negatively impacting performance.&lt;/p&gt;
&lt;p&gt;Note: undo_retntion is in seconds.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Undo, A Deep Dive into DBA_UNDO_EXTENTS</title><link>https://www.oraclescripts.com/post/oracle-undo-a-deep-dive-into-dba-undo-extents/</link><pubDate>Sat, 11 May 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-undo-a-deep-dive-into-dba-undo-extents/</guid><description>
&lt;h2 id="oracle-undo-a-deep-dive-into-dba_undo_extents"&gt;Oracle Undo: A Deep Dive into DBA_UNDO_EXTENTS&lt;/h2&gt;
&lt;p&gt;Unlock the secrets of Oracle's undo mechanism with this in-depth guide to the &lt;code&gt;DBA_UNDO_EXTENTS&lt;/code&gt; view. Learn how to analyze undo tablespace usage, interpret extent statuses (ACTIVE, UNEXPIRED, EXPIRED), and gain valuable insights for proactive database management. Avoid &amp;quot;snapshot too old&amp;quot; errors and ensure smooth transaction handling with this essential SQL query and expert tips.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle Rollback Detection: Monitor Active Transactions</title><link>https://www.oraclescripts.com/post/real-time-oracle-rollback-detection-is-your-database-undoing-changes/</link><pubDate>Fri, 10 May 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/real-time-oracle-rollback-detection-is-your-database-undoing-changes/</guid><description>
&lt;h2 id="real-time-oracle-rollback-detection-is-your-database-undoing-changes"&gt;Real-Time Oracle Rollback Detection: Is Your Database Undoing Changes?&lt;/h2&gt;
&lt;p&gt;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, the rollback is complete. Use this query to maintain data integrity, troubleshoot slowdowns, and proactively manage your Oracle database.&lt;/p&gt;
&lt;p&gt;Notes: Is anything rolling back at the moment? Look for the used_ublk value decreasing. If it is, the session connected with it is rolling back. When it reaches zero, rollback is complete.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle ALTER DATABASE DROP LOGFILE MEMBER Guide</title><link>https://www.oraclescripts.com/post/understanding-alter-database-drop-logfile-member-in-oracle-databases/</link><pubDate>Tue, 23 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/understanding-alter-database-drop-logfile-member-in-oracle-databases/</guid><description>
&lt;h2 id="understanding-alter-database-drop-logfile-member-in-oracle-databases"&gt;Understanding ALTER DATABASE DROP LOGFILE MEMBER in Oracle Databases&lt;/h2&gt;
&lt;p&gt;Learn how to use ALTER DATABASE DROP LOGFILE MEMBER to remove redo log file members in Oracle databases. Get insights, explanations, and best practices.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter database drop logfile member &amp;#39;&amp;lt;filename&amp;gt;&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose of &lt;code&gt;ALTER DATABASE DROP LOGFILE MEMBER&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In Oracle databases, the &lt;code&gt;ALTER DATABASE DROP LOGFILE MEMBER&lt;/code&gt; command is used to permanently remove individual redo log file members from a redo log group. Redo log files are essential for database recovery, as they store a record of all changes made to the database.&lt;/p&gt;</description></item><item><title>Oracle: Add Redo Log Members with ALTER DATABASE</title><link>https://www.oraclescripts.com/post/expand-your-oracle-database-adding-redo-log-file-members-with-alter-database-add-logfile-member/</link><pubDate>Mon, 22 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/expand-your-oracle-database-adding-redo-log-file-members-with-alter-database-add-logfile-member/</guid><description>
&lt;h2 id="expand-your-oracle-database-adding-redo-log-file-members-with-alter-database-add-logfile-member"&gt;Expand Your Oracle Database: Adding Redo Log File Members with ALTER DATABASE ADD LOGFILE MEMBER&lt;/h2&gt;
&lt;p&gt;Master the art of adding redo log file members in Oracle databases with &lt;code&gt;ALTER DATABASE ADD LOGFILE MEMBER&lt;/code&gt; . Optimize performance, redundancy, and database management.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter database add logfile member &amp;#39;&amp;lt;filename&amp;gt;&amp;#39; to group &amp;lt;group&amp;gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose: Enhancing Oracle Database Resilience with &lt;code&gt;ALTER DATABASE ADD LOGFILE MEMBER&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Calculating Redo Log File Sizes in Oracle Databases</title><link>https://www.oraclescripts.com/post/calculating-redo-log-file-sizes-in-oracle-databases/</link><pubDate>Sun, 21 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/calculating-redo-log-file-sizes-in-oracle-databases/</guid><description>
&lt;h2 id="calculating-redo-log-file-sizes-in-oracle-databases"&gt;Calculating Redo Log File Sizes in Oracle Databases&lt;/h2&gt;
&lt;p&gt;Maintaining optimal performance in your Oracle database often involves careful monitoring of various components. Redo log files, crucial for recovery, require attention to ensure they're sized appropriately. In this post, I'll share a code snippet to list redo log file members and their sizes, along with explanations and insights.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;col member format a60
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Size MB&amp;#34; format 9,999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;select lf.member
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;, ceil(lg.bytes / 1024 / 1024) &amp;#34;Size MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;from v$logfile lf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;, v$log lg
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;where lg.group# = lf.group#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;8&lt;/span&gt;&lt;span class="cl"&gt;order by 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;9&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;
Maintaining optimal performance in your Oracle database often involves careful monitoring of various components. Redo log files, crucial for recovery, require attention to ensure they're sized appropriately. In this post, I'll share a code snippet to list redo log file members and their sizes, along with explanations and insights.&lt;/p&gt;</description></item><item><title>Understanding Rollback Segments in Oracle Databases</title><link>https://www.oraclescripts.com/post/understanding-rollback-segments-in-oracle-databases/</link><pubDate>Sat, 20 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/understanding-rollback-segments-in-oracle-databases/</guid><description>
&lt;h2 id="understanding-rollback-segments-in-oracle-databases"&gt;Understanding Rollback Segments in Oracle Databases&lt;/h2&gt;
&lt;p&gt;Rollback segments are essential components of Oracle databases, providing a mechanism to reverse uncommitted transactions and maintain data consistency. This post presents a SQL query for inspecting rollback segments, as well as explanations and insights into their role.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select segment_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;, status
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;from dba_rollback_segs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This SQL code serves to:&lt;/p&gt;</description></item><item><title>Build OS Delete Commands for Oracle Database Files</title><link>https://www.oraclescripts.com/post/building-os-delete-commands-for-oracle-database-files-caution-destructive/</link><pubDate>Mon, 08 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/building-os-delete-commands-for-oracle-database-files-caution-destructive/</guid><description>
&lt;h2 id="building-removerm-or-delete-os-commands-for-oracle-database-files-caution-destructive"&gt;Building Remove(rm) or Delete OS Commands for Oracle Database Files (Caution: Destructive)&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Important Warning: Destructive Operation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The provided code snippet demonstrates how to construct operating system (OS) commands for all datafiles, temporary files, log files, and control files within an Oracle Database. However, it's crucial to understand that the constructed commands use the&lt;code&gt;rm&lt;/code&gt;command, which permanently deletes files. Running this code would result in the deletion of all these database files, leading to severe data loss and database failure.&lt;/p&gt;</description></item><item><title>Disable Autoextend for All Datafiles in Oracle Database</title><link>https://www.oraclescripts.com/post/disable-autoextend-for-all-datafiles-in-oracle-database/</link><pubDate>Sun, 07 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/disable-autoextend-for-all-datafiles-in-oracle-database/</guid><description>
&lt;h2 id="disabling-autoextend-for-all-datafiles-in-oracle-database"&gt;Disabling Autoextend for All Datafiles in Oracle Database&lt;/h2&gt;
&lt;p&gt;This guide explores a method to turn off autoextend for all datafiles within an Oracle Database. We'll delve into the provided SQL code, understand its purpose, and offer key considerations for implementation.&lt;/p&gt;
&lt;p&gt;Turn autoextend off for all datafiles
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select &amp;#39;alter database datafile &amp;#39;&amp;#39;&amp;#39; || file_name || &amp;#39;&amp;#39;&amp;#39; autoextend off;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from dba_data_files
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="understanding-autoextend"&gt;Understanding Autoextend&lt;/h3&gt;
&lt;p&gt;Autoextend is a feature in Oracle Database that allows datafiles to automatically grow when they reach their designated size limit. While convenient, it can lead to uncontrolled storage consumption if left unchecked. Disabling autoextend gives you more granular control over datafile growth.&lt;/p&gt;</description></item><item><title>Move Oracle Database Datafiles and Log Files to New Disk</title><link>https://www.oraclescripts.com/post/move-oracle-database-files-to-another-disk-datafiles-and-log-files/</link><pubDate>Sat, 06 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/move-oracle-database-files-to-another-disk-datafiles-and-log-files/</guid><description>
&lt;h2 id="moving-oracle-database-datafiles-and-log-files-to-another-disk"&gt;Moving Oracle Database Datafiles and Log Files to Another Disk&lt;/h2&gt;
&lt;p&gt;This guide addresses migrating Oracle Database datafiles and online redo log files from one disk location to another. We'll delve into the provided PL/SQL code, understand its functionality, and offer key considerations for implementation.&lt;/p&gt;
&lt;p&gt;Move files between disks
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set trimspool on wrap off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;set heading off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;set verify off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;set pages 1000 lines 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;spool rename.sql
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;select &amp;#39;alter database rename file &amp;#39;&amp;#39;&amp;#39; ||
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; name || &amp;#39;&amp;#39;&amp;#39; to &amp;#39;&amp;#39;&amp;#39; ||
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt; replace(name || &amp;#39;&amp;#39;&amp;#39;;&amp;#39;, &amp;#39;/u01&amp;#39;, &amp;#39;/u02&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;from v$datafile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;select &amp;#39;alter database rename file &amp;#39;&amp;#39;&amp;#39; ||
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt; member || &amp;#39;&amp;#39;&amp;#39; to &amp;#39;&amp;#39;&amp;#39; ||
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; replace(member || &amp;#39;&amp;#39;&amp;#39;;&amp;#39;, &amp;#39;/u01&amp;#39;, &amp;#39;/u02&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;from v$logfile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;spool off
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="understanding-the-need-for-relocation"&gt;Understanding the Need for Relocation&lt;/h3&gt;
&lt;p&gt;Databases often require more storage space as data accumulates. Moving datafiles and log files to a dedicated disk with higher capacity or better performance can optimize database operations.&lt;/p&gt;</description></item><item><title>Find Oracle Control File Locations with v$controlfile</title><link>https://www.oraclescripts.com/post/find-control-file-locations-in-oracle-database/</link><pubDate>Fri, 05 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/find-control-file-locations-in-oracle-database/</guid><description>
&lt;h2 id="viewing-control-file-locations-in-oracle-database"&gt;Viewing Control File Locations in Oracle Database&lt;/h2&gt;
&lt;p&gt;This guide explores a simple method to identify the locations of control files in your Oracle Database. We'll delve into the provided SQL code, understand its purpose, and offer insights into control files.&lt;/p&gt;
&lt;p&gt;List controlfiles
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from v$controlfile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="understanding-control-files"&gt;Understanding Control Files&lt;/h3&gt;
&lt;p&gt;Control files are essential, binary files in Oracle Database that store crucial metadata about the database's physical structure. This information includes:&lt;/p&gt;</description></item><item><title>Find Duplicate Filenames in Oracle Database</title><link>https://www.oraclescripts.com/post/find-duplicate-filenames-in-oracle-database/</link><pubDate>Thu, 04 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/find-duplicate-filenames-in-oracle-database/</guid><description>
&lt;h2 id="find-duplicate-filenames-in-oracle-database-code-breakdown-and-insights"&gt;Find Duplicate Filenames in Oracle Database: Code Breakdown and Insights&lt;/h2&gt;
&lt;p&gt;This post dives into an Oracle Database code snippet that identifies duplicate filenames across your entire database. We'll break down the code, explain its purpose, and provide valuable insights for optimizing your database management.&lt;/p&gt;
&lt;p&gt;Find duplicate filenames. Searches for files with the same name in all directories.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select count(substr(name, instr(name, &amp;#39;/&amp;#39;, -1) + 1, 999)) &amp;#34;total&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;,count(distinct substr(name, instr(name, &amp;#39;/&amp;#39;, -1) + 1, 999)) &amp;#34;distinct&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;from v$datafile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle: Identify Datafiles in Hot Backup Mode</title><link>https://www.oraclescripts.com/post/identify-oracle-database-files-in-hot-backup-mode/</link><pubDate>Thu, 04 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identify-oracle-database-files-in-hot-backup-mode/</guid><description>
&lt;h2 id="find-duplicate-filenames-in-oracle-database-code-breakdown-and-insights"&gt;Find Duplicate Filenames in Oracle Database: Code Breakdown and Insights&lt;/h2&gt;
&lt;p&gt;This post dives into an Oracle Database code snippet that identifies duplicate filenames across your entire database. We'll break down the code, explain its purpose, and provide valuable insights for optimizing your database management.&lt;/p&gt;
&lt;p&gt;Find duplicate filenames. Searches for files with the same name in all directories.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select count(substr(name, instr(name, &amp;#39;/&amp;#39;, -1) + 1, 999)) &amp;#34;total&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;,count(distinct substr(name, instr(name, &amp;#39;/&amp;#39;, -1) + 1, 999)) &amp;#34;distinct&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;from v$datafile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle: List Datafiles, Tempfiles, and Logfiles with Sizes</title><link>https://www.oraclescripts.com/post/display-all-oracle-database-datafiles-tempfiles-and-logfiles-and-the-size/</link><pubDate>Tue, 26 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/display-all-oracle-database-datafiles-tempfiles-and-logfiles-and-the-size/</guid><description>
&lt;h2 id="investigating-your-oracle-database-files-a-breakdown-for-optimization"&gt;Investigating Your Oracle Database Files: A Breakdown for Optimization&lt;/h2&gt;
&lt;p&gt;This blog post delves into an Oracle Database code snippet designed to provide valuable insights into your database's storage and activity. We'll dissect its purpose, explain each component, and reveal key points to optimize your database's health and performance.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set lines 100 pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col name format a50
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;select name, bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;from (select name, bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt; from v$datafile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt; union all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt; select name, bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt; from v$tempfile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; union all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt; select lf.member &amp;#34;name&amp;#34;, l.bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt; from v$logfile lf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt; , v$log l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt; where lf.group# = l.group#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt; union all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt; select name, 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; from v$controlfile) used
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;, (select sum(bytes) as p
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt; from dba_free_space) free
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Quick Oracle Database Datafile Health Check with SQL</title><link>https://www.oraclescripts.com/post/quick-oracle-database-datafile-health-check-with-sql/</link><pubDate>Mon, 25 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/quick-oracle-database-datafile-health-check-with-sql/</guid><description>
&lt;h2 id="quick-oracle-database-datafile-health-check-with-sql"&gt;Quick Oracle Database Datafile Health Check with SQL&lt;/h2&gt;
&lt;p&gt;This post explores a simple yet effective SQL query for a quick health check on your Oracle database's datafiles. We'll delve into the purpose, breakdown, key points, and insights gained from the query, providing valuable information for database administrators and anyone interested in maintaining optimal database health.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select distinct status from v$datafile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Find Autoextensible Datafiles in Oracle Database</title><link>https://www.oraclescripts.com/post/find-autoextensible-datafiles-in-oracle-database/</link><pubDate>Sat, 23 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/find-autoextensible-datafiles-in-oracle-database/</guid><description>
&lt;h2 id="how-to-find-autoextensible-datafiles-in-oracle-database-sql-included"&gt;How to Find Autoextensible Datafiles in Oracle Database (SQL Included)&lt;/h2&gt;
&lt;p&gt;Are you managing an Oracle database and want to identify datafiles configured for automatic extension? This post will guide you through a simple SQL query to achieve that. We'll break down the code, explain its purpose, and offer valuable insights into autoextensible datafiles.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select file_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from dba_data_files
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;where autoextensible = &amp;#39;YES&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Locate Your Oracle Database Datafile Directories with SQL</title><link>https://www.oraclescripts.com/post/locate-your-oracle-database-datafile-directories-with-sql/</link><pubDate>Fri, 22 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/locate-your-oracle-database-datafile-directories-with-sql/</guid><description>
&lt;h2 id="locate-your-oracle-database-datafile-directories-with-sql"&gt;Locate Your Oracle Database Datafile Directories with SQL&lt;/h2&gt;
&lt;p&gt;This handy SQL query that helps you pinpoint the exact directories where your Oracle database stores its datafiles. Understanding datafile locations is crucial for database administrators and anyone involved in managing an Oracle database. We'll explore the purpose, breakdown, key points, and insights gained from the query, empowering you to effectively manage your database environment.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Quickly Identify Indexed Columns in Oracle Database Tables</title><link>https://www.oraclescripts.com/post/identify-indexed-columns-in-oracle-database-tables/</link><pubDate>Tue, 19 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identify-indexed-columns-in-oracle-database-tables/</guid><description>
&lt;h2 id="identify-indexed-columns-in-oracle-database-tables"&gt;Identify Indexed Columns in Oracle Database Tables&lt;/h2&gt;
&lt;p&gt;Optimizing queries in Oracle Database often involves understanding how indexes are used. This post will guide you through a powerful SQL code snippet that helps you efficiently identify the columns included in a specific index.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select column_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from dba_ind_columns
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;where index_name = &amp;#39;&amp;amp;index&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;order by column_position
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="purpose-unveiling-the-secrets-of-indexes"&gt;Purpose: Unveiling the Secrets of Indexes&lt;/h3&gt;
&lt;p&gt;The provided code snippet serves a critical purpose for Oracle database administrators and developers. It allows you to query the &lt;code&gt;dba_ind_columns&lt;/code&gt; data dictionary view and retrieve a list of columns that are part of a particular index. This information is essential for:&lt;/p&gt;</description></item><item><title>Oracle: Identify Large Indexes with SQL and DBA_SEGMENTS</title><link>https://www.oraclescripts.com/post/identify-large-indexes-for-oracle-database-optimization-with-sql/</link><pubDate>Sun, 17 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identify-large-indexes-for-oracle-database-optimization-with-sql/</guid><description>
&lt;h2 id="optimizing-your-oracle-database-a-guide-to-identifying-large-indexes-with-sql"&gt;Optimizing Your Oracle Database: A Guide to Identifying Large Indexes with SQL&lt;/h2&gt;
&lt;p&gt;Keeping your Oracle Database running smoothly requires constant monitoring and optimization. Indexes, a crucial component for efficient data retrieval, can sometimes grow excessively, impacting performance. This blog post dives into a powerful SQL query that helps you pinpoint large indexes associated with specific tables, empowering you to make informed decisions about database optimization.&lt;/p&gt;
&lt;p&gt;Keeping your Oracle Database running smoothly requires constant monitoring and optimization. Indexes, a crucial component for efficient data retrieval, can sometimes grow excessively, impacting performance. This blog post dives into a powerful SQL query that helps you pinpoint large indexes associated with specific tables, empowering you to make informed decisions about database optimization.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle PL/SQL: SHOW ERRORS and dba_errors Explained</title><link>https://www.oraclescripts.com/post/oracle-compilation-errors-and-warnings-using-show-errors-and-dba-errors-in-the-oracle-database/</link><pubDate>Sat, 16 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-compilation-errors-and-warnings-using-show-errors-and-dba-errors-in-the-oracle-database/</guid><description>
&lt;h2 id="struggling-with-compilation-errors-and-warnings-in-oracle-database"&gt;Struggling with compilation errors and warnings in Oracle Database?&lt;/h2&gt;
&lt;p&gt;For those working with Oracle Database, ensuring code compiles smoothly is paramount. Compilation errors can derail stored procedures, functions, packages, and triggers, leading to unexpected behavior. This guide equips you with the knowledge to effectively identify and understand compilation errors and warnings using the&lt;code&gt;SHOW ERRORS&lt;/code&gt;statement and&lt;code&gt;dba_errors&lt;/code&gt;view in Oracle Database.&lt;/p&gt;
&lt;h3 id="understanding-compilation-errors-and-warnings"&gt;Understanding Compilation Errors and Warnings&lt;/h3&gt;
&lt;p&gt;Compilation translates human-readable code (like PL/SQL) into instructions the database can execute. During this process, the compiler scans for syntax errors (incorrect grammar), semantic errors (logical inconsistencies), and potential issues that might affect code execution.&lt;/p&gt;</description></item><item><title>dba_segments: Find Oracle Table Storage Usage by User</title><link>https://www.oraclescripts.com/post/identify-user-oracle-database-table-storage-usage-using-dba-segments/</link><pubDate>Fri, 15 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identify-user-oracle-database-table-storage-usage-using-dba-segments/</guid><description>
&lt;h2 id="uncovering-table-storage-usage-in-oracle-database-a-guide-with-dba_segments"&gt;Uncovering Table Storage Usage in Oracle Database: A Guide with &lt;code&gt;dba_segments&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;For Oracle Database administrators (DBAs) and developers, managing storage efficiently is critical. Keeping track of table sizes helps identify potential space hogs and optimize resource allocation. This guide delves into a powerful SQL query that leverages the &lt;code&gt;dba_segments&lt;/code&gt; view to effectively list all tables owned by a user, sorted by their size in megabytes (MB).
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle DBMS_METADATA.GET_DDL: Extract Object DDL</title><link>https://www.oraclescripts.com/post/extracting-object-ddl-in-oracle-database-9i-onwards/</link><pubDate>Thu, 07 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/extracting-object-ddl-in-oracle-database-9i-onwards/</guid><description>
&lt;h2 id="unveiling-the-mystery-extracting-object-ddl-in-oracle-database-9i-onwards"&gt;Unveiling the Mystery: Extracting Object DDL in Oracle Database (9i onwards)&lt;/h2&gt;
&lt;p&gt;Ever faced the situation where you needed the Data Definition Language (DDL) script for an existing table, view, or other database object in your Oracle database (version 9i or later)? This can be crucial for various tasks, such as replicating schema structures, documenting changes, or troubleshooting issues. Fear not, for Oracle provides a powerful built-in function, &lt;code&gt;DBMS_METADATA.GET_DDL&lt;/code&gt; , that empowers you to retrieve the DDL script for virtually any database object. This article delves into the purpose, breakdown, and key points of the provided Oracle code snippet, offering insights and explanations to equip you with the knowledge to effectively extract object DDLs in your Oracle environment.&lt;/p&gt;</description></item><item><title>Find Tables Containing a Specific Column in Oracle Database</title><link>https://www.oraclescripts.com/post/find-tables-containing-a-specific-column-in-oracle-database/</link><pubDate>Wed, 06 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/find-tables-containing-a-specific-column-in-oracle-database/</guid><description>
&lt;h2 id="use-a-sql-query-to-find-tables-containing-a-specific-column-in-oracle-database"&gt;Use a SQL Query To Find Tables Containing a Specific Column in Oracle Database&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Managing a complex Oracle database often involves navigating a labyrinth of tables and columns. Identifying specific data points within these tables can be crucial for various tasks. Knowing which tables contain a particular column is essential for tasks like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Data Relationship Analysis:&lt;/strong&gt; Understanding how data flows between tables requires knowledge of shared columns.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modifying Database Structures:&lt;/strong&gt; Altering existing tables or adding new columns necessitates knowing where the relevant data resides.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ensuring Data Integrity:&lt;/strong&gt; Maintaining data consistency often involves verifying the presence and validity of specific columns across tables.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This article explores an efficient SQL query that helps you locate all tables containing a designated column name in your Oracle database. We'll delve into the code breakdown, key points, and insights to empower you with this valuable technique.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Unveiling the Mystery Oracle for Object Size Analysis</title><link>https://www.oraclescripts.com/post/query-an-oracle-object-size-dba-segments/</link><pubDate>Wed, 28 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/query-an-oracle-object-size-dba-segments/</guid><description>
&lt;h2 id="unveiling-the-mystery-demystifying-an-oracle-sql-code-snippet-for-object-size-analysis"&gt;Unveiling the Mystery: Demystifying an Oracle SQL Code Snippet for Object Size Analysis&lt;/h2&gt;
&lt;p&gt;In the ever-evolving realm of database management, efficient resource utilization is paramount. Oracle, a widely recognized database management system, offers powerful tools to help optimize storage and performance. This blog post delves into a specific Oracle SQL code snippet, empowering you to understand its purpose, function, and key insights it reveals.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Oracle DBA_OBJECTS: List All Objects Owned by a User</title><link>https://www.oraclescripts.com/post/dba-objects-display-oracle-objects-by-user/</link><pubDate>Tue, 27 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/dba-objects-display-oracle-objects-by-user/</guid><description>
&lt;h2 id="unveiling-your-database-toolkit-exploring-objects-owned-by-a-user-in-oracle"&gt;Unveiling Your Database Toolkit: Exploring Objects Owned by a User in Oracle&lt;/h2&gt;
&lt;p&gt;In the intricate world of database management, understanding the landscape of objects is crucial for efficient operation. This blog post empowers you to leverage a specific &lt;strong&gt;Oracle Database SQL code snippet&lt;/strong&gt; to &lt;strong&gt;list all objects owned by a particular user&lt;/strong&gt;. This knowledge equips you to navigate user privileges, manage object dependencies, and gain valuable insights into your database's structure.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>Query The Oracle Database Procedure Source Code</title><link>https://www.oraclescripts.com/post/display-source-code-of-oracle-procedure-dba-source/</link><pubDate>Mon, 26 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/display-source-code-of-oracle-procedure-dba-source/</guid><description>
&lt;h2 id="unveiling-the-mystery-demystifying-an-oracle-database-procedure"&gt;Unveiling the Mystery: Demystifying an Oracle Database Procedure&lt;/h2&gt;
&lt;p&gt;In the realm of relational databases, &lt;strong&gt;procedures&lt;/strong&gt; serve as powerful tools for encapsulating complex sets of instructions and improving code reusability. They act as building blocks, streamlining development and maintenance. Today, we'll delve into the intricacies of an Oracle Database procedure, providing a breakdown and explanation of the following code below:
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select text
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from dba_source
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;where owner = &amp;#39;BILL&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;and name = &amp;#39;FILE_TEST&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;and type = &amp;#39;PACKAGE BODY&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;order by line
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Search Objects in Oracle Database</title><link>https://www.oraclescripts.com/post/search-objects-in-oracle-database/</link><pubDate>Sun, 25 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/search-objects-in-oracle-database/</guid><description>
&lt;h2 id="how-to-search-for-objects-in-oracle-database"&gt;How to Search for Objects in Oracle Database&lt;/h2&gt;
&lt;p&gt;This post explains how to search for objects (tables, views, sequences, etc.) in an Oracle database using SQL.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col owner format a15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col object_name format a40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col object_type format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;select owner
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, object_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, object_type
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;from dba_objects
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;where lower(object_name) like lower(&amp;#39;%&amp;amp;object%&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;order by owner, object_type, object_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;OWNER OBJECT_NAME OBJECT_TYPE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;--------------- ---------------------------------------- -----------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;ORDSYS flashType172_T TYPE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC DBMS_FLASHBACK SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC FLASHBACK_TRANSACTION_QUERY SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC GV$FLASHBACK_DATABASE_LOG SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC GV$FLASHBACK_DATABASE_LOGFILE SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC GV$FLASHBACK_DATABASE_STAT SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC V$FLASHBACK_DATABASE_LOG SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC V$FLASHBACK_DATABASE_LOGFILE SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC V$FLASHBACK_DATABASE_STAT SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC V$FLASH_RECOVERY_AREA_USAGE SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;SYS DBMS_FLASHBACK PACKAGE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;SYS DBMS_FLASHBACK PACKAGE BODY
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;SYS FLASHBACKTBLIST TYPE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;SYS FLASHBACK_TRANSACTION_QUERY VIEW
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;SYS GV_$FLASHBACK_DATABASE_LOG VIEW
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;SYS GV_$FLASHBACK_DATABASE_LOGFILE VIEW
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;SYS GV_$FLASHBACK_DATABASE_STAT VIEW
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;SYS V_$FLASHBACK_DATABASE_LOG VIEW
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt;SYS V_$FLASHBACK_DATABASE_LOGFILE VIEW
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt;SYS V_$FLASHBACK_DATABASE_STAT VIEW
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt;SYS V_$FLASH_RECOVERY_AREA_USAGE VIEW
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;24&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;25&lt;/span&gt;&lt;span class="cl"&gt;21 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Identify and Fix Invalid Objects in Oracle Database</title><link>https://www.oraclescripts.com/post/how-to-identify-and-fix-invalid-objects-in-oracle-database/</link><pubDate>Sat, 24 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-to-identify-and-fix-invalid-objects-in-oracle-database/</guid><description>
&lt;h2 id="how-to-identify-and-fix-invalid-objects-in-a-oracle-database"&gt;How to Identify and Fix Invalid Objects in A Oracle Database&lt;/h2&gt;
&lt;p&gt;Below we explain how to identify and fix invalid objects in your Oracle database using SQL. This improves the database health and performance.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;set lines 200 pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;obj&amp;#34; format a40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;select owner || &amp;#39;.&amp;#39; || object_name &amp;#34;obj&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;object_type
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;from dba_objects
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;where status = &amp;#39;INVALID&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;OBJ OBJECT_TYPE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;---------------------------------------- --------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER.CHECK PACKAGE BODY
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER.MAILER PACKAGE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER.APP_FUNCS PACKAGE BODY
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC.DBA_HIST_FILESTATXS SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC.DBA_HIST_SQLSTAT SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC.DBA_HIST_SQLBIND SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC.DBA_HIST_TABLESPACE_STAT SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC.DBA_HIST_SERVICE_STAT SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC.DBA_HIST_SERVICE_WAIT_CLASS SYNONYM
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Recompile Invalid Objects with utlrp.sql</title><link>https://www.oraclescripts.com/post/recompile-invalid-objects-in-oracle-database/</link><pubDate>Fri, 23 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/recompile-invalid-objects-in-oracle-database/</guid><description>
&lt;h2 id="instructions-on-how-to-re-compile-invalid-objects-in-oracle-database-a-comprehensive-guide"&gt;Instructions On How To Re-compile Invalid Objects in Oracle Database: A Comprehensive Guide&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;@?/rdbms/admin/utlrp.sql
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Ensuring the smooth operation of your Oracle database requires maintaining the validity of its objects. These objects, including tables, procedures, functions, and packages, can become invalid due to various reasons like schema changes, database upgrades, or compilation errors. Invalid objects hinder database performance and can lead to unexpected behavior or errors when accessed.&lt;/p&gt;</description></item><item><title>Creating a Temporary Tablespace in Oracle Database</title><link>https://www.oraclescripts.com/post/create-temporary-tablespace-in-a-oracle-database/</link><pubDate>Thu, 15 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/create-temporary-tablespace-in-a-oracle-database/</guid><description>
&lt;h2 id="creating-a-temporary-tablespace-in-oracle-database"&gt;Creating a Temporary Tablespace in Oracle Database&lt;/h2&gt;
&lt;p&gt;This guide explains an Oracle Database SQL code snippet for creating a temporary tablespace named &lt;code&gt;temp&lt;/code&gt;, its purpose, key points, and insights.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;create temporary tablespace temp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;tempfile &amp;#39;&amp;lt;file_name&amp;gt;&amp;#39; size 500M
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="create-a-temporary-tablespace-named-temp-heres-a-breakdown"&gt;Create a Temporary Tablespace named temp. Here's a breakdown&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To establish a dedicated space for storing temporary data used within the current database session. This improves performance and simplifies cleanup as temporary objects are automatically removed upon session termination.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Understanding User Quotas in Oracle Database</title><link>https://www.oraclescripts.com/post/user-quotas-on-all-oracle-database-tablespaces/</link><pubDate>Wed, 14 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/user-quotas-on-all-oracle-database-tablespaces/</guid><description>
&lt;h2 id="how-to-query-user-quotas-in-oracle-database"&gt;How to Query User Quotas in Oracle Database&lt;/h2&gt;
&lt;p&gt;The code below retrieves and displays information about user quotas on all tablespaces excluding the temporary tablespace (&lt;code&gt;TEMP&lt;/code&gt;) on a Oracle database.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;col quota format a10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;select username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;tablespace_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;decode(max_bytes, -1, &amp;#39;unlimited&amp;#39;, ceil(max_bytes / 1024 / 1024) || &amp;#39;M&amp;#39; ) &amp;#34;QUOTA&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;from dba_ts_quotas
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;here tablespace_name not in (&amp;#39;TEMP&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;USERNAME TABLESPACE_NAME QUOTA
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;-------------------- ---------------------------------------- ----------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;LARRY LARRY 50M
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;ODM_REPOSITORY ODM unlimited
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;PERFSTAT TOOLS 500M
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;CABBOY USERS unlimited
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;ORA_IT ORAIT unlimited
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;98 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Understanding Tablespace Usage in Oracle Database</title><link>https://www.oraclescripts.com/post/understanding-oracle-database-tablespace-usage/</link><pubDate>Tue, 13 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/understanding-oracle-database-tablespace-usage/</guid><description>
&lt;h2 id="description-of-oracle-database-sql-code-for-tablespace-usage"&gt;Description of Oracle Database SQL code for Tablespace Usage&lt;/h2&gt;
&lt;p&gt;This code provides a comprehensive overview of tablespace usage in your Oracle database. Here's a breakdown of its purpose, components, and key points:&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col tablespace_name format a40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;size MB&amp;#34; format 999,999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;free MB&amp;#34; format 99,999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;% Used&amp;#34; format 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;select tsu.tablespace_name, ceil(tsu.used_mb) &amp;#34;size MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, decode(ceil(tsf.free_mb), NULL,0,ceil(tsf.free_mb)) &amp;#34;free MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, decode(100 - ceil(tsf.free_mb/tsu.used_mb*100), NULL, 100,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; 100 - ceil(tsf.free_mb/tsu.used_mb*100)) &amp;#34;% used&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;from (select tablespace_name, sum(bytes)/1024/1024 used_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt; from dba_data_files group by tablespace_name union all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt; select tablespace_name || &amp;#39; **TEMP**&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt; , sum(bytes)/1024/1024 used_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt; from dba_temp_files group by tablespace_name) tsu
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;, (select tablespace_name, sum(bytes)/1024/1024 free_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; from dba_free_space group by tablespace_name) tsf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;where tsu.tablespace_name = tsf.tablespace_name (+)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;order by 4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;TABLESPACE_NAME size MB free MB % used
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;---------------------------------------- ------------ ----------- ------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;USERS_VIT 25 25 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;INDX 5 5 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;PERFSTAT 5 5 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;USERS 25 25 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;UNDOTBS2 2,000 1,886 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;APP_USER_DATA 10 10 6
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;ODM 10 10 6
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;TOOLS 600 509 15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;DRSYS 20 15 25
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;WEB_DATA 100 72 28
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;CAP_DATA 3,500 2,316 33
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;CAP_INDEXES 4,500 2,705 39
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;SYSAUX 350 132 62
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;XDB 60 13 79
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;SYSTEM 650 84 87
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;ANDY 10 2 88
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;TEMP **TEMP** 1,050 0 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;TEMP_VIT **TEMP** 25 0 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt;18 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Exploring Datafiles within Oracle Tablespaces</title><link>https://www.oraclescripts.com/post/show-all-datafiles-that-are-part-of-an-oracle-database-tablespace/</link><pubDate>Mon, 12 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-all-datafiles-that-are-part-of-an-oracle-database-tablespace/</guid><description>
&lt;h2 id="description-of-oracle-database-sql-code-for-showing-tablespace-files"&gt;Description of Oracle Database SQL code for Showing Tablespace Files&lt;/h2&gt;
&lt;p&gt;This code displays information about the datafiles composing a specific tablespace in your Oracle database. Here's a breakdown of its purpose, components, and key points:&lt;/p&gt;
&lt;p&gt;Show thea data files that comprise a tablespace
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;col file_name format a70
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;select file_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;, ceil(bytes / 1024 / 1024) &amp;#34;size MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;from dba_data_files
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;where tablespace_name like &amp;#39;&amp;amp;TSNAME&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set lines 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col file_name format a70
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;select file_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;, ceil(bytes / 1024 / 10SQL&amp;gt; SQL&amp;gt; 2 24) &amp;#34;size MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;from dba_data_files
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;where tablespace_name like &amp;#39;&amp;amp;TSNAME&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;/ 3 4 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;Enter value for tsname: SYSAUX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;old 4: where tablespace_name like &amp;#39;&amp;amp;TSNAME&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;new 4: where tablespace_name like &amp;#39;SYSAUX&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;FILE_NAME size MB
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;------------------------------------------------------- ----------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;/opt/oracle/oradata/FREE/sysaux01.dbf 730
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle crsctl query css votedisk Command Explained</title><link>https://www.oraclescripts.com/post/understand-crsctl-query-css-votedisk-oracle-clusterware/</link><pubDate>Sun, 11 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/understand-crsctl-query-css-votedisk-oracle-clusterware/</guid><description>
&lt;h2 id="understanding-crsctl-query-css-votedisk-command-in-oracle-clusterware"&gt;Understanding crsctl query css votedisk Command in Oracle Clusterware&lt;/h2&gt;
&lt;p&gt;This page explains the crsctl query css votedisk command, its purpose, breakdown, and key points, offering insights and explanations for Oracle Clusterware management.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-oracle-command"&gt;Sample Oracle Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;crsctl query css votedisk
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-oracle-database-sql-codecrsctl-query-css-votedisk"&gt;Description of Oracle Database SQL code:&lt;code&gt;crsctl query css votedisk&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;This code is not actually SQL syntax, but rather a command from the&lt;code&gt;crsctl&lt;/code&gt;utility used to manage Oracle Clusterware. However, it interacts with the cluster registry which relies on an underlying database, so I can still offer insights and explanations.&lt;/p&gt;</description></item><item><title>Oracle Clusterware ocrcheck: Verify OCR Health</title><link>https://www.oraclescripts.com/post/maintaining-cluster-health-with-ocrcheck-in-oracle-clusterware/</link><pubDate>Sat, 10 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/maintaining-cluster-health-with-ocrcheck-in-oracle-clusterware/</guid><description>
&lt;h2 id="overview-of-ocrcheck-command"&gt;Overview Of ocrcheck Command&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;ocrcheck&lt;/code&gt; command is a valuable tool for managing the Oracle Cluster Registry (OCR) within Oracle Clusterware&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;Retrive OCR (Oracle Cluster Registry) information&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;ocrcheck
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ocrcheck&lt;/code&gt; is a command-line utility used to verify the health and consistency of the Oracle Cluster Registry (OCR). This registry stores crucial configuration information for all resources managed by Oracle Clusterware, including cluster membership, voting disks, and resources like databases and applications.&lt;/p&gt;</description></item><item><title>Oracle srvctl disable database: Prevent Auto Startup</title><link>https://www.oraclescripts.com/post/halt-automated-startups-managing-databases-with-srvctl-disable-database/</link><pubDate>Fri, 09 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/halt-automated-startups-managing-databases-with-srvctl-disable-database/</guid><description>
&lt;h2 id="preventing-a-database-startup-at-boot-time-srvctl-disable-database"&gt;Preventing a Database Startup at Boot Time: &lt;code&gt;srvctl disable database&lt;/code&gt;&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;This command, commonly used in Oracle environments, instructs Oracle Clusterware to prevent a specific database from automatically starting when the operating system boots. Understanding its purpose, breakdown, and key points can help you manage your database effectively.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl disable database -d &amp;lt;database name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="preventing-a-database-startup-at-boot-time-srvctl-disable-database-1"&gt;Preventing a Database Startup at Boot Time: &lt;code&gt;srvctl disable database&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;This command, commonly used in Oracle environments, instructs Oracle Clusterware to prevent a specific database from automatically starting when the operating system boots. Understanding its purpose, breakdown, and key points can help you manage your database effectively.&lt;/p&gt;</description></item><item><title>Oracle oifcfg getif: Identify Cluster Interconnect Subnet</title><link>https://www.oraclescripts.com/post/clarify-oifcfg-getif-identifying-your-oracle-cluster-interconnect-subnet/</link><pubDate>Thu, 08 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/clarify-oifcfg-getif-identifying-your-oracle-cluster-interconnect-subnet/</guid><description>
&lt;h2 id="understanding-oifcfg-getif-for-oracle-cluster-interconnect-subnet-change"&gt;Understanding oifcfg getif for Oracle Cluster Interconnect Subnet Change&lt;/h2&gt;
&lt;p&gt;The Oracle Clustware command &lt;code&gt;oifcfg getif&lt;/code&gt; is a crucial utility for managing Oracle Clusterware and its private interconnect subnet. Below is breakdown of its purpose, usage, and key points:&lt;/p&gt;
&lt;p&gt;Change the private interconnect subnet. First find the interface which is in use as the interconnect - run as root from the crs home&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;oifcfg getif
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Clusterware: Modify Interconnect Subnet with oifcfg</title><link>https://www.oraclescripts.com/post/modify-oracle-cluster-interconnect-subnet-with-oifcfg-commands/</link><pubDate>Wed, 07 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/modify-oracle-cluster-interconnect-subnet-with-oifcfg-commands/</guid><description>
&lt;h2 id="understanding-oifcfg-for-changing-oracle-cluster-interconnect-subnet"&gt;Understanding &lt;code&gt;oifcfg&lt;/code&gt; for Changing Oracle Cluster Interconnect Subnet&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;oifcfg&lt;/code&gt; Oracle Clusterware commands presented involve modifying the Oracle Clusterware private interconnect subnet.What follows is a breakdown of their purpose, usage, and key points:&lt;/p&gt;
&lt;p&gt;Make a note of the interface name (eth1 in the following example), then aun the following:&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;oifcfg delif -global eth1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;oifcfg setif -global eth1/&amp;lt;your new subnet&amp;gt;:cluster_interconnect
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="command-overview"&gt;Command Overview&lt;/h2&gt;
&lt;p&gt;While not directly an Oracle Database SQL command, the &lt;code&gt;oifcfg&lt;/code&gt; commands presented involve modifying the Oracle Clusterware private interconnect subnet. Here's a breakdown of their purpose, usage, and key points:&lt;/p&gt;</description></item><item><title>Oracle Tablespaces Needing More Space: SQL Script</title><link>https://www.oraclescripts.com/post/identifying-oracle-database-tablespaces-that-need-more-space/</link><pubDate>Tue, 06 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identifying-oracle-database-tablespaces-that-need-more-space/</guid><description>
&lt;h2 id="description-of-oracle-database-sql-code-for-identifying-tablespaces-needing-space"&gt;Description of Oracle Database SQL code for Identifying Tablespaces Needing Space&lt;/h2&gt;
&lt;p&gt;This code helps identify tablespaces requiring additional space to maintain an 80% utilization threshold in your Oracle database. Below is a breakdown of its purpose, components, and key points:
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set pages 999 lines 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Tablespace&amp;#34; for a50
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Size MB&amp;#34; for 999999999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;%Used&amp;#34; for 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Add (80%)&amp;#34; for 999999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;select tsu.tablespace_name &amp;#34;Tablespace&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, ceil(tsu.used_mb) &amp;#34;Size MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, 100 - floor(tsf.free_mb/tsu.used_mb*100) &amp;#34;%Used&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;, ceil((tsu.used_mb - tsf.free_mb) / .8) - tsu.used_mb &amp;#34;Add (80%)&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;from (select tablespace_name, sum(bytes)/1024/1024 used_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt; from dba_data_files group by tablespace_name) tsu
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;, (select ts.tablespace_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt; , nvl(sum(bytes)/1024/1024, 0) free_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt; from dba_tablespaces ts, dba_free_space fs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt; where ts.tablespace_name = fs.tablespace_name (+)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; group by ts.tablespace_name) tsf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;where tsu.tablespace_name = tsf.tablespace_name (+)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;and 100 - floor(tsf.free_mb/tsu.used_mb*100) &amp;gt;= 80
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;order by 3,4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt; set pages 999 lines 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Tablespace&amp;#34; for a50
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Size MB&amp;#34; for 999999999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;%Used&amp;#34; fSQL&amp;gt; SQL&amp;gt; SQL&amp;gt; or 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Add (80%)&amp;#34; for 999999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;select tsu.tablespace_name &amp;#34;Tablespace&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, ceil(tsu.used_mb) &amp;#34;Size MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, 100 - floor(tsf.free_mb/tsu.used_mb*100) &amp;#34;%Used&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;, ceil((tsu.used_mb - tsf.free_mb) / .8) - tsu.used_mb &amp;#34;Add (80%)&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;from (select tablespace_name, sum(bytes)/1024/1024 used_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt; from dba_data_files group by tablespace_name) tsu
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;, (select ts.tablespace_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt; , nvl(sum(bytes)/1024/1024, 0) free_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt; from dba_tablespaces ts, dba_free_space fs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt; where ts.tablespace_name = fs.SQL&amp;gt; SQL&amp;gt; 2 3 4 5 6 7 8 9 10 tablespace_name (+)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; group by ts.tablespace_name) tsf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;where tsu.tablespace 11 12 _name = tsf.tablespace_name (+)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;and 100 - floor(tsf.free_mb/tsu.used_mb*100) &amp;gt;= 80
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;order by 3,4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt; 13 14 15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt;Tablespace Size MB %Used Add (80%)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt;-------------------------------------------------- ---------- ----- ---------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;24&lt;/span&gt;&lt;span class="cl"&gt;SYSAUX 730 95 130
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;25&lt;/span&gt;&lt;span class="cl"&gt;SYSTEM 1070 100 260
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;26&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;27&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Listing Objects in an Oracle Tablespace</title><link>https://www.oraclescripts.com/post/list-all-objects-in-the-oracle-tablespace/</link><pubDate>Mon, 05 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/list-all-objects-in-the-oracle-tablespace/</guid><description>
&lt;h2 id="sql-lists-all-objects-within-a-specific-tablespace-in-an-oracle-database"&gt;SQL lists all objects within a specific tablespace in an Oracle database&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;A detailed explanation of Oracle Database SQL code used to list objects within a tablespace, including purpose, breakdown, key points, and insights.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col owner format a15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col segment_name format a40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col segment_type format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;select owner
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, segment_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, segment_type
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;from dba_segments
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;where lower(tablespace_name) like lower(&amp;#39;%&amp;amp;tablespace%&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;order by owner, segment_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;OWNER SEGMENT_NAME SEGMENT_TYPE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;--------------- ---------------------------------------- --------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;LARRY BIN$Q+k4qsgBLNngRAAQg5ZRWg==$0 INDEX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;LARRY BIN$Q+k4qsgCLNngRAAQg5ZRWg==$0 TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;LARRY BIN$Q+k4qsgELNngRAAQg5ZRWg==$0 INDEX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;LARRY BIN$Q+k4qsgFLNngRAAQg5ZRWg==$0 TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;LARRY BOX TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;LARRY BOX_PK INDEX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;LARRY CD TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;LARRY CD_PK INDEX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;LARRY LOCATION TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;LARRY LOCATION_PK INDEX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;LARRY LOTS_OF_ROWS TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;LARRY POO TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;LARRY SERVERS TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;LARRY SYS_C0023466 INDEX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;LARRY SYS_C0023467 INDEX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;LARRY SYS_C0027234 INDEX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;LARRY TEST_TABLE TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;LARRY TRACK TABLE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt;LARRY TRACK_PK INDEX
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt;19 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Identifying User Tablespaces and Space Usage in Oracle</title><link>https://www.oraclescripts.com/post/query-oracle-tablespace-usage-by-user/</link><pubDate>Sun, 04 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/query-oracle-tablespace-usage-by-user/</guid><description>
&lt;h2 id="query-to-display-all-tablespaces-used-by-a-specified-user-and-the-total-space-occupied-rounded-to-mb"&gt;Query to Display All Tablespaces Used by A Specified User and The Total Space Occupied (rounded to MB)&lt;/h2&gt;
&lt;hr&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select tablespace_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;, ceil(sum(bytes) / 1024 / 1024) &amp;#34;MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;from dba_extents
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;where owner like &amp;#39;&amp;amp;user_id&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;group by tablespace_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;order by tablespace_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;TABLESPACE_NAME MB
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;---------------------------------------- ----------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;LARRY_DATA 9
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;LARRY_INDEX 15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;2 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To identify and report the tablespaces where a user owns objects and the approximate amount of storage they consume.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Setting a Default Temporary Tablespace in Oracle Database</title><link>https://www.oraclescripts.com/post/setting-the-oracle-database-default-temp-tablespace/</link><pubDate>Sat, 03 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/setting-the-oracle-database-default-temp-tablespace/</guid><description>
&lt;h2 id="alters-the-default-temporary-tablespace-for-the-entire-database-to-temp"&gt;Alters The Default Temporary Tablespace for the Entire Database to &amp;quot;temp&amp;quot;&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter database default temporary tablespace temp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To specify the preferred location where temporary data should be stored for all user sessions within the database. This provides centralized management and potentially performance benefits by consolidating temporary data storage.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;alter database&lt;/code&gt;&lt;/strong&gt;: Initiates the modification of database-level settings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;default temporary tablespace temp&lt;/code&gt;&lt;/strong&gt;: Sets the new default temporary tablespace name to &amp;quot;temp.&amp;quot;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Segments Nearing Max Extents via dba_segments</title><link>https://www.oraclescripts.com/post/query-segments-nearing-maximum-extents-in-oracle-database/</link><pubDate>Fri, 02 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/query-segments-nearing-maximum-extents-in-oracle-database/</guid><description>
&lt;h2 id="identify-oracle-database-segments-nearing-their-maximum-extent-limit"&gt;Identify Oracle Database Segments Nearing Their Maximum Extent Limit&lt;/h2&gt;
&lt;p&gt;This guide explains an Oracle Database SQL code snippet that identifies segments approaching their maximum extent limit, its purpose, key points, and insights
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;col segment_name format a40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;select owner
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;, segment_type
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;, segment_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;, max_extents - extents as &amp;#34;spare&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, max_extents
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;from dba_segments
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;where owner not in (&amp;#39;SYS&amp;#39;,&amp;#39;SYSTEM&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;and (max_extents - extents) &amp;lt; 10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;order by 4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Adjusting Segment Growth with MAXEXTENTS in Oracle Database</title><link>https://www.oraclescripts.com/post/adjust-segment-growth-using-maxextents-in-oracle-database/</link><pubDate>Thu, 01 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/adjust-segment-growth-using-maxextents-in-oracle-database/</guid><description>
&lt;h2 id="alters-the-maxextents-parameter-for-a-specific-database-segment"&gt;Alters The MAXEXTENTS Parameter For A Specific Database Segment&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter &amp;lt;segment_type&amp;gt; &amp;lt;segment_name&amp;gt; storage(maxextents 150);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To define the maximum number of extents the segment can occupy, controlling its potential growth and space allocation behavior.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;alter &amp;lt;segment_type&amp;gt; &amp;lt;segment_name&amp;gt;&lt;/code&gt;&lt;/strong&gt;: This clause initiates the alteration process, specifying the type (e.g.,&lt;code&gt;TABLE&lt;/code&gt;,&lt;code&gt;INDEX&lt;/code&gt;) and name of the segment.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;storage(maxextents 150)&lt;/code&gt;&lt;/strong&gt;: This subclause defines the new &lt;code&gt;maxextents&lt;/code&gt; value to 150. You can replace this with your desired number of extents.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Monitoring Temporary Tablespace Usage in Oracle Database</title><link>https://www.oraclescripts.com/post/monitor-contents-of-temporary-tablespace-oracle-database-usage/</link><pubDate>Wed, 31 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/monitor-contents-of-temporary-tablespace-oracle-database-usage/</guid><description>
&lt;h2 id="lists-the-contents-of-the-temporary-tablespaces-including-details-about-each-temporary-object-and-its-associated-session"&gt;Lists the Contents of the Temporary Tablespace(s), Including Details About Each Temporary Object and Its Associated Session&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sample-sql-command"&gt;Sample SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set pages 999 lines 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col username format a15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col mb format 999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;select su.username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;, ses.sid
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, ses.serial#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, su.tablespace
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, ceil((su.blocks * dt.block_size) / 1048576) MB
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;from v$sort_usage su
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;, dba_tablespaces dt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;, v$session ses
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;where su.tablespace = dt.tablespace_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;and su.session_addr = ses.saddr
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;USERNAME SID SERIAL# TABLESPACE MB
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;--------------- ---------- ---------- ------------------------------- --------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;REP_USER 117 1243 TEMP 25
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;APP_DATA_OWNER 81 32 TEMP 231
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;2 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Clusterware: Modify VIP Address and Network Interface</title><link>https://www.oraclescripts.com/post/modify-oracle-clusterware-css-vip-address-subnet-mask-interface/</link><pubDate>Sun, 28 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/modify-oracle-clusterware-css-vip-address-subnet-mask-interface/</guid><description>
&lt;h2 id="modifying-vip-address-subnet-mask-or-interface-in-oracle-clusterware"&gt;Modifying VIP Address, Subnet Mask, or Interface in Oracle Clusterware&lt;/h2&gt;
&lt;p&gt;Learn how to change the Virtual IP (VIP) address, subnet mask, or network interface for clustered nodes in an Oracle environment. This step-by-step guide includes commands, explanations, and key points to ensure a smooth and successful configuration update.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="change-the-vip-address-subnetmask-or-interface"&gt;Change the VIP address, subnetmask or interface&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl stop nodeapps -n &amp;lt;node1&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;srvctl stop nodeapps -n &amp;lt;node2&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;srvctl modify nodeapps -n &amp;lt;node1&amp;gt; -A &amp;lt;ip_address&amp;gt;/&amp;lt;net mask&amp;gt;/&amp;lt;interface&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;srvctl modify nodeapps -n &amp;lt;node2&amp;gt; -A &amp;lt;ip_address&amp;gt;/&amp;lt;net mask&amp;gt;/&amp;lt;interface&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;srvctl start nodeapps -n &amp;lt;node1&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;srvctl start nodeapps -n &amp;lt;node2&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-the-oracle-database-sql-code"&gt;Description of the Oracle Database SQL code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle srvctl config nodeapps Command in Clusterware</title><link>https://www.oraclescripts.com/post/understand-vip-using-srvctl-to-config-nodeapps-in-oracle-clusterware/</link><pubDate>Sat, 27 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/understand-vip-using-srvctl-to-config-nodeapps-in-oracle-clusterware/</guid><description>
&lt;h2 id="understanding-the-srvctl-config-nodeapps-command-in-oracle-clusterware"&gt;Understanding the srvctl config nodeapps Command in Oracle Clusterware&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="check-the-vip-config"&gt;Check the VIP config&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl config nodeapps -n &amp;lt;node&amp;gt; -a -g -s -l
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-the-oracle-database-sql-code"&gt;Description of the Oracle Database SQL code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;srvctl config nodeapps -n &amp;lt;node&amp;gt; -a -g -s -l&lt;/code&gt; command is not directly related to Oracle Database SQL but rather serves as a crucial tool in Oracle Clusterware environments to effectively manage node applications and their associated Virtual IPs (VIPs). It retrieves detailed information about node applications on a specific node, including attributes, groups, startup mode, and network listeners, enabling you to:&lt;/p&gt;</description></item><item><title>Starting and Stopping Oracle Database Instances with SRVCTL</title><link>https://www.oraclescripts.com/post/start-stop-oracle-database-instances-with-srvctl/</link><pubDate>Fri, 26 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/start-stop-oracle-database-instances-with-srvctl/</guid><description>
&lt;h2 id="start-and-stops-a-specific-oracle-database-instance-with-the-server-control-utility-srvctl"&gt;Start and stops a specific Oracle Database instance with the Server Control Utility (SRVCTL)&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;h3 id="start-database-specific-node-or-instance"&gt;Start Database (Specific Node or Instance)&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl start instance -d &amp;lt;database name&amp;gt; -i &amp;lt;instance name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="stop-database--specific-node-or-instance"&gt;Stop Database (Specific Node or Instance)&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl stop instance -d &amp;lt;database name&amp;gt; -i &amp;lt;instance name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-the-oracle-database-sql-code"&gt;Description of the Oracle Database SQL code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle srvctl Start and Stop Database in Clusterware</title><link>https://www.oraclescripts.com/post/starting-and-stopping-databases-with-srvctl-in-oracle-clusterware/</link><pubDate>Thu, 25 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/starting-and-stopping-databases-with-srvctl-in-oracle-clusterware/</guid><description>
&lt;h2 id="demystifying-database-startstop-in-oracle-clusterware-with-srvctl"&gt;Demystifying Database Start/Stop in Oracle Clusterware with srvctl&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;h3 id="start-database-all-nodes"&gt;Start Database (All Nodes)&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl start database -d &amp;lt;database name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="stop-database-all-nodes"&gt;Stop Database (All Nodes)&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl stop database -d &amp;lt;database name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="demystifying-database-startstop-in-oracle-clusterware-with-srvctl-1"&gt;Demystifying Database Start/Stop in Oracle Clusterware with srvctl&lt;/h2&gt;
&lt;p&gt;These commands, &lt;code&gt;srvctl start database&lt;/code&gt; and &lt;code&gt;srvctl stop database&lt;/code&gt;, empower you to control the state of entire databases within your Oracle Clusterware environment. Let's delve into their purpose, breakdown, and key points:&lt;/p&gt;</description></item><item><title>Oracle Clusterware: srvctl start asm and srvctl stop asm</title><link>https://www.oraclescripts.com/post/managing-asm-instance-in-oracle-clusterware-srvctl-start-asm-and-srvctl-stop-asm/</link><pubDate>Mon, 22 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/managing-asm-instance-in-oracle-clusterware-srvctl-start-asm-and-srvctl-stop-asm/</guid><description>
&lt;h2 id="demystifying-startstop-asm-with-srvctl-in-oracle-database"&gt;Demystifying Start/Stop ASM with srvctl in Oracle Database&lt;/h2&gt;
&lt;p&gt;These commands, specifically &lt;code&gt;srvctl start asm&lt;/code&gt; and &lt;code&gt;srvctl stop asm&lt;/code&gt;, play a crucial role in managing the Oracle Automatic Storage Management (ASM) instance within your Oracle Clusterware environment. Let's dive into their purpose, breakdown, and key points.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;h3 id="start-asm"&gt;Start ASM&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl start asm -n &amp;lt;node name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="stop-asm"&gt;Stop ASM&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl stop asm -n &amp;lt;node name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-the-oracle-database-sql-code"&gt;Description of the Oracle Database SQL code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Clusterware: Manage Node Apps with srvctl</title><link>https://www.oraclescripts.com/post/controlling-node-level-applications-in-oracle-clusterware-with-srvctl/</link><pubDate>Fri, 19 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/controlling-node-level-applications-in-oracle-clusterware-with-srvctl/</guid><description>
&lt;h2 id="controlling-node-level-applications-in-oracle-clusterware-with-srvctl"&gt;Controlling Node Level Applications in Oracle Clusterware with srvctl&lt;/h2&gt;
&lt;p&gt;Master the srvctl start nodeapps and srvctl stop nodeapps commands to effectively manage node-level applications within your Oracle Clusterware environment. Gain insights into their purpose, breakdown, key points, and practical considerations
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;h3 id="start-nodeapps"&gt;Start Nodeapps&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl start nodeapps -n &amp;lt;node name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="stop-nodeapps"&gt;Stop Nodeapps&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;srvctl stop nodeapps -n &amp;lt;node name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-the-oracle-commands"&gt;Description of the Oracle Commands&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Managing Oracle Clusterware CRS</title><link>https://www.oraclescripts.com/post/oracle-rac-start-stop-cluster-ready-services-css/</link><pubDate>Tue, 16 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rac-start-stop-cluster-ready-services-css/</guid><description>
&lt;h1 id="essential-commands-for-starting-stopping-checking-and-monitoring-crs-services"&gt;Essential commands for starting, stopping, checking, and monitoring CRS services&lt;/h1&gt;
&lt;h2 id="note-startstop-need-to-be-run-as-root-from-the-crs-home"&gt;Note: Start/stop need to be run as root from the CRS home&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;h2 id="start-crs"&gt;Start CRS&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;1crsctl start crs
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="stop-crs"&gt;Stop CRS&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;1crsctl stop crs
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="check-crss-status"&gt;Check CRS's status&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;1crsctl check crs
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="see-the-status-of-the-various-services"&gt;See the status of the various services&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;1crs_stat -t
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;1
2no rows selected
3SQL&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="description-of-the-oracle-database-sql-code"&gt;Description of the Oracle Database SQL code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Checking All Disks in Diskgroup Data</title><link>https://www.oraclescripts.com/post/check-the-asm-diskgroup-internal-consistency/</link><pubDate>Mon, 15 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/check-the-asm-diskgroup-internal-consistency/</guid><description>
&lt;h2 id="this-sql-code-instructs-oracle-to-perform-a-thorough-check-of-all-disks-within-the-diskgroup-named-data1"&gt;This SQL code instructs Oracle to perform a thorough check of all disks within the diskgroup named data1&lt;/h2&gt;
&lt;p&gt;Check the internal consistency of a diskgroup
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter diskgroup data1 check all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-the-oracle-database-sql-code"&gt;Description of the Oracle Database SQL code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To initiate a comprehensive check of all disks within the diskgroup named &lt;code&gt;data1&lt;/code&gt; in an Oracle Database environment.&lt;/li&gt;
&lt;li&gt;To proactively identify and address potential disk-related issues that could impact data integrity and availability.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle ASM Disk Balancing: Monitor with v$asm_operation</title><link>https://www.oraclescripts.com/post/identify-if-asm-is-performing-disk-balancing-operation/</link><pubDate>Sun, 14 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identify-if-asm-is-performing-disk-balancing-operation/</guid><description>
&lt;h2 id="monitoring-asm-operations-in-oracle-database-using-thevasm_operationview"&gt;Monitoring ASM Operations in Oracle Database, Using the&lt;code&gt;v$asm_operation&lt;/code&gt;View&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from v$asm_operation
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="mountdismount-disk-groups"&gt;Mount/dismount disk groups&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter diskgroup all mount
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter diskgroup data1 mount
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter diskgroup all dismount
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter diskgroup data1 dismount
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-the-oracle-database-sql-code"&gt;Description of the Oracle Database SQL code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Here's a description of the Oracle Database SQL code related to ASM operations and diskgroup management:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle ASM: Drop a Disk Group with DROP DISKGROUP</title><link>https://www.oraclescripts.com/post/drop-asm-diskgroup/</link><pubDate>Fri, 12 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/drop-asm-diskgroup/</guid><description>
&lt;h2 id="removing-a-disk-group-permanently-in-oracle-database-the-drop-diskgroup-command"&gt;Removing a Disk Group Permanently in Oracle Database, The &lt;code&gt;drop diskgroup&lt;/code&gt; Command&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;drop diskgroup &amp;#39;&amp;lt;name&amp;gt;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-the-oracle-database-sql-code"&gt;Description of the Oracle Database SQL code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The primary purpose of this SQL code is to permanently remove an entire disk group, identified by its name, from the Oracle database environment.&lt;/li&gt;
&lt;li&gt;This action effectively eliminates the disk group and all associated data, freeing up the underlying physical storage resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle ASM: Add a Disk to an Existing Disk Group</title><link>https://www.oraclescripts.com/post/add-a-disk-to-asm-diskgroup/</link><pubDate>Wed, 10 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/add-a-disk-to-asm-diskgroup/</guid><description>
&lt;h2 id="expanding-storage-capacity-in-oracle-database-adding-a-disk-to-diskgroup-data1"&gt;Expanding Storage Capacity in Oracle Database, Adding a Disk to Diskgroup Data1&lt;/h2&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;p&gt;&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
Note: Wildcards can be used for raw device names (eg. raw*&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter diskgroup data1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;add disk &amp;#39;/dev/raw/raw4&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="description-of-the-oracle-database-sql-code"&gt;Description of the Oracle Database SQL code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The primary purpose of this SQL code is to expand the storage capacity of an existing disk group named &amp;quot;data1&amp;quot; within an Oracle database environment.&lt;/li&gt;
&lt;li&gt;It achieves this by adding a new physical disk, identified as '/dev/raw/raw4', to the existing disk group.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle ASM: Create a Disk Group with External Redundancy</title><link>https://www.oraclescripts.com/post/create-an-asm-disk-group/</link><pubDate>Mon, 08 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/create-an-asm-disk-group/</guid><description>
&lt;h2 id="creating-an-asm-disk-group-with-external-redundancy-in-oracle"&gt;Creating an ASM Disk Group with External Redundancy in Oracle&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;create diskgroup data1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;external redundancy
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;disk &amp;#39;/dev/raw/raw1&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Or with multiple raw partitions&lt;/p&gt;
&lt;h2 id="sql-code-1"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;create diskgroup data1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;external redundancy
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;disk &amp;#39;/dev/raw/raw1&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Or with multiple fail groups...&lt;/p&gt;
&lt;h2 id="sql-code-2"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;create diskgroup data3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;normal redundancy
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;failgroup controller1 disk &amp;#39;/dev/raw/raw4&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;failgroup controller2 disk &amp;#39;/dev/raw/raw6&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Querying ASM Disk Information in Oracle</title><link>https://www.oraclescripts.com/post/show-asm-disk-space-usage/</link><pubDate>Sun, 07 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-asm-disk-space-usage/</guid><description>
&lt;h2 id="querying-asm-disk-information-in-oracle"&gt;Querying ASM Disk Information in Oracle&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;, group_number
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;, disk_number
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;, total_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;, free_mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;from v$asm_disk
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;order by group_number
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;8&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Retrieves and displays key information about Automatic Storage Management (ASM) disks within the database.&lt;/li&gt;
&lt;li&gt;Provides insights into disk configuration, capacity, and available space.&lt;/li&gt;
&lt;li&gt;Facilitates storage management, monitoring, and capacity planning.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Visualizing Disk Groups in Oracle ASM with SQL</title><link>https://www.oraclescripts.com/post/display-all-oracle-asm-disk-groups/</link><pubDate>Sat, 06 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/display-all-oracle-asm-disk-groups/</guid><description>
&lt;h2 id="visualizing-disk-groups-in-oracle-asm-with-sql"&gt;Visualizing Disk Groups in Oracle ASM with SQL&lt;/h2&gt;
&lt;p&gt;Note: A group number of zero his indicates that a disk is available but hasn't yet been assigned to a disk group.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set lines 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col name format a10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col path format a30
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;select name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;, group_number
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, disk_number
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, mount_status
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, state
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;, path
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;from v$asm_disk
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;order by group_number
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Checking Cluster Health with crsctl check cssd</title><link>https://www.oraclescripts.com/post/oracle-rac-check-if-css-running-working/</link><pubDate>Fri, 05 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-rac-check-if-css-running-working/</guid><description>
&lt;h2 id="checking-cluster-health-with-crsctl-check-cssd"&gt;Checking Cluster Health with crsctl check cssd&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-command"&gt;SQL Command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;crsctl check cssd
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To verify the status and health of the Cluster Synchronization Services (CSS) daemon (cssd), a crucial component of Oracle Clusterware.&lt;/li&gt;
&lt;li&gt;It's typically used in Oracle Real Application Clusters (RAC) and Oracle Automatic Storage Management (ASM) environments to ensure cluster integrity and coordination.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;crsctl&lt;/code&gt;: The command-line utility for managing Oracle Clusterware resources.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;check&lt;/code&gt;: Initiates a health check on a specific resource.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cssd&lt;/code&gt;: The target resource, the Cluster Synchronization Services daemon.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>dba_role_privs: List Oracle Roles Granted to a User</title><link>https://www.oraclescripts.com/post/show-oracle-roles-that-are-granted-to-a-user/</link><pubDate>Thu, 04 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-oracle-roles-that-are-granted-to-a-user/</guid><description>
&lt;h2 id="retrieving-user-role-privileges-in-oracle-using-the-view-dba_role_privs"&gt;Retrieving User Role Privileges in Oracle using the view dba_role_privs&lt;/h2&gt;
&lt;p&gt;This page examines an Oracle SQL code snippet that fetches granted roles and their associated admin options for a specified user.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select grantee
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;, granted_role
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;, admin_option
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;from dba_role_privs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;where grantee like upper(&amp;#39;&amp;amp;username&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This code retrieves the roles granted to a specific user, indicating whether each role has the admin option enabled. This information is crucial for understanding user privileges and authorizations within the database.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>dba_roles PASSWORD_REQUIRED: Query Oracle Role Definitions</title><link>https://www.oraclescripts.com/post/sql-query-to-find-oracle-dba-role/</link><pubDate>Thu, 04 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/sql-query-to-find-oracle-dba-role/</guid><description>
&lt;h2 id="find-an-oracle-role-using-the-view-dba_roles"&gt;Find an Oracle role using the view dba_roles&lt;/h2&gt;
&lt;p&gt;This page explores an Oracle SQL code snippet that retrieves information about database roles based on user-provided search criteria.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from dba_roles
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;where role like &amp;#39;&amp;amp;role&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This code retrieves information about a specific database role, based on a partial or complete role name provided by the user.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Table Privileges Granted to a Role via role_tab_privs</title><link>https://www.oraclescripts.com/post/sql-query-that-shows-table-privileges-that-are-granted-to-a-role/</link><pubDate>Thu, 04 Jan 2024 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/sql-query-that-shows-table-privileges-that-are-granted-to-a-role/</guid><description>
&lt;h2 id="oracle-table-privileges-granted-to-a-role-via-role_tab_privs"&gt;Oracle Table Privileges Granted to a Role via role_tab_privs&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;ROLE_TAB_PRIVS&lt;/code&gt; holds the complete inventory of object privileges Oracle has packaged into each named role — every table, view, and sequence grant, the precise privilege type, whether the right covers the entire object or is scoped to a single column, and whether the role can pass the grant further down the privilege chain. It is the correct starting point when you need to answer the question that surfaces in every access review: what table-level access does this role actually allow?&lt;/p&gt;</description></item><item><title>Assessing Database Storage Utilization in Oracle Database</title><link>https://www.oraclescripts.com/post/how-large-is-the-oracle-database/</link><pubDate>Sun, 31 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/how-large-is-the-oracle-database/</guid><description>
&lt;h2 id="how-large-is-the-oracle-database"&gt;How large is the Oracle Database?&lt;/h2&gt;
&lt;p&gt;Gain a comprehensive overview of database size, free space, and used space to proactively manage storage resources and plan for future growth.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Database Size&amp;#34; format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Free space&amp;#34; format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Used space&amp;#34; format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;select round(sum(used.bytes) / 1024 / 1024 / 1024 ) || &amp;#39; GB&amp;#39; &amp;#34;Database Size&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt; ,round(sum(used.bytes) / 1024 / 1024 / 1024 ) -
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt; round(free.p / 1024 / 1024 / 1024) || &amp;#39; GB&amp;#39; &amp;#34;Used space&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt; ,round(free.p / 1024 / 1024 / 1024) || &amp;#39; GB&amp;#39; &amp;#34;Free space&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;from (select bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; from v$datafile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt; union all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt; select bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt; from v$tempfile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt; union all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt; select bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt; from v$log) used
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; ,(select sum(bytes) as p
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt; from dba_free_space) free
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;group by free.p
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;1 col &amp;#34;Database Size&amp;#34; format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;2 col &amp;#34;Free space&amp;#34; format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;3 col &amp;#34;Used space&amp;#34; format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;4select round(sum(used.bytes) / 1024 / 1024 / 1024 ) || &amp;#39; GB&amp;#39; &amp;#34;Database Size&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;5 , round(sum(used.bytes) / 1024 / 1024 / 1024 ) -
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;6 round(free.p / 1024 / 1024 / 1024) || &amp;#39; GB&amp;#39; &amp;#34;Used space&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;7 , round(free.p / 1024 / 1024 / 1024) || &amp;#39; GB&amp;#39; &amp;#34;Free space&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;8 from (select bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;9 from v$datafile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;10 union all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;11 select bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;12 from v$tempfile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;13 union all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;14 select bytes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;15 from v$log) used
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;16, (select sum(bytes) as p
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;17 from dba_free_space) free
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;18 group by free.p
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt;Database Size Used space Free space
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt;-------------------- -------------------- --------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt;564 GB 493 GB 71 GB
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;24&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;25&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>How to Block a User in Oracle Database (ACCOUNT LOCK)</title><link>https://www.oraclescripts.com/post/lock-or-unlock-oracle-user/</link><pubDate>Sun, 31 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/lock-or-unlock-oracle-user/</guid><description>
&lt;h2 id="lock-or-unlock-an-oracle-user-in-the-database"&gt;Lock or Unlock an Oracle User in the Database&lt;/h2&gt;
&lt;p&gt;A brief guide on locking user accounts using the &lt;code&gt;alter user &amp;lt;username&amp;gt; account lock;&lt;/code&gt; command, including its purpose, key points, and best practices.&lt;/p&gt;
&lt;h2 id="lock-user"&gt;Lock User&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h3 id="sql-code"&gt;SQL Code&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-SQL" data-lang="SQL"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;alter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="unlock-user"&gt;Unlock User&lt;/h2&gt;
&lt;h3 id="sql-code-1"&gt;SQL Code&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-SQL" data-lang="SQL"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;alter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;unlock&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To lock a specific user account in the Oracle database, preventing any further login attempts using that account.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Active SQL: Monitor Sessions with v$session</title><link>https://www.oraclescripts.com/post/oracle-query-all-active-sql/</link><pubDate>Sun, 31 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-query-all-active-sql/</guid><description>
&lt;h2 id="show-all-active-sql-for-sessions-using-vsession-and-vsqlarea"&gt;Show all Active SQL for Sessions using v$session and v$sqlarea&lt;/h2&gt;
&lt;p&gt;Gain real-time insights into currently active user sessions and the SQL statements they are executing to troubleshoot performance issues and optimize resources
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set feedback off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;set serveroutput on size 9999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;column username format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;column sql_text format a55 word_wrapped
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;begin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt; for x in
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt; (select username||&amp;#39;(&amp;#39;||sid||&amp;#39;,&amp;#39;||serial#||&amp;#39;) ospid = &amp;#39;|| process ||
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt; &amp;#39; program = &amp;#39; || program username,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; to_char(LOGON_TIME,&amp;#39; Day HH24:MI&amp;#39;) logon_time,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt; to_char(sysdate,&amp;#39; Day HH24:MI&amp;#39;) current_time,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt; sql_address,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt; sql_hash_value
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt; from v$session
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt; where status = &amp;#39;ACTIVE&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt; and rawtohex(sql_address) &amp;lt;&amp;gt; &amp;#39;00&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; and username is not null ) loop
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt; for y in (select sql_text
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt; from v$sqlarea
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt; where address = x.sql_address ) loop
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt; if ( y.sql_text not like &amp;#39;%listener.get_cmd%&amp;#39; and
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt; y.sql_text not like &amp;#39;%RAWTOHEX(SQL_ADDRESS)%&amp;#39; ) then
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt; dbms_output.put_line( &amp;#39;--------------------&amp;#39; );
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt; dbms_output.put_line( x.username );
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;24&lt;/span&gt;&lt;span class="cl"&gt; dbms_output.put_line( x.logon_time || &amp;#39; &amp;#39; || x.current_time || &amp;#39; SQL#=&amp;#39; || x.sql_hash_value);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;25&lt;/span&gt;&lt;span class="cl"&gt; dbms_output.put_line( substr( y.sql_text, 1, 250 ) );
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;26&lt;/span&gt;&lt;span class="cl"&gt; end if;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;27&lt;/span&gt;&lt;span class="cl"&gt; end loop;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;28&lt;/span&gt;&lt;span class="cl"&gt; end loop;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;29&lt;/span&gt;&lt;span class="cl"&gt;end;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle dba_users: List All User Account Information</title><link>https://www.oraclescripts.com/post/list-oracle-users/</link><pubDate>Sun, 31 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/list-oracle-users/</guid><description>
&lt;h2 id="list-all-the-oracle-users-account-information-for-the-oracle-database-using-dba_users"&gt;List all the Oracle Users Account Information for the Oracle Database using dba_users&lt;/h2&gt;
&lt;p&gt;A detailed overview of user accounts in the Oracle database, including their status, creation date, tablespaces, and more
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set pages 999 lines 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col username format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col status format a8
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col tablespace format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;col temp_ts format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;select username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, account_status status
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, created
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;, default_tablespace tablespace
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;, temporary_tablespace temp_ts
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;from dba_users
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;order by username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Tracking Completed Long Operations in Oracle Database</title><link>https://www.oraclescripts.com/post/display-oracle-longops-operations/</link><pubDate>Sun, 31 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/display-oracle-longops-operations/</guid><description>
&lt;h2 id="display-oracle-vsession_longops-sessions"&gt;Display Oracle v$session_longops sessions&lt;/h2&gt;
&lt;p&gt;Gain visibility into recently completed long-running operations for monitoring performance and resource usage&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set lines 100 pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col username format a15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col message format a40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col remaining format 9999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;select username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, to_char(start_time, &amp;#39;hh24:mi:ss dd/mm/yy&amp;#39;) started
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, time_remaining remaining
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, message
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;from v$session_longops
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;where time_remaining = 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;order by time_remaining desc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Unveiling Language and Locale Settings in Oracle Database</title><link>https://www.oraclescripts.com/post/display-the-oracle-database-chararter-set-information/</link><pubDate>Sun, 31 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/display-the-oracle-database-chararter-set-information/</guid><description>
&lt;h2 id="display-the-oracle-database-chararter-set-information"&gt;Display the Oracle database chararter set information&lt;/h2&gt;
&lt;p&gt;Explore language and locale configurations that shape data interpretation and presentation for globalized applications and accurate data handling.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select * from nls_database_parameters
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;2SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To retrieve and display all current National Language Support (NLS) database parameters. These parameters govern how Oracle handles language, territory, character sets, and other locale-specific settings, ensuring accurate data representation and processing for diverse user groups and applications.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Monitoring Opened Cursors by User Session in Oracle Database</title><link>https://www.oraclescripts.com/post/list-oracle-open-cursors-by-oracle-username/</link><pubDate>Fri, 29 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/list-oracle-open-cursors-by-oracle-username/</guid><description>
&lt;h2 id="list-all-open-oracle-cursors-by-user-or-username"&gt;List all open oracle cursors by user or username&lt;/h2&gt;
&lt;p&gt;Track open cursor usage across user sessions to identify potential resource constraints or inefficiencies in database access patterns
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set pages 999 lines 300
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col username format a40
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;select sess.username as username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;, sess.sid as sid
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;, sess.serial# as serial
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, stat.value cursors
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;from v$sesstat stat
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, v$statname sn
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;, v$session sess
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;where sess.username is not null
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;and sess.sid = stat.sid
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;and stat.statistic# = sn.statistic#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;and sn.name = &amp;#39;opened cursors current&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;order by value
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;USERNAME SID SERIAL# CURSORS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;--------------- ---------- ---------- ----------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;SYS 143 10 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 132 33364 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 116 18996 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 118 23832 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 120 423 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;ORA_TIV 126 37072 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 127 4392 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 124 20787 4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;SYS 131 34710 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;CNUSERMAN 145 19887 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;CNUSERMAN 129 8407 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;CNUSERMAN 144 17898 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;CNUSERMAN 141 3881 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;ORA_TIV 139 5349 8
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;ORA_TIV 115 6676 9
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;15 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;USERNAME SID SERIAL# CURSORS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt;--------------- ---------- ---------- ----------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt;SYS 143 10 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 132 33364 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;24&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 116 18996 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;25&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 118 23832 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;26&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 120 423 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;27&lt;/span&gt;&lt;span class="cl"&gt;ORA_TIV 126 37072 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;28&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 127 4392 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;29&lt;/span&gt;&lt;span class="cl"&gt;WEBUSER 124 20787 4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;30&lt;/span&gt;&lt;span class="cl"&gt;SYS 131 34710 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;31&lt;/span&gt;&lt;span class="cl"&gt;CNUSERMAN 145 19887 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;32&lt;/span&gt;&lt;span class="cl"&gt;CNUSERMAN 129 8407 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;33&lt;/span&gt;&lt;span class="cl"&gt;CNUSERMAN 144 17898 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;34&lt;/span&gt;&lt;span class="cl"&gt;CNUSERMAN 141 3881 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;35&lt;/span&gt;&lt;span class="cl"&gt;ORA_TIV 139 5349 8
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;36&lt;/span&gt;&lt;span class="cl"&gt;ORA_TIV 115 6676 9
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;37&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;38&lt;/span&gt;&lt;span class="cl"&gt;15 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;39&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Modified Init Parameters Query with v$parameter</title><link>https://www.oraclescripts.com/post/show-latest-oracle-latent-parameter-changes/</link><pubDate>Fri, 29 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-latest-oracle-latent-parameter-changes/</guid><description>
&lt;h2 id="show-latent-parameter-changes"&gt;Show latent parameter changes&lt;/h2&gt;
&lt;p&gt;Analyzing Modified Oracle Database Parameters for Insights and Optimization Uncover configuration customizations, potential performance bottlenecks, and security considerations by examining modified initialization parameters in Oracle Database.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-SQL" data-lang="SQL"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;v$parameter&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ismodified&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;FALSE&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To identify and display all Oracle database initialization parameters that have been modified from their default values, either during the current instance or in previous instances. This provides insights into the database's configuration, potential customizations, and areas that might require attention for optimization or troubleshooting.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Resetting an Oracle Database Parameter to Its Default Value</title><link>https://www.oraclescripts.com/post/reset-unset-parameter-oracle-spfile/</link><pubDate>Fri, 29 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/reset-unset-parameter-oracle-spfile/</guid><description>
&lt;h2 id="reset-or-unset-a-oracle-parameter-in-the-spfile"&gt;Reset or unset a Oracle parameter in the spfile&lt;/h2&gt;
&lt;p&gt;Setting a parameter to &lt;code&gt;= ' '&lt;/code&gt; often isn't enough. Do this instead. The &lt;code&gt;sid='*'&lt;/code&gt; bit is always necessary, even in non-RAC databases.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-SQL" data-lang="SQL"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;alter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;system&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;reset&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;parameter&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;spfile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;*&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To reset a specified database initialization parameter to its default value, ensuring the change takes effect across all instances in a Real Application Clusters (RAC) environment upon the next database startup. This aids in troubleshooting, optimizing performance, or addressing configuration issues.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>v$parameter: Show Non-Default Oracle Init Parameters</title><link>https://www.oraclescripts.com/post/show-oracle-non-default-parameters/</link><pubDate>Fri, 29 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-oracle-non-default-parameters/</guid><description>
&lt;h2 id="show-non-default-parameters-in-the-table-vparameter"&gt;Show non-default parameters in the table v$parameter&lt;/h2&gt;
&lt;p&gt;Show non-default parameters in the table v$parameter
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-SQL" data-lang="SQL"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;999&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a30&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a50&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;v$parameter&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;isdefault&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;FALSE&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;order&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;by&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Monitoring User-Specific SQL Activity in Oracle Database</title><link>https://www.oraclescripts.com/post/display-the-users-current-session-sql/</link><pubDate>Sat, 09 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/display-the-users-current-session-sql/</guid><description>
&lt;h2 id="display-the-users-current-session-sql"&gt;Display the users current Session SQL&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;Select sql_text
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from v$sqlarea
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;where (address, hash_value) in
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;(select sql_address, sql_hash_value
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt; from v$session
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt; where username like &amp;#39;&amp;amp;username&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;Enter value for username: sys
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;old 6: where username like &amp;#39;&amp;amp;username&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;new 6: where username like &amp;#39;sys&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To retrieve and display the SQL text of all SQL statements currently being executed by a specific user within the Oracle database, providing insights into their activities, potential performance issues, and opportunities for optimization. This aids in troubleshooting, performance tuning, and security auditing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>v$session v$process: Map Oracle Sessions to OS PIDs</title><link>https://www.oraclescripts.com/post/session-status-associated-with-the-specified-os-process-id/</link><pubDate>Sat, 09 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/session-status-associated-with-the-specified-os-process-id/</guid><description>
&lt;h2 id="display-session-status-associated-with-the-specified-os-process-id"&gt;Display Session status associated with the specified os process id&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;select s.username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;, s.sid
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;, s.serial#
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;, p.spid
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;, last_call_et
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, status
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;from V$SESSION s
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, V$PROCESS p
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;where s.PADDR = p.ADDR
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;and p.spid=&amp;#39;&amp;amp;pid&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;Enter value for pid: 9999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;old 10: and p.spid=&amp;#39;&amp;amp;pid&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;new 10: and p.spid=&amp;#39;9999&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;no rows selected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Feature Usage with dba_feature_usage_statistics</title><link>https://www.oraclescripts.com/post/show-all-the-oracle-database-used-features/</link><pubDate>Sat, 02 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-all-the-oracle-database-used-features/</guid><description>
&lt;h2 id="show-all-the-oracle-database-used-or-installed-oracle-features-using-dba_feature_usage_statistics"&gt;Show all the Oracle database used or installed Oracle features using dba_feature_usage_statistics&lt;/h2&gt;
&lt;p&gt;Discover which database features have been actively used, providing insights for license management, optimization, and future planning.&lt;/p&gt;
&lt;p&gt;Show all the Oracle database installed features for an instance
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;, detected_usages
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;from dba_feature_usage_statistics
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;where detected_usages &amp;gt; 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;2SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To identify and display database features that have been actively used within a specified period, providing insights into feature adoption, usage patterns, and potential areas for optimization or license management.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Breakdown:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Map Sessions to OS Processes via v$session</title><link>https://www.oraclescripts.com/post/select-user-info-including-os-pid/</link><pubDate>Sat, 02 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/select-user-info-including-os-pid/</guid><description>
&lt;h2 id="select-oracle-user-info-including-os-pid"&gt;Select Oracle user info including os pid&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;SID/SERIAL&amp;#34; format a10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col username format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col osuser format a15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col program format a50
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;select s.sid || &amp;#39;,&amp;#39; || s.serial# &amp;#34;SID/SERIAL&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, s.username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, s.osuser
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, p.spid &amp;#34;OS PID&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;, s.program
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;from v$session s
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;, v$process p
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;Where s.paddr = p.addr
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;order by to_number(p.spid)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;SID/SERIAL USERNAME OSUSER OS PID PROGRAM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;---------- -------------------- --------------- ------------------------ --------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;1,51318 oracle 1751 oracle@localhost.localdomain (PMON)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;238,32433 oracle 1756 oracle@localhost.localdomain (CLMN)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;2,46817 oracle 1762 oracle@localhost.localdomain (PSP0)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;239,38809 oracle 1768 oracle@localhost.localdomain (VKTM)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;3,60083 oracle 1775 oracle@localhost.localdomain (GEN0)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;240,38968 oracle 1780 oracle@localhost.localdomain (MMAN)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;242,5837 oracle 1789 oracle@localhost.localdomain (GEN2)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;5,43292 oracle 1791 oracle@localhost.localdomain (VOSD)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;241,6809 oracle 1793 oracle@localhost.localdomain (DIAG)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;15,1554 SYS oracle 1798 oracle@localhost.localdomain (OFSD)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;249,54000 oracle 1798 oracle@localhost.localdomain (SCMN)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;6,34531 oracle 1802 oracle@localhost.localdomain (DBRM)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;243,12974 oracle 1806 oracle@localhost.localdomain (VKRM)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;7,13091 oracle 1812 oracle@localhost.localdomain (SVCB)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;244,5064 oracle 1816 oracle@localhost.localdomain (PMAN)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;8,25470 oracle 1818 oracle@localhost.localdomain (DIA0)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;245,44799 oracle 1822 oracle@localhost.localdomain (DIA1)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;9,52018 oracle 1824 oracle@localhost.localdomain (LMHB)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt;247,23362 oracle 1830 oracle@localhost.localdomain (DBW0)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt;10,26928 oracle 1833 oracle@localhost.localdomain (LGWR)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt;246,14445 oracle 1835 oracle@localhost.localdomain (CKPT)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;24&lt;/span&gt;&lt;span class="cl"&gt;12,54188 oracle 1839 oracle@localhost.localdomain (SMON)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;25&lt;/span&gt;&lt;span class="cl"&gt;248,5389 oracle 1844 oracle@localhost.localdomain (SMCO)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;26&lt;/span&gt;&lt;span class="cl"&gt;11,14458 oracle 1850 oracle@localhost.localdomain (RECO)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;27&lt;/span&gt;&lt;span class="cl"&gt;250,4512 oracle 1859 oracle@localhost.localdomain (LREG)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;28&lt;/span&gt;&lt;span class="cl"&gt;13,26195 oracle 1865 oracle@localhost.localdomain (PXMN)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;29&lt;/span&gt;&lt;span class="cl"&gt;14,57678 oracle 1877 oracle@localhost.localdomain (MMON)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;30&lt;/span&gt;&lt;span class="cl"&gt;252,34776 oracle 1880 oracle@localhost.localdomain (MMNL)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;31&lt;/span&gt;&lt;span class="cl"&gt;254,26559 oracle 1899 oracle@localhost.localdomain (BG00)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;32&lt;/span&gt;&lt;span class="cl"&gt;18,30813 oracle 1899 oracle@localhost.localdomain (BG00)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;33&lt;/span&gt;&lt;span class="cl"&gt;251,1313 oracle 1899 oracle@localhost.localdomain (SCMN)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;34&lt;/span&gt;&lt;span class="cl"&gt;253,36102 oracle 1899 oracle@localhost.localdomain (BG00)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;35&lt;/span&gt;&lt;span class="cl"&gt;19,6764 oracle 1899 oracle@localhost.localdomain (BG00)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;36&lt;/span&gt;&lt;span class="cl"&gt;24,36119 oracle 1899 oracle@localhost.localdomain (BG00)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;37&lt;/span&gt;&lt;span class="cl"&gt;255,24331 oracle 1913 oracle@localhost.localdomain (BG01)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;38&lt;/span&gt;&lt;span class="cl"&gt;20,48416 oracle 1913 oracle@localhost.localdomain (SCMN)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;39&lt;/span&gt;&lt;span class="cl"&gt;257,12867 oracle 1913 oracle@localhost.localdomain (BG01)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;40&lt;/span&gt;&lt;span class="cl"&gt;21,35536 oracle 1913 oracle@localhost.localdomain (BG01)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;41&lt;/span&gt;&lt;span class="cl"&gt;256,34711 oracle 1913 oracle@localhost.localdomain (BG01)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;42&lt;/span&gt;&lt;span class="cl"&gt;259,47947 oracle 1924 oracle@localhost.localdomain (BG02)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;43&lt;/span&gt;&lt;span class="cl"&gt;23,697 oracle 1924 oracle@localhost.localdomain (BG02)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;44&lt;/span&gt;&lt;span class="cl"&gt;258,29095 oracle 1924 oracle@localhost.localdomain (SCMN)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;45&lt;/span&gt;&lt;span class="cl"&gt;22,11344 oracle 1924 oracle@localhost.localdomain (BG02)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;46&lt;/span&gt;&lt;span class="cl"&gt;260,46618 oracle 1936 oracle@localhost.localdomain (GCW0)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;47&lt;/span&gt;&lt;span class="cl"&gt;261,9692 oracle 1950 oracle@localhost.localdomain (TMON)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;48&lt;/span&gt;&lt;span class="cl"&gt;26,24917 oracle 1953 oracle@localhost.localdomain (RCBG)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;49&lt;/span&gt;&lt;span class="cl"&gt;4,45620 oracle 2116 oracle@localhost.localdomain (TT00)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;50&lt;/span&gt;&lt;span class="cl"&gt;263,14430 oracle 2119 oracle@localhost.localdomain (TT01)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;51&lt;/span&gt;&lt;span class="cl"&gt;32,28875 oracle 2826 oracle@localhost.localdomain (AQPC)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;52&lt;/span&gt;&lt;span class="cl"&gt;265,47138 oracle 3157 oracle@localhost.localdomain (QM02)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;53&lt;/span&gt;&lt;span class="cl"&gt;35,53257 oracle 3170 oracle@localhost.localdomain (Q003)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;54&lt;/span&gt;&lt;span class="cl"&gt;46,26591 oracle 3809 oracle@localhost.localdomain (CL00)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;55&lt;/span&gt;&lt;span class="cl"&gt;47,56309 oracle 3882 oracle@localhost.localdomain (Q004)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;56&lt;/span&gt;&lt;span class="cl"&gt;49,18860 oracle 3891 oracle@localhost.localdomain (CJQ0)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;57&lt;/span&gt;&lt;span class="cl"&gt;286,58632 ORDS_PUBLIC_USER oracle 4175 Oracle REST Data Services
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;58&lt;/span&gt;&lt;span class="cl"&gt;53,20873 ORDS_PUBLIC_USER oracle 4179 Oracle REST Data Services
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;59&lt;/span&gt;&lt;span class="cl"&gt;16,14520 oracle 8232 oracle@localhost.localdomain (GCR0)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;60&lt;/span&gt;&lt;span class="cl"&gt;25,35234 oracle 8235 oracle@localhost.localdomain (W000)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;61&lt;/span&gt;&lt;span class="cl"&gt;271,17974 oracle 8241 oracle@localhost.localdomain (GCR1)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;62&lt;/span&gt;&lt;span class="cl"&gt;43,13620 oracle 8267 oracle@localhost.localdomain (M001)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;63&lt;/span&gt;&lt;span class="cl"&gt;38,45731 oracle 8273 oracle@localhost.localdomain (M003)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;64&lt;/span&gt;&lt;span class="cl"&gt;276,28467 oracle 8276 oracle@localhost.localdomain (M004)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;65&lt;/span&gt;&lt;span class="cl"&gt;41,61869 oracle 8304 oracle@localhost.localdomain (GCR2)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;66&lt;/span&gt;&lt;span class="cl"&gt;273,42070 oracle 8313 oracle@localhost.localdomain (W001)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;67&lt;/span&gt;&lt;span class="cl"&gt;54,58456 SYS oracle 8510 sqlplus@localhost.localdomain (TNS V1-V3)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;68&lt;/span&gt;&lt;span class="cl"&gt;42,36219 oracle 8907 oracle@localhost.localdomain (M005)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;69&lt;/span&gt;&lt;span class="cl"&gt;237,9496 SYS oracle 9666 oracle@localhost.localdomain (J000)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;70&lt;/span&gt;&lt;span class="cl"&gt;52,29429 oracle 9685 oracle@localhost.localdomain (J001)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;71&lt;/span&gt;&lt;span class="cl"&gt;272,7991 oracle 9786 oracle@localhost.localdomain (J002)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;72&lt;/span&gt;&lt;span class="cl"&gt;284,27835 oracle 10371 oracle@localhost.localdomain (M002)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;73&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;74&lt;/span&gt;&lt;span class="cl"&gt;70 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;75&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Identifying Idle User Sessions in Oracle Database</title><link>https://www.oraclescripts.com/post/oracle-sessions-sorted-by-logon-time/</link><pubDate>Fri, 01 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-sessions-sorted-by-logon-time/</guid><description>
&lt;h2 id="oracle-sessions-sorted-by-logon-time"&gt;Oracle sessions sorted by logon time&lt;/h2&gt;
&lt;p&gt;Track idle time for user sessions to uncover potential resource leaks, optimize database performance, and maintain security best practices.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;et lines 100 pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;select username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;, floor(last_call_et / 60) &amp;#34;Minutes&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;, status
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;from v$session
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;where username is not null
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;order by last_call_et
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;8&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;USERNAME OSUSER ID STATUS LOGIN_TIME LAST_CALL_ET
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;-------------------- --------------- --------------- -------- -------------- ------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;SYS oracle 54,58456 ACTIVE 20:09 10/12/23 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;SYS oracle 52,61761 ACTIVE 21:37 10/12/23 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;SYS oracle 15,1554 ACTIVE 23:34 09/12/23 79495
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;ORDS_PUBLIC_USER oracle 286,58632 INACTIVE 23:36 09/12/23 79361
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;ORDS_PUBLIC_USER oracle 53,20873 INACTIVE 23:36 09/12/23 79360
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;5 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Tracking Idle Time for User Sessions in Oracle Database</title><link>https://www.oraclescripts.com/post/show-time-since-last-oracle-user-activity/</link><pubDate>Fri, 01 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-time-since-last-oracle-user-activity/</guid><description>
&lt;h2 id="display-all-oracle-users-by-the-time-since-last-user-activity"&gt;Display all Oracle users by the time since last user activity&lt;/h2&gt;
&lt;p&gt;Identify idle user sessions and their inactive duration for resource optimization, performance tuning, and security best practices.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;set lines 100 pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;select username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;, floor(last_call_et / 60) &amp;#34;Minutes&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;, status
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;from v$session
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;where username is not null
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;order by last_call_et
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;8&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;USERNAME Minutes STATUS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;-------------------- ---------- --------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;SYS 0 ACTIVE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;SYS 1 ACTIVE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;ORDS_PUBLIC_USER 1305 INACTIVE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;ORDS_PUBLIC_USER 1305 INACTIVE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;SYS 1307 ACTIVE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;5 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Check if Java is Installed in Oracle Database</title><link>https://www.oraclescripts.com/post/identify-if-java-is-installed-in-the-oralce-database/</link><pubDate>Wed, 29 Nov 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/identify-if-java-is-installed-in-the-oralce-database/</guid><description>
&lt;h2 id="identify-if-java-is-installed-in-the-oralce-database-using-all_objects"&gt;Identify if Java is installed in the Oralce database using all_objects&lt;/h2&gt;
&lt;p&gt;Gain visibility into the quantity of Java objects owned by the SYS user, aiding in understanding database usage and potential security considerations.&lt;/p&gt;
&lt;p&gt;This will return 9000'ish if it is...
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select count(*)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from all_objects
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;where object_type like &amp;#39;%JAVA%&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;and owner = &amp;#39;SYS&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;2SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Top 10 Largest Segments Query with dba_segments</title><link>https://www.oraclescripts.com/post/show-the-ten-largest-oracle-objects-in-the-database/</link><pubDate>Wed, 29 Nov 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-the-ten-largest-oracle-objects-in-the-database/</guid><description>
&lt;h2 id="show-the-ten-largest-oracle-objects-in-the-database-using-dba_segments"&gt;Show the ten largest oracle objects in the database using dba_segments&lt;/h2&gt;
&lt;p&gt;Pinpoint the segments occupying the most storage space within the database to optimize storage usage, address potential bottlenecks, and enhance performance.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;col owner format a15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col segment_name format a30
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col segment_type format a15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;col mb format 999,999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;select owner
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, segment_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, segment_type
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, mb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;from (
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt; select owner
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt; , segment_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt; , segment_type
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt; , bytes / 1024 / 1024 &amp;#34;MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt; from dba_segments
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt; order by bytes desc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; )
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;where rownum &amp;lt; 11
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;OWNER SEGMENT_NAME SEGMENT_TYPE MB
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;--------------- ------------------------------ --------------- ------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;MYAPP TRANS_LOG TABLE 7,880
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;MYAPP DESCRIPTION INDEX 6,028
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;MYAPP EVT_LOG TABLE 4,984
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;ARCHIVE EVT_LOG TABLE 3,080
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;MYAPP ATTRIBUTES TABLE 2,312
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;MYAPP UNIQUE_EVT INDEX 2,129
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;MYAPP EVT_HOSTNAME INDEX 1,409
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;MYAPP SOURCE INDEX 1,407
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;8 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle DBA SQL Scripts and Database Commands</title><link>https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/</link><pubDate>Thu, 23 Nov 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/</guid><description>
&lt;ul&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="oracle-sql-scripts-and-database-commands-23c-21c-19c-18c-12c-11g-10g-9i-8i"&gt;Oracle SQL Scripts and Database Commands 23c 21c 19c 18c 12c 11g 10g 9i 8i&lt;/h2&gt;
&lt;p&gt;We are in the process of building a list of simple scripts used every day by DBA and others. If you have your own scripts you reuse in a text file on you workstation please send it to us.&lt;/p&gt;
&lt;p&gt;To look at other scripts see the &lt;a href="https://www.oraclescripts.com/categories/scripts/"&gt;Oracle Scripts Tag&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks for coming by!!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#security-grants"&gt;Security Grants&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#resizing-a-data-file"&gt;Resizing A Data File&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#show-all-product-information"&gt;Show All Product Information&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#show-row-counts-for-all-tables-that-have-analyize-on"&gt;Show Row Counts For All tables That Have ANALYZE On&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#select-all-users-in-system"&gt;Select All Users Active In The system&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#show-what-a-current-user-is-doing"&gt;Show What a Current User Is Doing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#create-count-for-all-tables"&gt;Create Count For All Tables&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#show-all-indexes"&gt;Show All Indexes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#show-all-tables"&gt;Show All Tables&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#show-space-sed"&gt;Show Space Used&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#sum-space-by-owner"&gt;Sum Space By Owner&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#sum-space-by-tablespace"&gt;Sum Space By Tablespace&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#show-reads-and-writes-by-file-name-in-oracle-db"&gt;Show Reads And Writes By File Name in Oracle DB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#show-versions-of-software"&gt;Show Versions Of Software&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#identify-segments-that-are-getting-close-to-their-max-extents-values"&gt;Identify Segments That Are Getting Close To Their Max-Extent Values&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#identifie-segments-that-are-getting-close-to-running-out-of-contiguous-free-space"&gt;Identifies Segments That Are Getting Close To Running Out Of Contiguous Free Space&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#displays-archived-redo-log-information"&gt;Displays Archived Redo Log Information&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#display-count-historical-archived-log-information-from-the-control-file"&gt;Display Count Historical Archived Log Information From The Control File&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#shows-current-archive-destinations"&gt;Shows Current Archive Destinations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#backups-of-archived-logs"&gt;Backups of Archived Logs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#display-all-online-redo-log-groups-for-the-database"&gt;Display All Online Redo Log Groups For The Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oraclescripts.com/post/oracle-sql-scripts-database-commands/#show-all-datafiles-for-tablespace-and-oracle-stuff"&gt;Show All Datafiles For Tablespace And Oracle Stuff&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h3 id="security-grants"&gt;Security Grants&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;grant select on PERSON_TABLE to public with grant option;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;select * from dba_tab_privs where TABLE_NAME = &amp;#39;PERSON_TABLE&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;select * from dba_role_privs where granted_role = &amp;#39;PORTMAN_TABLE&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="resizing-a-data-file"&gt;Resizing A Data File&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;alter database datafile &amp;#39;/u04/oradata/wpk/temp01.dbf&amp;#39; resize 500m;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="show-all-product-information"&gt;Show All Product Information&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select * from product_component_version;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="show-row-counts-for-all-tables-that-have-analyze-on"&gt;Show Row Counts For All Tables That Have ANALYZE On&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select owner table_name, num_rows from dba_tables where num_rows &amp;gt; 0;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="select-all-users-active-in-the-system"&gt;Select All Users Active In The System&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select sid, serial#,user#, Username, machine, program, server, status, command, type from v$session order by username;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="show-what-a-current-user-is-doing"&gt;Show What A Current User Is Doing&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select sid, serial#, status, server from v$session where username = &amp;#39;BROWNBH&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="create-count-for-all-tables"&gt;Create Count For All Tables&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select &amp;#39;Select count(*) from &amp;#39; ||owner|| &amp;#39;.&amp;#39; ||table_name|| &amp;#39;;&amp;#39; from dba_all_tables order by owner, table_name;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="show-all-indexes"&gt;Show All Indexes&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select owner, index_name, table_type, tablespace_name from dba_indexes where  owner &amp;lt;&amp;gt;&amp;#39;SYSTEM&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;DBSNMP&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;ORDSYS&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;OUTLN&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;SYS&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;SYSTEM&amp;#39; order by owner, index_name, tablespace_name;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="show-all-tables"&gt;Show All Tables&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select owner, table_name, table_type, tablespace_name from dba_all_tables where owner &amp;lt;&amp;gt;&amp;#39;SYSTEM&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;DBSNMP&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;ORDSYS&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;OUTLN&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;SYS&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;SYSTEM&amp;#39; order by owner, table_name, tablespace_name;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="show-space-used"&gt;Show Space Used&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select Tablespace_Name, /*Tablespace name*/ Owner, /*Owner of the segment*/ Segment_Name, /*Name of the segment*/ Segment_Type, /*Type of segment (ex. TABLE, INDEX)*/ Extents, /*Number of extents in the segment*/ Blocks, /*Number of db blocks in the segment*/ Bytes /*Number of bytes in the segment*/ from DBA_SEGMENTS where owner &amp;lt;&amp;gt;&amp;#39;SYSTEM&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;DBSNMP&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;ORDSYS&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;OUTLN&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;SYS&amp;#39; and owner &amp;lt;&amp;gt; &amp;#39;SYSTEM&amp;#39;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="sum-space-by-owner"&gt;Sum Space By Owner&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select owner, sum(blocks) Totalblocks, sum(bytes)TotalBytes from DBA_SEGMENTS group by owner;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="sum-space-by-tablespace"&gt;Sum Space by Tablespace&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select tablespace_name, sum(blocks) Totalblocks, sum(bytes)TotalBytes from DBA_SEGMENTS  group by tablespace_name;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="show-reads-and-writes-by-file-name-in-oracle-db"&gt;Show Reads And Writes By File Name In Oracle DB&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select v$datafile.name &amp;#34;File Name&amp;#34;, v$filestat.phyrds &amp;#34;Reads&amp;#34;, v$filestat.phywrts &amp;#34;Writes&amp;#34; from v$filestat,v$datafile where v$filestat.file# = v$datafile.file#;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="show-versions-of-software"&gt;Show Versions Of Software&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select * from V$VERSION;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="identify-segments-that-are-getting-close-to-their-max-extent-values"&gt;Identify Segments That Are Getting Close To Their Max-Extent Values&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select owner,tablespace_name,segment_name,bytes,extents,max_extents from dba_segments where extents*2 &amp;gt; max_extents;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="identifies-segments-that-are-getting-close-to-running-out-of-contiguous-free-space"&gt;Identifies Segments That Are Getting Close To Running Out Of Contiguous Free Space&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select owner, s.tablespace_name, segment_name, s.bytes, next_extent, max(f.bytes) largest from dba_segments s, dba_free_space f where s.tablespace_name = f.tablespace_name(+) group by owner, s.tablespace_name, segment_name, s.bytes, next_extent having next_extent*2 &amp;gt;max(f.bytes);
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="displays-archived-redo-log-information"&gt;Displays Archived Redo Log Information&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select * from v$database;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="display-count-historical-archived-log-information-from-the-control-file"&gt;Display Count Historical Archived Log Information From The Control File&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select count(*) from v$archived_log;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;select min(completion_time) from v$archived_log;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="shows-current-archive-destinations"&gt;Shows Current Archive Destinations&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select * from v$archive_dest;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="backups-of-archived-logs"&gt;Backups Of Archived Logs&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select count(*) from v$backup_redolog;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="display-all-online-redo-log-groups-for-the-database"&gt;Display All Online Redo Log Groups For The database&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select * from v$log;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="show-all-datafiles-for-tablespace-and-oracle-stuff"&gt;Show All Datafiles For Tablespace And Oracle Stuff&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select * from dba_data_files order by tablespace_name, file_name;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Monitoring Active and Idle User Sessions in Oracle Database</title><link>https://www.oraclescripts.com/post/show-all-the-oracle-users-connected-to-the-database/</link><pubDate>Wed, 15 Nov 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/show-all-the-oracle-users-connected-to-the-database/</guid><description>
&lt;h2 id="show-all-the-oracle-users-connected-to-the-database"&gt;Show all the Oracle users connected to the database&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set lines 100 pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col ID format a15
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col USERNAME format a20
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;select username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;, sid || &amp;#39;,&amp;#39; || serial# &amp;#34;ID&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, status
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;, last_call_et &amp;#34;Last Activity&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;from v$session
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;where username is not null
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;order by status desc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;, last_call_et desc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;USERNAME ID STATUS Last Activity
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;-------------------- --------------- -------- -------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;ORDS_PUBLIC_USER 286,58632 INACTIVE 1709
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;ORDS_PUBLIC_USER 52,56550 INACTIVE 1708
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;ORDS_PUBLIC_USER 53,20873 INACTIVE 1708
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;SYS 15,1554 ACTIVE 1843
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;SYS 237,34880 ACTIVE 81
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;SYS 36,39003 ACTIVE 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;6 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Oracle Schema Space Usage with dba_segments and dba_objects</title><link>https://www.oraclescripts.com/post/which-oracle-schemas-taking-up-the-most-space/</link><pubDate>Tue, 14 Nov 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/which-oracle-schemas-taking-up-the-most-space/</guid><description>
&lt;h2 id="shows-the-distribution-of-objects-and-data-across-all-schemas-using-dba-segments--dba_objects"&gt;Shows the distribution of objects and data across all schemas using dba-segments &amp;amp; dba_objects&lt;/h2&gt;
&lt;p&gt;Gain insights into object distribution across database users and their corresponding storage usage for data management, capacity planning, and optimization.&lt;/p&gt;
&lt;p&gt;Which schemas are taking up all of the space?
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;set pages 999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;size MB&amp;#34; format 999,999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;col &amp;#34;Objects&amp;#34; format 999,999,999
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;select obj.owner &amp;#34;Owner&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;, obj_cnt &amp;#34;Objects&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;, decode(seg_size, NULL, 0, seg_size) &amp;#34;size MB&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;from (select owner, count(*) obj_cnt from dba_objects group by owner) obj
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;, (select owner, ceil(sum(bytes)/1024/1024) seg_size
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; from dba_segments group by owner) seg
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;where obj.owner = seg.owner(+)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;order by 3 desc ,2 desc, 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;Owner Objects size MB
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt;------------------------------ ------------ ------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt;ANDY 219 46,323
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt;SYS 22,923 706
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt;SYSMAN 1,341 49
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt;XDB 680 49
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt;MDSYS 896 33
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;SYSTEM 454 23
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt;OLAPSYS 720 16
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;WMSYS 242 7
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;CTXSYS 339 5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;EXFSYS 281 4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt;DBSNMP 46 2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt;ORDSYS 1,720 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt;DMSYS 189 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt;OUTLN 8 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt;SCOTT 6 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt;TSMSYS 3 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt;PUBLIC 19,990 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt;ORDPLUGINS 10 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt;18 rows selected.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;24&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Determining Oracle Database Startup Time using v$instance</title><link>https://www.oraclescripts.com/post/oracle-startup-date-time/</link><pubDate>Mon, 13 Nov 2023 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/oracle-startup-date-time/</guid><description>
&lt;h2 id="oracle-startup-time"&gt;Oracle Startup Time&lt;/h2&gt;
&lt;p&gt;Discover the precise moment when the database was last initialized, providing insights for troubleshooting, performance analysis using v$instance&lt;/p&gt;
&lt;p&gt;Identify the Oralce Startup Time using SQL Script
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="5317081938"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;h2 id="sql-code"&gt;SQL Code&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;select to_char(startup_time, &amp;#39;HH24:MI DD-MON-YY&amp;#39;) &amp;#34;Startup time&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;from v$instance
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="sample-oracle-output"&gt;Sample Oracle Output&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt; 1 select to_char(startup_time, &amp;#39;HH24:MI DD-MON-YY&amp;#39;) &amp;#34;Startup time&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt; 2* from v$instance
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;SQL&amp;gt; /
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;Startup time
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;6&lt;/span&gt;&lt;span class="cl"&gt;---------------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;7&lt;/span&gt;&lt;span class="cl"&gt;02:55 17-MAY-23
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>