Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • For Perl DBI installation and testing program PHP/MYSQL/Wordpress
  • metalink all dynamic view reference notes. Oracle
  • True Session Wait Activity in Oracle 10g Verygood Oracle
  • How can I tell if ASO is installed ? Oracle
  • More info about /proc folder and its relation with processes. Linux/Unix
  • Renaming Global Name GLOBAL_NAME Oracle
  • Oracle vs MYSQL Architecture differences (For DBAs) MYSQL
  • set_env_dba Linux/Unix
  • telnet listening Linux/Unix
  • On solaris 10, “S” link is not part of $ORACLE_HOME/bin/oracle as default. ( For 9.2.0.8) Oracle
  • Roles and Stored Object behaviour Oracle
  • useful dg links Oracle
  • pvm_metric.sql for gathering report from vmstat tables Oracle
  • Difference between SYNC and AFFIRM Oracle
  • chk_space_SID.ksh Linux/Unix

Facts about SCN and Rollback Segment

Posted on 21-Apr-2007 By Admin No Comments on Facts about SCN and Rollback Segment

1. When should you create more rollback segments?

The number of rollback segments needed to prevent contention between processes can be determined with the help of the monitor rollback display and with the use of the v$waitstat table. The rollback monitor column “header waits/sec” gives an indication of the current rollback segment contention. Waits are a definite indication of contention. The following v$waitstat query will display number of waits since instance startup:

SELECT * FROM V$WAITSTAT;

Any non-zero value for ‘undo header’ in the CLASS column of “v$waitstat” indicates contention for rollback segment header blocks.

You may want to add a rollback segment when you know you have a large transaction.

2. Is PCTINCREASE for rollback segments always 0?

True.

3. What DML creates the most undo?

Delete and update will probably create the most undo. INSERT STATEMENT creates the least undo because oracle only needs to store the rowid.

The number of bytes required for storage of undo, or information that is needed in case of rollback, depends on two things: 1) the type of transaction being performed (insert, update, delete, etc.) and 2) the actual data being processed. In general, inserting a given record into a table generates less undo than deleting the same record, because while rolling back an insert only requires deleting the row, rolling back a delete requires reinserting that row. (It would take less bytes to store a rowid than to store information to reconstruct the actual row itself.)

Additionally, the undo generated for an update on a fraction of a row is not proportionate to the amount generated for the entire row, due to additional overhead required.

4. If you have a table with an index and you insert a row, does Oracle create undo for the index as well?

Yes. When inserting into a table with an index, there is considerably more undo created than when inserting into a table without an index

Here is an example:

Update emp set empno=15; when no one else is on the system.

In v$rollstat, these numbers were compared:

1,214,058 writes (no indexes)

4,688,328 writes (one index)

Update can cause a key to change, meaning Oracle is deleting from one part of the index and inserting into potentially an entirely different part of the index. If the block has to split then more undo is generated.

5. How does Oracle determine which rollback segment to use?

The rules are:

(i) always assign to rbs which has least number of active txns

(ii) if two or more rbs have the same “least number of active txns” , then assign to the one which is after the last one used. This ensures that undo is kept for a longer time.

6. Can a transaction span several rollback segments?

No. A transaction can span several extents but must remain in the same rollback segment throughout the duration of the transaction.

7. What do you record in the data block when DML occurs?

Here are the generic steps:

a. Pin the current version of the block in database buffer cache.

b. Write the change to the block in the buffer cache. This is the real change that was poited by DML.

c. Write the undo information to a redo record in the redo buffers.

d. Write the undo information to a block in the rollback segment.

e. Write the change to a redo record in the redo buffers.

f. LGWR writes out redo buffers at some later time. DBWR writes out the changed blocks at some later time. LGWR always writes out redo records before DBWR can write out the changed block.

g. When you commit, Oracle updates transaction table and record the SCN for that transaction.

Oracle, SQL scripts

Post navigation

Previous Post: logminer and my_lbu
Next Post: Session_info.ksh

Related Posts

  • Free conference number from http://www.freeconference.com Oracle
  • Optimizer_Index init.ora parameter explaination. Oracle
  • Oracle 11g Environment Setup Oracle
  • Drop all SPM baselines for SQL handle Oracle
  • All About oracle password and security from metalink Oracle
  • findobj.sql Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • My FTP Job Scheduling for www.pvmehta.com PHP/MYSQL/Wordpress
  • Proc Compilation Oracle
  • Useful Solaris Commands on 28-SEP-2005 Linux/Unix
  • Monitor and Trace Unix processes using truss Linux/Unix
  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle
  • How to check current redo log progress redo_progress.sql Oracle
  • Error Handling in Proc Oracle
  • how to find VIP from ifconfig Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme