SlideShare una empresa de Scribd logo
1 de 31
Oracle9i Database Administrator: Implementation and Administration 1
Chapter 5
The Redo Log Files
Oracle9i Database Administrator: Implementation and Administration 2
Objectives
 Learn to describe redo log files,
groups, and members
 Manage redo log groups and
members
Oracle9i Database Administrator: Implementation and Administration 3
Introduction to Online
Redo Log Files
Online redo log files store details as
the database is used including:
 Checkpoints
 Data Changes (DML)
 Structural changes (DDL)
 Data file changes
Oracle9i Database Administrator: Implementation and Administration 4
Oracle9i Architecture: A Typical Server
Oracle9i Database Administrator: Implementation and Administration 5
Introduction to Online
Redo Log Files
Components:
•Redo log group
•Online redo log
file or member
•Archived redo
log file
•ARCn
Oracle9i Database Administrator: Implementation and Administration 6
Introduction to Online
Redo Log Files
Components:
•Redo log buffer
•LGWR
•CKPT
Oracle9i Database Administrator: Implementation and Administration 7
Introduction to Online
Redo Log Files
File 1 is written to
File A by the
ARCn process
after the log
switch is
complete
Oracle9i Database Administrator: Implementation and Administration 8
Introduction to Online
Redo Log Files
File 1 and File 3
are written to by
the LGWR
process
simultaneously
until both are full
Oracle9i Database Administrator: Implementation and Administration 9
The Purpose of Redo Log Files
Redo log files aid in recovery from short term
data loss such as brief power outage:
 Store changes that may not be written to the
data files yet
 Store checkpoints to allow recovery to
resynchronize data files with correct changes
 Cannot completely handle recovery from
major loss such as an entire data file
Oracle9i Database Administrator: Implementation and Administration 10
The Purpose of Redo Log Files
Recovery procedures (overview):
Prior to failure:
 Perform full database backup regularly
 Run database in ARCHIVELOG mode
After failure:
 Restore from full backup
 Apply archived redo log files (oldest to newest)
 Apply online redo log file
Oracle9i Database Administrator: Implementation and Administration 11
The Structure of Redo Log Files
Redo log buffer is flushed to the redo log
file when:
 A transaction COMMITS
 The redo log buffer becomes 1/3 full
 The redo log buffer contains >1 M of
updated records
 A checkpoint occurs
Oracle9i Database Administrator: Implementation and Administration 12
The Structure of Redo Log Files
Redo log file components:
 Redo record (also called redo entry)
 Relates to one data block
 Made up of one or more change vectors
Oracle9i Database Administrator: Implementation and Administration 13
Managing Redo Log Files
The COMMIT
command tells
the database to
log the
changes to the
redo log file
Oracle9i Database Administrator: Implementation and Administration 14
Log Switches and Checkpoints
 To manually signal a log switch:
ALTER SYSTEM SWITCH LOGFILE;
 A log switch triggers a checkpoint
 Checkpoint is a signal to write all dirty
buffers to the appropriate files
 Checkpoint increments the System
Change Number (SCN)
Oracle9i Database Administrator: Implementation and Administration 15
Log Switches and Checkpoints
How the SCN is used:
 SCN is recorded in the redo log buffer
 SCN is recorded in the header of each
data file that was written to
 During recovery, SCN of each datafile is
compared to the SCN in the redo log file
 If a match, the data file is up to date
 If redo log file has higher SCN, changes are
reapplied to the data file from the redo log file
Oracle9i Database Administrator: Implementation and Administration 16
Multiplexing and Other
Maintenance
 Multiplexed redo log files requires multiple
members in each group
 A log group continues to function as long as
it has at least one good member
 If all members of the current group become
damaged, the database forces a log switch
 The database shuts down immediately if a
log switch fails
Oracle9i Database Administrator: Implementation and Administration 17
Adding a Member to a Group
 Add members to groups while the database is
running
 Do not specify SIZE because new members
are automatically assigned the same size as
other members in the group
 Command syntax:
ALTER DATABASE ADD LOGFILE MEMBER '<X:xxx><filename>'
TO GROUP <n>;
Oracle9i Database Administrator: Implementation and Administration 18
Adding a New Group
 Add a new group while the database is
running
 Specify SIZE and group number
 List all members to be created with the
group (must be at least one)
 Command syntax:
ALTER DATABASE ADD LOGFILE GROUP <n>
( '<X:xxx><filename>', '<X:xxx><filename>')
SIZE <n>;
Oracle9i Database Administrator: Implementation and Administration 19
Renaming or Moving
a Redo Log File
 Must be done while the group is not
