The 7 Things I Know About Cyber Security After 25 Years | April 2024
Presentation Oracle Undo & Redo Structures
1. Oracle Senior DBA Group Linkedin
• Discussion started May 2016
– After a few days – Numerous Likes and Comments
– On Line Redo Logs
– Uncommitted Transactions in Redo Logs
– Log Group Switch Frequency
– Archived Redo Logs with entries still not committed
– Undo Segments
– Oracle Checkpoints
– Transaction Commits
• Response this short Presentation on
– Undo , Redo , Checkpoints , Commits
3. Components to Define & Understand
The Undo Tablespace
Is totally different in terms of usage and
structure when compared to
Redo Log Files
Database Checkpoints
ARE NOTHING TO DO WITH
Committing Transactions
4. UNDO TABLESPACE
• BEFORE images of changed Data Blocks
• USED for
– “Read Consistency”
– Transaction Rollback
– At Process Level (PMON)
– Flashback Query
– Flashback Version Query
– Flashback Transaction Query
– Flashback Transaction
– Flashback Table
5. Undo Tablespace
Objectives
– Reduce ORA-01555 Errors
– Allow for FLASHBACK if necessary
Decisions
– Size
– UNDO_RETENTION Parameter Value
– RETENTION [ NO ]GUARANTEE
Tools
– V$UNDOSTAT
6. Online Redo Log Files
• Mandatory for
– Database integrity & Good Performance
– Instance Recovery (SMON)
• Each Online Redo Log File is an
– Online Redo Log Member of an
– Online Redo Log Group
• Minimum Configuration
– 2 Groups each with 1 Member
• Suggested Minimum Configuration ?
– 3 Groups each with 2 Members (i.e. Multiplexed)
9. V$LOG
GROUP# NUMBER
THREAD# NUMBER
SEQUENCE# NUMBER
BYTES NUMBER
BLOCKSIZE NUMBER
MEMBERS NUMBER
ARCHIVED VARCHAR2(3)
STATUS VARCHAR2(16)
FIRST_CHANGE# NUMBER
FIRST_TIME DATE
NEXT_CHANGE# NUMBER
NEXT_TIME DATE
Online Redo Logs
V$LOGFILE
GROUP# NUMBER
STATUS VARCHAR2(7)
TYPE VARCHAR2(7)
MEMBER VARCHAR2(513)
IS_RECOVERY_
DEST_FILE
VARCHAR2(3)
Join on GROUP#
10. • Database Inconsistent
– e.g. Server Failure, Oracle Shutdown Abort
– Redo marked Open in Controlfile(s)
• Recovery is performed by SMON
– After Database has been Mounted, upon Opening
– No DBA intervention is required (apart from restarting)
– Brings Checkpoint Position to the Redo Tail
– Roll forward Committed Changes
– Rollback Uncommitted Changes
– Only uses Redo Entries (Change Vectors)
Instance Recovery
11. • Full Database Checkpoint
– SHUTDOWN [ NORMAL | IMMEDIATE | TRANSACTIONAL ]
– ALTER SYSTEM CHECKPOINT ;
– Online Redo Log File switch
– ALTER DATABASE BEGIN BACKUP ;
– (Note : New Storage Snapshot Optimization in 12c R1)
• Partial Database Checkpoint
– ALTER TABLESPACE ts_name OFFLINE [ NORMAL ]
– ALTER TABLESPACE ts_name READ ONLY;
– ALTER TABLESPACE ts_name BEGIN BACKUP ;
• Incremental Database Checkpoint
Database Checkpoints
12. • Incremental Database Checkpoint Parameters
– LOG_CHECKPOINT_INTERVAL ( OS Blocks )
– LOG_CHECKPOINT_TIMEOUT ( Seconds )
– FAST_START_MTTR_TARGET ( Seconds )
• Also note
– Size of the smallest Online Redo Log File
– LOG_CHECKPOINTS_TO_ALERT [ FALSE | TRUE ]
– SELECT name, value FROM v$sysstat
WHERE name LIKE ‘%checkpoint%’;
Database Checkpoints
13. Effect of Increase size of Redo Log Files
Redo Log TailCheckpoint Position
Checkpoint Position
Redo Log Tail
RECOVERY
RECOVERY
From
To
14. Effect of Decrease FAST_START_MMTR_TARGET
Redo Log TailCheckpoint Position
Checkpoint Position
Redo Log Tail
RECOVERY
RECOVERY
From
To
15. DBA’s Objectives
• Redo Log Files
– Protect against Single Point of Failure
– Two Members in each Group (Multiplexing)
• Checkpoints
– Balance Performance & Instance Recovery Times
– Decide how to Drive Checkpoints
– Redo Logfile Size
– FAST_START_MTTR_TARGET
– Check V$INSTANCE_RECOVERY
– ESTIMATED_MTTR
– TARGET_MTTR
– OPTIMAL_LOGFILE_SIZE
• ENSURE Service Level Agreement Compliance
16. Transactions - Commit
• A Transaction is a logical unit of work that contains one or
more SQL statements.
• Starts with
– DML
– DDL
• Ends with
– Explicit Commit
– Implicit Commit
– Rollback
– Process Failure
17. Compare Checkpoint to Commit
• Checkpoint
– Synchronises Memory & Disk
– Can Reduce Recovery Time
– Detrimental to performance if too Frequent
• Commit
– Per Single Transaction
– Guarantees permanency of a Single Transaction
– Write a “Fast Commit Marker” to On Line Redo Log
●
(SCN & Transaction Id)
18. Short Demonstration
Showing On-line Redo Logs have nothing to do
with Undo Segments
www.stormtime.co.uk www.speak-tech.com
John.Boyle@stormtime.co.uk