Friday, 21 November 2025
How to Start and Stop Observer in DG
Thursday, 20 November 2025
MAX_IDLE_TIME and MAX_IDLE_BLOCKER_TIME - Kill Automatically
Implementation Summary
We recently introduced two Oracle Database parameters in our Production environment to optimize resource utilization:
MAX_IDLE_TIME
- Purpose: Automatically terminates sessions that remain idle beyond a defined threshold (e.g., 30 minutes).
- Benefit: Prevents accumulation of idle sessions, reducing unnecessary CPU and memory consumption.
MAX_IDLE_BLOCKER_TIME
- Purpose: Terminates idle sessions that are blocking other sessions after a shorter threshold (e.g., 15 minutes).
- Benefit: Improves concurrency and minimizes application hangs caused by blocking locks.
Objective
The primary goal of implementing these parameters was to reduce CPU and memory overhead by cleaning up idle and blocking sessions automatically, thereby improving overall database performance and stability.
Advantages
- Resource Efficiency: Frees up memory and process slots consumed by idle sessions.
- Improved Throughput: Eliminates blockers quickly, reducing wait times for active sessions.
- Operational Simplicity: Reduces manual intervention for session cleanup.
- Enhanced Stability: Helps avoid hitting session or process limits in high-load environments.
Here’s a detailed explanation of the two Oracle parameters you mentioned:
1. MAX_IDLE_TIME
Definition:
This parameter specifies the maximum number of minutes that a session can remain idle. After this time, the session is automatically terminated.- Default Value:
0(means unlimited idle time) - Range:
0to maximum integer value - Modifiable: Yes, dynamically using
ALTER SYSTEM - Scope: Can be set at the CDB or PDB level
- Oracle RAC: Different instances can have different values
- Introduced: Available in Oracle Database 19c and later
- Default Value:
Behavior:
Applies to all sessions, regardless of whether they are blocking other sessions or not. If a session is idle beyond the specified time, Oracle kills it.Advantages:
- Prevents accumulation of idle sessions that consume resources like memory and process slots.
- Helps maintain database performance and stability in environments with many client connections (e.g., web apps, connection pools).
- Reduces risk of hitting
SESSIONSorPROCESSESlimits.
2. MAX_IDLE_BLOCKER_TIME
Definition:
Specifies the maximum number of minutes that a blocking session can remain idle. After this time, the blocking session is automatically terminated.- Default Value:
0(means unlimited) - Range:
0to maximum integer value - Modifiable: Yes, dynamically using
ALTER SYSTEM - Scope: Can be set at CDB or PDB level
- Introduced: Oracle Database 19c (backported) and officially in 21c
- Default Value:
What is a Blocking Session?
A session that holds resources (like locks) needed by other sessions. For example:- Session A updates a row but does not commit or rollback.
- Session B tries to update the same row and gets stuck waiting.
Behavior:
Applies only to blocking sessions. If such a session is idle beyond the specified time, Oracle terminates it automatically.
Important: The value ofMAX_IDLE_BLOCKER_TIMEshould be less thanMAX_IDLE_TIMEfor it to be effective.Advantages:
- Prevents application hangs caused by idle sessions holding locks.
- Improves concurrency and throughput by freeing blocked sessions quickly.
- Reduces DBA intervention for killing blocker sessions manually.
- Useful in environments with frequent interactive tools (SQL Developer, Toad) where users leave transactions open.
Best Practices
- Set
MAX_IDLE_TIMEfor general idle session cleanup (e.g., 30 minutes). - Set
MAX_IDLE_BLOCKER_TIMEto a smaller value (e.g., 5–15 minutes) to quickly resolve blocking issues. - Monitor application behavior before applying these limits to avoid unintended session terminations (especially for batch jobs or long-running queries).
Both are dynamic and can be modified using ALTER SYSTEM without an instance restart.
For example:
Before:-
ALTER SYSTEM SET MAX_IDLE_TIME = 0 SCOPE=BOTH;
ALTER SYSTEM SET MAX_IDLE_BLOCKER_TIME = 0 SCOPE=BOTH;
After:-
ALTER SYSTEM SET MAX_IDLE_TIME=30 SCOPE=BOTH sid='*';
ALTER SYSTEM SET MAX_IDLE_BLOCKER_TIME=15 SCOPE=BOTH sid='*';
KILL SESSION for sid=(2743, 39563):
Reason = max_idle_time parameter
Mode = KILL HARD SAFE -/-/NO_REPLAY
Requestor = PMON (orapid = 2, ospid = 41773, inst = 1)
Owner = Idle Virtual Circuit
Result = ORA-0
2025-11-20T04:45:15.159483+01:00
KILL SESSION for sid=(1960, 6001):
Reason = max_idle_time parameter
Mode = KILL HARD SAFE -/-/NO_REPLAY
Requestor = PMON (orapid = 2, ospid = 41773, inst = 1)
Owner = Idle Virtual Circuit
Result = ORA-0
KILL SESSION for sid=(2458, 64982):
Reason = max_idle_time parameter
Mode = KILL HARD SAFE -/-/NO_REPLAY
Requestor = PMON (orapid = 2, ospid = 41773, inst = 1)
Owner = Idle Virtual Circuit
Result = ORA-0
KILL SESSION for sid=(2709, 36680):
Reason = max_idle_time parameter
Mode = KILL HARD SAFE -/-/NO_REPLAY
Requestor = PMON (orapid = 2, ospid = 41773, inst = 1)
Owner = Idle Virtual Circuit
Result = ORA-0
2025-11-20T04:46:18.196496+01:00
KILL SESSION for sid=(2117, 64732):
Reason = max_idle_time parameter
Mode = KILL HARD SAFE -/-/NO_REPLAY
Requestor = PMON (orapid = 2, ospid = 41773, inst = 1)
Owner = Idle Virtual Circuit
Result = ORA-0
KILL SESSION for sid=(2122, 14405):
Reason = max_idle_time parameter
Mode = KILL HARD SAFE -/-/NO_REPLAY
Requestor = PMON (orapid = 2, ospid = 41773, inst = 1)
Owner = Idle Virtual Circuit
Result = ORA-0
The log entries you shared indicate that Oracle's PMON (Process Monitor) automatically killed several sessions because they exceeded the MAX_IDLE_TIME limit you configured. Here’s what each part means:
Breakdown of the Log
KILL SESSION for sid=(2743, 39563):
The session identified by SID and Serial# was terminated.Reason = max_idle_time parameter:
The termination was triggered because the session was idle longer than theMAX_IDLE_TIMEvalue (e.g., 30 minutes in your example).Mode = KILL HARD SAFE -/-/NO_REPLAY:
- KILL HARD: The session is forcibly terminated without waiting for cleanup.
- SAFE: Ensures minimal impact on database consistency.
- NO_REPLAY: Indicates that the session cannot be replayed (not part of Application Continuity).
Requestor = PMON (orapid = 2, ospid = 41773, inst = 1):
PMON is the background process responsible for cleaning up failed or idle sessions.Owner = Idle Virtual Circuit:
The session was idle and had no active work.Result = ORA-0:
Successful termination (ORA-0 means no error).
Why This Happens
When MAX_IDLE_TIME is set (e.g., 30 minutes), Oracle monitors sessions. If a session remains idle beyond that threshold:
- PMON kills the session automatically.
- This prevents resource leakage and keeps the database healthy.
Advantages of This Behavior
- Automatic Cleanup: No need for manual DBA intervention.
- Resource Optimization: Frees up memory, process slots, and network resources.
- Improved Stability: Reduces risk of hitting
SESSIONSorPROCESSESlimits. - Better Performance: Avoids idle sessions hogging resources in connection pools.
Sunday, 27 July 2025
Oracle Exadata
Oracle Exadata Database Machine employs a modern scale-out architecture encompassing database compute, storage, network, and software. Uniquely designed to be the ideal platform to run Oracle Database, Oracle Exadata enables enterprises to add capacity and increase performance as workloads scale. Oracle Exadata utilizes state-of-the-art hardware and purpose-built software to drive the highest database performance. All database and storage servers are interconnected with each other, communicating over an intelligent, high-speed, low-latency network fabric.
Remote Direct Memory Access (RDMA) is an integral architectural component of Exadata. It is enhanced in every generation of hardware, Oracle Database, and Exadata System Software release. RDMA enables one server to interact with memory structures on another server without interacting with the OS and network stack on either machine. Each Database and Storage Server is equipped with RDMA capable network cards that directly read from and write to remote memory with no extra copying or buffering. RDMA is also used by Oracle Database when running on Exadata to optimize communication between Real Application Clusters (RAC) instances.
Fundamental to the architecture of Exadata is modular, shared, smart storage. Each Storage Server is capable of interpreting and processing data independently. The CPUs in the storage servers do not replace database CPUs. Instead, they accelerate database-intensive workloads similar to how graphics cards accelerate image-intensive workloads. Exadata System Software enables Exadata Storage Server's unparalleled performance without any of the bottlenecks of traditional storage. Automatic caching of data from disk into Exadata Smart Flash Cache and Exadata RDMA Memory (XRMEM) (a multi-level tiering of data into high-speed, low-latency storage media) enables staggering performance. Every storage server is accessible from every database server. As a result, flash and XRMEM can be shared effectively across multiple database workloads. By automatically caching data from disk into flash and XRMEM, the benefits of these technologies are available and realized by all workloads..
Smart Scan:-
Oracle Exadata is comprised of Database Servers, Storage Servers, high-speed, low-latency network fabric, Oracle Database Software, and Exadata System Software. Together, these five components address the need for Oracle Databases shared-everything architecture of Real Application Clusters (RAC).
Starting with Exadata System Software release 24.1, Oracle Exadata Exascale transforms Exadata storage management by decoupling Oracle Database and GI clusters from the underlying Exadata storage servers. For new and existing deployments, you can deploy a configuration that uses Exascale, ASM, or both. This option enables new and existing customers to implement Exascale while keeping selected databases on the time-tested storage management infrastructure provided by ASM.
Oracle Database, running on the Exadata Database Servers, leverages a purpose-built protocol - iDB - and Remote Direct Memory Access (RDMA) over Converged Ethernet (RoCE) to communicate with the Exadata Storage.
iDB is used to direct Smart I/O operations on the Storage Servers. Smart I/O includes Smart Scan (SQL Offload), Fast File Initialization, and RMAN Incremental Backup Offload. Exadata essentially can "function ship" or push processing from the database servers to the storage servers rather than move potentially hundreds to thousands of terabytes from disk to database server. When the storage server receives a request to perform a Smart I/O, Exadata System Software unpacks the iDB message and executes and processes I/O requests locally, including executing portions of Oracle Database code on the storage servers, before sending only the data that satisfies the request back to the database servers for final processing (such as aggregation).
Where iDB is used to offload I/O intensive processing, such as backups and Analytic queries, to the storage servers, Exadata also leverages the high-speed RoCE network fabric for OLTP workloads. High Capacity Exadata Storage Servers are equipped with Exadata RDMA Memory (XRMEM), flash drives, and traditional hard drives. The Exadata System Software automatically caches data into flash and XRMEM based on incoming workload. This automatically managed caching strategy ensures that the most appropriate storage tier is used to service I/O requests.
For example, Incremental Fast Backups are offloaded to the Exadata Storage Server. Since Exadata knows that blocks read during a backup are likely of little use for satisfying I/O beyond the backup itself, this data is not cached into either flash or XRMEM. At the same time, the Storage Server will cache blocks in both flash and XRMEM to satisfy read and write database requests for OLTP workloads.
Automatically caching data in this manner enables all workloads to run faster and resources to be used more efficiently for individual databases. It also enables high degrees of database consolidation.
Oracle Database and Exadata are engineered together. Oracle Database leverages the hardware and software Exadata provides. Exadata Storage Servers include XRMEM and are accessible over the RoCE network fabric. As OLTP workloads typically access and modify very small amounts of data - one or very few rows - caching this data on a fast device, such as XRMEM ensures the quickest read and write speeds for such data. As Exadata employs scale-out hardware and network architecture, placing the XRMEM in the storage servers ensures all database instances benefit from this cutting-edge technology.
Exadata Database Server:-
Oracle Exadata System Software runs on all database and storage servers to enable Oracle Database to leverage every aspect of Exadata's hardware and network capabilities.
On each Database Server, in addition to the Oracle Linux Operating System, Oracle Grid Infrastructure, Automatic Storage Management (ASM), and Oracle Database software and instances, you will find the following processes and library:
- MS – Exadata System Software Management Server – the primary interface for managing the Exadata Database Server, including hardware and software monitoring, metric collection, alerting, and a command-line interface (DBMCLI).
- RS – Exadata System Software Restart Server – monitors and restarts the MS process if needed.
- libcell – Exadata-specific library linked into the Oracle Database and Grid Infrastructure that allows Oracle to communicate with the Exadata Storage Servers using iDB commands and RDMA.
- EGSB/EDSB – Exascale Global Services – per database instance services that maintain metadata about the Exascale cluster and vaults.
- EGS – Exascale Global Services – provides the core foundation for the Exascale system. EGS instances will run on database servers when the Exadata configuration has fewer than five storage servers.
- ESNP – Exascale Node Proxy – maintains information about the current state of the Exascale cluster, which it provides to local Oracle Grid Infrastructure and Oracle Database processes.
- EDV – Exascale Direct Volume – exposes Exascale block storage as raw block devices on Exadata compute nodes.
- BSW – Block Store Worker – primarily services requests from block store clients and performs the resulting storage server I/O.
Oracle Exadata System Software runs on all database and storage servers to enable Oracle Database to leverage every aspect of Exadata's hardware and network capabilities.
On each Extreme Flash and High Capacity Storage Server, in addition to the Oracle Linux Operating System, you will find the following processes and library:
- MS – Exadata System Software Management Server – the primary interface for managing the Exadata Storage Server, including hardware and software monitoring, metric collection, alerting, and a command-line interface (CELLCLI).
- RS – Exadata System Software Restart Server– monitors and restarts the MS process if needed.
- CELLSRV – Exadata Cell Server – The core Exadata System Software component responsibile for the majority of the services provided by the Storage Servers, including SQL Offload, I/O Resource Management (IORM), Exadata RDMA Memory (XRMEM) and Flash Cache tiering, and Storage Index creation and maintenance.
- IORM – I/O Resource Manager – A sub-process of the CELLSRV process. Responsible for ensuring multiple databases can share the same shared I/O resources, ensuring databases on the same infrastructure do not monopolize I/O bandwidth and degrade perfomance of other databases.
- CELLOFLSRVn – Cell Offload Server – A sub-process of the Cell Server processes that provides version-specific Storage Offload functions. Each version of Oracle Database uses an associated version-specific CELLOFLSRV process.
- EGS – Exascale Global Services – provides the core foundation for the Exascale system. Every Exascale cluster contains five EGS instances, each running on a storage server.
- ERS – Exascale RESTful Services – provides a management endpoint for Exascale management operations.
- EDS – Exascale Data Services – the collective name for the Exascale software services that manage file and vault metadata.
- SYSEDS – System Vault Manager Service – serves and manages the metadata for Exascale vaults.
- USREDS – User Vault Manager Service – serves and manages the metadata for files inside the Exascale vaults.
- BSM – Block Store Manager – serves and manages the metadata for Exascale block storage.
- BSW – Block Store Worker – primarily services requests from block store clients and performs the resulting storage server I/O.
- IFD – Instant Failure Detection – a dedicated lightweight service that quickly detects and responds to any storage server failure.
Oracle Exadata Smart Scan feature
are the primary ones:
Database servers: Enterprise-class servers that run database software,
Automatic Storage Management (ASM), or the Oracle Grid Infrastructure.
Storage servers: Storage servers, or cells, that run Exadata storage server
software, which manages I/O requests coming from database servers and requests
for data returned to a user.
InfiniBand network: The internal Exadata network is built on InfiniBand,
which is primarily designed for high-performance computing environments.
Exadata comes with software known as the Exadata Storage Software (ESS), which enhances the performance of a database. ESS, the storage management server installed on each storage cell, manages the storage servers and communicates
with database servers for any storage-related requests.
Key features of ESS
Following are the key features of ESS:
Flash cache: The Flash cache is a high-performance cache on cell servers
that caches recently accessed objects.
Flash log: The Flash log provides a high-performance, low-latency, and
reliable temporary store for redo-log writes.
EHCC: Exadata Hybrid Columnar Compression (EHCC) enables the highest
levels of data compression. EHCC organizes data into sets of rows called
compression units. Within a compression unit, EHCC organizes the data by
column and then compresses the data.
Storage indexes: Storage indexes are in-memory structures on the storage
servers that are designed to reduce the time spent reading data from a disk
on the storage servers.
Cell offloading: Unlike traditional storage design, the Exadata storage
cells are designed to process some workload internally to reduce the overall
burden on the compute or database nodes. This process is called cell offloading.
Smart Scan: Smart Scan allows most of the SQL processing to happen in
the storage tier instead of the database tier, which dramatically improves
query performance. Smart Scan reduces the volume of data sent to the database
tier thereby reducing CPU usage on database nodes.
SQL processing
Traditionally, SQL processing happens on database servers only. In Exadata, SQL
processing is divided and also takes place on the storage tier.
Tradition SQL processing
- A client submits a query.
- This action triggers a full table scan.
- The database maps the request to the file and corresponding extents, which contain the table being scanned.
- Similar to a full scan, the database issues the I/O operations to read all the blocks.
- All the queried blocks of the table are read into memory.
- The process searches the blocks for the rows that satisfy the predicate.
- Lastly, the requested rows are returned to the client.
If it is a big table, all the blocks from that table are read, transferred across the storage network, and copied into memory. The process reads many unwanted rows are read into memory to complete the requested SQL operation. The large volume of transmitted data consumes bandwidth, impacts response time, and creates an unnecessary burden on the database tier.
Exadata server SQL processing
With Exadata storage, SQL processing is handled much more efficiently because it uses Exadata storage software, which has database logic built into it. The following steps comprise Exadata SQL processing, as shown in the following diagram
- A client submits a query.
- The database server constructs an Intelligent Database (iDB) message, which includes the query criteria. This iDB message goes to all storage servers in a rack.
- The cellsrv component of the ESS scans the data blocks to identify the matching rows and columns that satisfy the request.
- Every storage server executes the query criteria in parallel and sends only the relevant rows, or the net result, to the database server by using interconnect.
- The database consolidates the result and returns the rows to the client.
Smart Scan requirements
Following are the requirements to use Smart Scan:
- You can use Smart Scan for only full table scans or full index scans.
- Queries must perform direct-path reads.
- You must set the database initialization parameter `CELL_OFFLOAD_PROCESSING to `TRUE`.
- You must save segments in disk groups that are completely stored on Exadata cells.
- The ASM disk groups that store the segment data must have the following attribute settings:
- compatible.rdbms` = 11.2.0.0.0 (or later)
- Compatible.asm` = 11.2.0.0.0 (or later)
- Cell.smart_scan_capable` = `TRUE`
Smart Scan examples
Execute the following steps, first with and then without Smart Scan enabled, to measure the Smart Scan effect on the statistics.
Step 1: Connect to database
Run the following command to connect to your database with SQL*Plus:
[oracle@nd01db01 ~]$ sqlplus nd/nd
SQL*Plus: Release 11.2.0.3.0 Production...
Step 2: Verify statistics
Run the following query to verify that the statistics are at or near zero:
where a.statistic# = b.statistic# and (a.name in ('physical read total bytes',
'physical write total bytes', 'cell IO uncompressed bytes')
or a.name like 'cell phy%');
where a.statistic# = b.statistic# and (a.name in ('physical read total bytes',
'physical write total bytes', 'cell IO uncompressed bytes')
or a.name like 'cell phy%');
NAME MB
--------------------------------------------------------------- ---
physical read total bytes 0
physical write total bytes 0
cell physical IO interconnect bytes 0
cell physical IO bytes saved during optimized file creation 0
cell physical IO bytes saved during optimized RMAN file restore 0
cell physical IO bytes eligible for predicate offload 0
cell physical IO bytes saved by storage index 0
cell physical IO bytes sent directly to DB node to balance CPU 0
cell physical IO interconnect bytes returned by smart scan 0
cell IO uncompressed bytes 0
10 rows selected.
Step 3: Execute a select query with Smart Scan disabled
Run the following select query with the optimizer hint that disables Smart Scan:
from sales where time_id between '01-JUN-2017' and '30-OCT-2017'
and amount_sold = 1;
COUNT(*)
----------
134055
Step 4: Verify statistics again
Run the following command to verify statistics again. Note that all the data processed by the query in step 3 (physical read total bytes) is returned to the database server over the storage network (cell physical IO interconnect bytes).
where a.statistic# = b.statistic# and (a.name in ('physical read total bytes',
'physical write total bytes', 'cell IO uncompressed bytes')
or a.name like 'cell phy%');
NAME MB
--------------------------------------------------------------- -----------
physical read total bytes 759.429688
physical write total bytes 0
cell physical IO interconnect bytes 759.429688
cell physical IO bytes saved during optimized file creation 0
cell physical IO bytes saved during optimized RMAN file restore 0
cell physical IO bytes eligible for predicate offload 0
cell physical IO bytes saved by storage index 0
cell physical IO bytes sent directly to DB node to balance CPU 0
cell physical IO interconnect bytes returned by smart scan 0
cell IO uncompressed bytes 0
10 rows selected.
Step 5: Reset the statistics
Run the following command to reconnect the session to the database to reset the session-level statistics:
[oracle@nd01db01 ~]$ sqlplus nd/nd
SQL*Plus: Release 11.2.0.3.0 Production...
Step 6: Verify statistics again
Run the following query to verify that the statistics are at or near zero:
SQL> select a.name, b.value/1024/1024 MB from v$sysstat a, v$mystat b
where a.statistic# = b.statistic# and (a.name in ('physical read total bytes',
'physical write total bytes', 'cell IO uncompressed bytes')
or a.name like 'cell phy%');
NAME MB
--------------------------------------------------------------- ---
physical read total bytes 0
physical write total bytes 0
cell physical IO interconnect bytes 0
cell physical IO bytes saved during optimized file creation 0
cell physical IO bytes saved during optimized RMAN file restore 0
cell physical IO bytes eligible for predicate offload 0
cell physical IO bytes saved by storage index 0
cell physical IO bytes sent directly to DB node to balance CPU 0
cell physical IO interconnect bytes returned by smart scan 0
cell IO uncompressed bytes 0
10 rows selected.
Step 7: Execute a select query without Smart Scan disabled
Run the following select query without the optimizer hint that disables Smart Scan:
SQL> select count(*) from sales where time_id between '01-JUN-2017'
and '30-OCT-2017'and amount_sold = 1;
COUNT(*)
-------
134055
Step 8: Verify statistics
Run the following query to verify the statistics. Note that the query still performs approximately 759 MB of I/O (physical read total bytes) as in step 4. However, this time only 1.7 MB is returned to the DB server (cell physical IO interconnect bytes). This is the result of a Smart Scan in action. In this case, Smart Scan is acting on I/O associated with this query because the cell physical
IO bytes that are eligible for predicate offload equals the physical read total bytes, and the cell physical IO interconnect bytes returned by smart scan equals the cell physical IO interconnect bytes.
NAME MB
---------------------------------------------------------------- ----------
physical read total bytes 759.429688
physical write total bytes 0
cell physical IO interconnect bytes 1.71562805
cell physical IO bytes saved during optimized file creation 0
cell physical IO bytes saved during optimized RMAN file restore 0
cell physical IO bytes eligible for predicate offload 759.429688
cell physical IO bytes saved by storage index 0
cell physical IO bytes sent directly to DB node to balance CPU 0
cell physical IO interconnect bytes returned by smart scan 1.71562805
cell IO uncompressed bytes 759.429688
10 rows selected.
Conclusion
The Smart Scan feature in Exadata enables SQL processing to happen at the storage tier, instead of the database tier, to improve query performance.
Smart Scan reduces the volume of data sent to the database tier thereby reducing the CPU usage on database nodes.
Exadata Smart Scan: A Quick Overview
- The segment you are querying must be stored in an Exadata Database Machine where the disk group with the cell.smart_scan_capable attribute is set to true.
- A Full Table Scan or an Index Fast Full Scan operation must occur.
- The segment must be big enough to fire a direct path read operation.
SQL> select segment_name, segment_type, bytes/1024/1024 mb from user_segments where segment_name='SALES'
SEGMENT_NAME SEGMENT_TYPE MB
-------------------- ------------------ ----------
SALES TABLE 1984
SQL> select count(*) from sales
COUNT(*)
----------
20000000
Elapsed: 00:00:03.97
SQL> show parameter cell_offload_processing
NAME TYPE VALUE
------------------------------------ ----------- ------------------------
cell_offload_processing boolean TRUE
SQL> select /*+ OPT_PARAM('cell_offload_processing' 'false') */ max(ORDER_DATE) from SALES;
MAX(ORDER
---------
28-SEP-19
Elapsed: 00:00:16.52
SQL> select s.name, m.value/1024/1024 mb from v$mystat m, v$sysstat s where m.statistic#=s.statistic# and (s.name like '%physical IO%' or s.name like '%optimized%' or s.name like 'physical%total bytes');
NAME MB
---------------------------------------------------------------- ----------
physical read requests optimized 7.6294E-06
physical read total bytes optimized .921875
physical read total bytes 1901.14063
physical write requests optimized 0
physical write total bytes optimized 0
physical write total bytes 0
cell physical IO interconnect bytes 1901.14063
cell physical IO bytes saved during optimized file creation 0
cell physical IO bytes saved during optimized RMAN file restore 0
cell physical IO bytes eligible for predicate offload 0
cell physical IO bytes saved by storage index 0
cell physical IO bytes sent directly to DB node to balance CPU 0
cell physical IO interconnect bytes returned by smart scan 0
cell simulated physical IO bytes eligible for predicate offload 0
cell simulated physical IO bytes returned by predicate offload 0
15 rows selected.
Elapsed: 00:00:00.01
SQL> select max(ORDER_DATE) from SALES;
MAX(ORDER
---------
28-SEP-19
Elapsed: 00:00:04.36
We can see the time dropped by four times. That is because the Smart Scan feature was used. SQL> select s.name, m.value/1024/1024 mb from v$mystat m, v$sysstat s where m.statistic#=s.statistic# and (s.name like '%physical IO%' or s.name like '%optimized%' or s.name like 'physical%total bytes');
NAME MB
---------------------------------------------------------------- ----------
physical read requests optimized 0
physical read total bytes optimized 0
physical read total bytes 1901.14063
physical write requests optimized 0
physical write total bytes optimized 0
physical write total bytes 0
cell physical IO interconnect bytes 275.122597
cell physical IO bytes saved during optimized file creation 0
cell physical IO bytes saved during optimized RMAN file restore 0
cell physical IO bytes eligible for predicate offload 1901.14063
cell physical IO bytes saved by storage index 0
cell physical IO bytes sent directly to DB node to balance CPU 0
cell physical IO interconnect bytes returned by smart scan 275.122597
cell simulated physical IO bytes eligible for predicate offload 0
cell simulated physical IO bytes returned by predicate offload 0
15 rows selected.
Elapsed: 00:00:00.00
We see now that the total number of physical reads is the same, but the bytes returned by the interconnect is only 275MB which is also the same amount returned by Smart Scan. SQL> alter session set "_serial_direct_read" = never;
Session altered.
Elapsed: 00:00:00.00
SQL> select max(ORDER_DATE) from SALES;
MAX(ORDER
---------
28-SEP-19
Elapsed: 00:00:25.52
We can see that not only does it take more time than the first execution, but all the data that was supposed to go directly to the session PGA went to the Buffer Cache:SQL> select s.name, m.value/1024/1024 mb from v$mystat m, v$sysstat s where m.statistic#=s.statistic# and (s.name like '%physical IO%' or s.name like '%optimized%' or s.name like 'physical%total bytes');
NAME MB
---------------------------------------------------------------- ----------
physical read requests optimized .000020027
physical read total bytes optimized .9609375
physical read total bytes 1901.23438
physical write requests optimized 0
physical write total bytes optimized 0
physical write total bytes 0
cell physical IO interconnect bytes 1901.23438
cell physical IO bytes saved during optimized file creation 0
cell physical IO bytes saved during optimized RMAN file restore 0
cell physical IO bytes eligible for predicate offload 0
cell physical IO bytes saved by storage index 0
cell physical IO bytes sent directly to DB node to balance CPU 0
cell physical IO interconnect bytes returned by smart scan 0
cell simulated physical IO bytes eligible for predicate offload 0
cell simulated physical IO bytes returned by predicate offload 0
15 rows selected.
Elapsed: 00:00:00.00
Undo Queries
SQL> SQL> select sum(bytes /(1024*1024*1024)) from dba_undo_extents where status='EXPIRED'; select sum(bytes /(1024*1024*102...
-
Installation on Oracle Linux Part-1 OS 1. PREPARING OPERATING SYSTEMS ON BOTH SERVERS It is assumed that you have two servers running on ...
-
How to check Clock synchronization between cluster nodes in RAC RHEL - 7 : Applicable We can use below to check the clock/time synchroniz...
-
GPnP ( Grid Plug and Play ) profile in Oracle RAC The GPnP profile is a XML file located at location <GRID_HOME/gpnp/<hostname>/p...