ACTIVE
 Steps:
1. Shut down the database:
SHUTDOWN IMMEDIATE
2. Rename or relocate files using the operating
system
3. Mount the database
STARTUP MOUNT
Oracle9i Database Administrator: Implementation and Administration 20
Renaming or Moving
a Redo Log File
 Steps (continued):
4. Inform database of changed file name:
ALTER DATABASE
RENAME FILE '<X:xxx><oldfilename1>',
'<X:xxx><oldfilename2>'
TO '<X:xxx><newfilename1>',
'<X:xxx><newfilename2>';
5. Open the database:
ALTER DATABASE OPEN;
Oracle9i Database Administrator: Implementation and Administration 21
Dropping Redo Log Members
or Groups
Reasons for dropping members or
groups:
 Bad disk, so must recreate member
 Tuning recommendation calls for
reducing members or groups
 Corrupted members can be deleted
and replaced later
Oracle9i Database Administrator: Implementation and Administration 22
Dropping Redo Log Members
or Groups
 Rules when dropping redo log members:
 Each group must have at least one member
 The group affected must not be ACTIVE and (if in
ARCHIVELOG mode) must be archived
 Rule when dropping groups:
 Database requires at least two groups
 The group affected must not be ACTIVE and (if in
ARCHIVELOG mode) must be archived
Oracle9i Database Administrator: Implementation and Administration 23
Dropping Redo Log Members or
Groups
Steps to drop redo log member:
1. Query V$LOG to confirm that group is
inactive
2. Drop redo log member:
ALTER DATABASE DROP LOGFILE MEMBER
'<X:xxx><filename>';
3. Delete associated file in the operating
system
Oracle9i Database Administrator: Implementation and Administration 24
Dropping Redo Log Members or
Groups
Steps to drop redo log group:
1. Query V$LOG to confirm that group is
inactive: SELECT * FROM V$LOG;
2. Drop redo log group:
ALTER DATABASE DROP LOGFILE GROUP <n>;
3. Delete associated file(s) in the operating
system
Oracle9i Database Administrator: Implementation and Administration 25
Dropping Redo Log Members or
Groups
Additional notes:
 If group is ACTIVE, force log switch:
ALTER SYSTEM SWITCH LOGFILE;
 If group still active, force checkpoint:
ALTER SYSTEM CHECKPOINT;
 An alternative to dropping a corrupt group and
recreating the members:
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP <n>;
Oracle9i Database Administrator: Implementation and Administration 26
Archiving a Redo Log Group
Advantages of archiving redo log groups:
 Point-in-time recovery to a point earlier
than online redo log files contain
 The ability to query archived log files with
LogMiner
 The ability to set up and maintain a
standby database
Oracle9i Database Administrator: Implementation and Administration 27
Finding Redo Log Information in
Data Dictionary Views
States of a redo log group:
 UNUSED
 CURRENT
 ACTIVE
 CLEARING
 CLEARING_CURRENT
 INACTIVE
Oracle9i Database Administrator: Implementation and Administration 28
Viewing Control File Data
Oracle9i Database Administrator: Implementation and Administration 29
Chapter Summary
 Redo log files primarily contain information on
database changes
 A database has at least two redo log groups
 A redo log group has at least one member
 Redo log files support automatic recovery
from minor failures
 A redo log group with multiple files is
multiplexed
Oracle9i Database Administrator: Implementation and Administration 30
Chapter Summary
 The SCN is incremented at a checkpoint
 Maintenance you can do with redo log files
and groups:
 Add a new file (member) to a group
 Add a new group
 Rename or relocate a member
 Drop a member
 Drop a group
 Clear a group
Oracle9i Database Administrator: Implementation and Administration 31
Chapter Summary
 Placing a database in ARCHIVELOG
mode causes redo log files to be
archived after a log switch
 Many initialization parameters set the
behavior of the archiving function
 The V$LOG and V$LOGFILES dynamic
performance views display information
about redo log groups and members

Más contenido relacionado

Similar a chap05-info366.ppt

Capitulo 01 Dba 2
Capitulo 01 Dba 2Capitulo 01 Dba 2
Capitulo 01 Dba 2Julio Pari
 
Ensuring Data Protection Using Oracle Flashback Features - Presentation
Ensuring Data Protection Using Oracle Flashback Features - PresentationEnsuring Data Protection Using Oracle Flashback Features - Presentation
Ensuring Data Protection Using Oracle Flashback Features - PresentationPini Dibask
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recoveryArun Sharma
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recoveryaltistory
 
ORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAININGORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAININGsapcrmtraining
 
ORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAININGORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAININGtraining3
 
Oracle core dba online training
Oracle core dba online trainingOracle core dba online training
Oracle core dba online trainingSanthosh Reddy
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Recvivaankumar
 
Oracle Instance Architecture.ppt
Oracle Instance Architecture.pptOracle Instance Architecture.ppt
Oracle Instance Architecture.pptHODCA1
 
Oracle Architecture
Oracle ArchitectureOracle Architecture
Oracle ArchitectureNeeraj Singh
 
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy ReyesSpanishPASSVC
 
Best New Features of Oracle Database 12c
Best New Features of Oracle Database 12cBest New Features of Oracle Database 12c
Best New Features of Oracle Database 12cPini Dibask
 
What is new on 12c for Backup and Recovery? Presentation
What is new on 12c for Backup and Recovery? PresentationWhat is new on 12c for Backup and Recovery? Presentation
What is new on 12c for Backup and Recovery? PresentationFrancisco Alvarez
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery ProcedureAnar Godjaev
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLéopold Gault
 

Similar a chap05-info366.ppt (20)

Capitulo 01 Dba 2
Capitulo 01 Dba 2Capitulo 01 Dba 2
Capitulo 01 Dba 2
 
Ensuring Data Protection Using Oracle Flashback Features - Presentation
Ensuring Data Protection Using Oracle Flashback Features - PresentationEnsuring Data Protection Using Oracle Flashback Features - Presentation
Ensuring Data Protection Using Oracle Flashback Features - Presentation
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recovery
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
 
Oracle Database Administration 11g Course Content
Oracle Database Administration 11g Course ContentOracle Database Administration 11g Course Content
Oracle Database Administration 11g Course Content
 
Missing redo logs in oracle
Missing redo logs in oracleMissing redo logs in oracle
Missing redo logs in oracle
 
ORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAININGORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAINING
 
ORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAININGORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAINING
 
Oracle core dba online training
Oracle core dba online trainingOracle core dba online training
Oracle core dba online training
 
Creating database
Creating databaseCreating database
Creating database
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
 
Oracle Instance Architecture.ppt
Oracle Instance Architecture.pptOracle Instance Architecture.ppt
Oracle Instance Architecture.ppt
 
Oracle Architecture
Oracle ArchitectureOracle Architecture
Oracle Architecture
 
Less15 Backups
Less15 BackupsLess15 Backups
Less15 Backups
 
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
 
Best New Features of Oracle Database 12c
Best New Features of Oracle Database 12cBest New Features of Oracle Database 12c
Best New Features of Oracle Database 12c
 
What is new on 12c for Backup and Recovery? Presentation
What is new on 12c for Backup and Recovery? PresentationWhat is new on 12c for Backup and Recovery? Presentation
What is new on 12c for Backup and Recovery? Presentation
 
Less01 Dba1
Less01 Dba1Less01 Dba1
Less01 Dba1
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 Days
 

Más de KalsoomTahir2

Más de KalsoomTahir2 (20)

005813616.pdf
005813616.pdf005813616.pdf
005813616.pdf
 
009576860.pdf
009576860.pdf009576860.pdf
009576860.pdf
 
005813185.pdf
005813185.pdf005813185.pdf
005813185.pdf
 
HASH FUNCTIONS.pdf
HASH FUNCTIONS.pdfHASH FUNCTIONS.pdf
HASH FUNCTIONS.pdf
 
6. McCall's Model.pptx
6. McCall's Model.pptx6. McCall's Model.pptx
6. McCall's Model.pptx
 
ch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.pptch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.ppt
 
9223301.ppt
9223301.ppt9223301.ppt
9223301.ppt
 
11885558.ppt
11885558.ppt11885558.ppt
11885558.ppt
 
Indexing.ppt
Indexing.pptIndexing.ppt
Indexing.ppt
 
1650607.ppt
1650607.ppt1650607.ppt
1650607.ppt
 
005281271.pdf
005281271.pdf005281271.pdf
005281271.pdf
 
soa_and_jra.ppt
soa_and_jra.pptsoa_and_jra.ppt
soa_and_jra.ppt
 
ERP_Up_Down.ppt
ERP_Up_Down.pptERP_Up_Down.ppt
ERP_Up_Down.ppt
 
Topic1CourseIntroduction.ppt
Topic1CourseIntroduction.pptTopic1CourseIntroduction.ppt
Topic1CourseIntroduction.ppt
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
 
CommercialSystemsBahman.ppt
CommercialSystemsBahman.pptCommercialSystemsBahman.ppt
CommercialSystemsBahman.ppt
 
EJBDetailsFeb25.ppt
EJBDetailsFeb25.pptEJBDetailsFeb25.ppt
EJBDetailsFeb25.ppt
 
jan28EAI.ppt
jan28EAI.pptjan28EAI.ppt
jan28EAI.ppt
 
005428052.pdf
005428052.pdf005428052.pdf
005428052.pdf
 
jini-1.ppt
jini-1.pptjini-1.ppt
jini-1.ppt
 

Último

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 

Último (20)

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 

chap05-info366.ppt

  • 1. Oracle9i Database Administrator: Implementation and Administration 1 Chapter 5 The Redo Log Files
  • 2. Oracle9i Database Administrator: Implementation and Administration 2 Objectives  Learn to describe redo log files, groups, and members  Manage redo log groups and members
  • 3. Oracle9i Database Administrator: Implementation and Administration 3 Introduction to Online Redo Log Files Online redo log files store details as the database is used including:  Checkpoints  Data Changes (DML)  Structural changes (DDL)  Data file changes
  • 4. Oracle9i Database Administrator: Implementation and Administration 4 Oracle9i Architecture: A Typical Server
  • 5. Oracle9i Database Administrator: Implementation and Administration 5 Introduction to Online Redo Log Files Components: •Redo log group •Online redo log file or member •Archived redo log file •ARCn
  • 6. Oracle9i Database Administrator: Implementation and Administration 6 Introduction to Online Redo Log Files Components: •Redo log buffer •LGWR •CKPT
  • 7. Oracle9i Database Administrator: Implementation and Administration 7 Introduction to Online Redo Log Files File 1 is written to File A by the ARCn process after the log switch is complete
  • 8. Oracle9i Database Administrator: Implementation and Administration 8 Introduction to Online Redo Log Files File 1 and File 3 are written to by the LGWR process simultaneously until both are full
  • 9. Oracle9i Database Administrator: Implementation and Administration 9 The Purpose of Redo Log Files Redo log files aid in recovery from short term data loss such as brief power outage:  Store changes that may not be written to the data files yet  Store checkpoints to allow recovery to resynchronize data files with correct changes  Cannot completely handle recovery from major loss such as an entire data file
  • 10. Oracle9i Database Administrator: Implementation and Administration 10 The Purpose of Redo Log Files Recovery procedures (overview): Prior to failure:  Perform full database backup regularly  Run database in ARCHIVELOG mode After failure:  Restore from full backup  Apply archived redo log files (oldest to newest)  Apply online redo log file
  • 11. Oracle9i Database Administrator: Implementation and Administration 11 The Structure of Redo Log Files Redo log buffer is flushed to the redo log file when:  A transaction COMMITS  The redo log buffer becomes 1/3 full  The redo log buffer contains >1 M of updated records  A checkpoint occurs
  • 12. Oracle9i Database Administrator: Implementation and Administration 12 The Structure of Redo Log Files Redo log file components:  Redo record (also called redo entry)  Relates to one data block  Made up of one or more change vectors
  • 13. Oracle9i Database Administrator: Implementation and Administration 13 Managing Redo Log Files The COMMIT command tells the database to log the changes to the redo log file
  • 14. Oracle9i Database Administrator: Implementation and Administration 14 Log Switches and Checkpoints  To manually signal a log switch: ALTER SYSTEM SWITCH LOGFILE;  A log switch triggers a checkpoint  Checkpoint is a signal to write all dirty buffers to the appropriate files  Checkpoint increments the System Change Number (SCN)
  • 15. Oracle9i Database Administrator: Implementation and Administration 15 Log Switches and Checkpoints How the SCN is used:  SCN is recorded in the redo log buffer  SCN is recorded in the header of each data file that was written to  During recovery, SCN of each datafile is compared to the SCN in the redo log file  If a match, the data file is up to date  If redo log file has higher SCN, changes are reapplied to the data file from the redo log file
  • 16. Oracle9i Database Administrator: Implementation and Administration 16 Multiplexing and Other Maintenance  Multiplexed redo log files requires multiple members in each group  A log group continues to function as long as it has at least one good member  If all members of the current group become damaged, the database forces a log switch  The database shuts down immediately if a log switch fails
  • 17. Oracle9i Database Administrator: Implementation and Administration 17 Adding a Member to a Group  Add members to groups while the database is running  Do not specify SIZE because new members are automatically assigned the same size as other members in the group  Command syntax: ALTER DATABASE ADD LOGFILE MEMBER '<X:xxx><filename>' TO GROUP <n>;
  • 18. Oracle9i Database Administrator: Implementation and Administration 18 Adding a New Group  Add a new group while the database is running  Specify SIZE and group number  List all members to be created with the group (must be at least one)  Command syntax: ALTER DATABASE ADD LOGFILE GROUP <n> ( '<X:xxx><filename>', '<X:xxx><filename>') SIZE <n>;
  • 19. Oracle9i Database Administrator: Implementation and Administration 19 Renaming or Moving a Redo Log File  Must be done while the group is not ACTIVE  Steps: 1. Shut down the database: SHUTDOWN IMMEDIATE 2. Rename or relocate files using the operating system 3. Mount the database STARTUP MOUNT
  • 20. Oracle9i Database Administrator: Implementation and Administration 20 Renaming or Moving a Redo Log File  Steps (continued): 4. Inform database of changed file name: ALTER DATABASE RENAME FILE '<X:xxx><oldfilename1>', '<X:xxx><oldfilename2>' TO '<X:xxx><newfilename1>', '<X:xxx><newfilename2>'; 5. Open the database: ALTER DATABASE OPEN;
  • 21. Oracle9i Database Administrator: Implementation and Administration 21 Dropping Redo Log Members or Groups Reasons for dropping members or groups:  Bad disk, so must recreate member  Tuning recommendation calls for reducing members or groups  Corrupted members can be deleted and replaced later
  • 22. Oracle9i Database Administrator: Implementation and Administration 22 Dropping Redo Log Members or Groups  Rules when dropping redo log members:  Each group must have at least one member  The group affected must not be ACTIVE and (if in ARCHIVELOG mode) must be archived  Rule when dropping groups:  Database requires at least two groups  The group affected must not be ACTIVE and (if in ARCHIVELOG mode) must be archived
  • 23. Oracle9i Database Administrator: Implementation and Administration 23 Dropping Redo Log Members or Groups Steps to drop redo log member: 1. Query V$LOG to confirm that group is inactive 2. Drop redo log member: ALTER DATABASE DROP LOGFILE MEMBER '<X:xxx><filename>'; 3. Delete associated file in the operating system
  • 24. Oracle9i Database Administrator: Implementation and Administration 24 Dropping Redo Log Members or Groups Steps to drop redo log group: 1. Query V$LOG to confirm that group is inactive: SELECT * FROM V$LOG; 2. Drop redo log group: ALTER DATABASE DROP LOGFILE GROUP <n>; 3. Delete associated file(s) in the operating system
  • 25. Oracle9i Database Administrator: Implementation and Administration 25 Dropping Redo Log Members or Groups Additional notes:  If group is ACTIVE, force log switch: ALTER SYSTEM SWITCH LOGFILE;  If group still active, force checkpoint: ALTER SYSTEM CHECKPOINT;  An alternative to dropping a corrupt group and recreating the members: ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP <n>;
  • 26. Oracle9i Database Administrator: Implementation and Administration 26 Archiving a Redo Log Group Advantages of archiving redo log groups:  Point-in-time recovery to a point earlier than online redo log files contain  The ability to query archived log files with LogMiner  The ability to set up and maintain a standby database
  • 27. Oracle9i Database Administrator: Implementation and Administration 27 Finding Redo Log Information in Data Dictionary Views States of a redo log group:  UNUSED  CURRENT  ACTIVE  CLEARING  CLEARING_CURRENT  INACTIVE
  • 28. Oracle9i Database Administrator: Implementation and Administration 28 Viewing Control File Data
  • 29. Oracle9i Database Administrator: Implementation and Administration 29 Chapter Summary  Redo log files primarily contain information on database changes  A database has at least two redo log groups  A redo log group has at least one member  Redo log files support automatic recovery from minor failures  A redo log group with multiple files is multiplexed
  • 30. Oracle9i Database Administrator: Implementation and Administration 30 Chapter Summary  The SCN is incremented at a checkpoint  Maintenance you can do with redo log files and groups:  Add a new file (member) to a group  Add a new group  Rename or relocate a member  Drop a member  Drop a group  Clear a group
  • 31. Oracle9i Database Administrator: Implementation and Administration 31 Chapter Summary  Placing a database in ARCHIVELOG mode causes redo log files to be archived after a log switch  Many initialization parameters set the behavior of the archiving function  The V$LOG and V$LOGFILES dynamic performance views display information about redo log groups and members