Vous êtes sur la page 1sur 30

Instance and Media

Recovery Structures

Copyright © Oracle Corporation, 2001. All rights reserved.


Objectives

After completing this lesson, you should be able to do


the following:
• Describe the Oracle processes, memory structures,
and files relating to recovery
• Identify the importance of checkpoints, redo log
files, and archived log files
• Describe ways to tune instance recovery

Copyright © Oracle Corporation, 2001. All rights reserved.


Overview
Instance
SGA Shared pool
Shared SQL
Java Pool Large Pool
and PL/SQL
User Server Database Redo log Data dict.
process process buffer cache buffer cache
PGA
SMON DBWn PMON CKPT LGWR ARCn

Datafile 1 Control Redo log


file file 1
Parameter Redo log
Datafile 2
file file 2
Datafile 3 Archived
Password
file log files
Database

Copyright © Oracle Corporation, 2001. All rights reserved.


Large Pool

• Can be configured as a separate memory area in the


SGA to be used for:
– Oracle backup and restore operations
– I/O server processes
– Session memory for the shared servers
• Is sized by the LARGE_POOL_SIZE parameter

Copyright © Oracle Corporation, 2001. All rights reserved.


Database Buffer Cache, DBWn,
and Datafiles
Instance
SGA Shared pool
Shared SQL
Java pool Large pool
and PL/SQL
User Server Database Redo log Data dict.
process process buffer cache buffer cache
PGA
SMON DBW0 PMON CKPT LGWR ARCn
DBW1

Datafile 1 Control Redo log


file file 1
Parameter Datafile 2 Redo log
file file 2

Datafile 3
Password Archived
file Database log files

Copyright © Oracle Corporation, 2001. All rights reserved.


Redo Log Buffer, LGWR,
and Redo Log Files
Instance
SGA Shared pool
Shared SQL
Java pool Large pool
and PL/SQL
User Server Database Redo log Data dict.
process process buffer cache buffer cache
PGA
SMON DBWn PMON CKPT LGWR ARCn

Datafile 1 Control Redo log


file file 1
Parameter Redo log
file Datafile 2
file 2

Datafile 3
Password Archived
file log files
Database

Copyright © Oracle Corporation, 2001. All rights reserved.


Multiplexed Redo Log Files

Group 1 Group 2 Group 3

Disk 1
(Member a)
log1a.rdo log2a.rdo log3a.rdo

Disk 2
(Member b)
log1b.rdo log2b.rdo log3b.rdo

Copyright © Oracle Corporation, 2001. All rights reserved.


Redo Log Files in Enterprise Manager

Copyright © Oracle Corporation, 2001. All rights reserved.


Checkpointing

• Checkpoints are used to determine where recovery


should start.
• Checkpoint position – where recovery starts
• Checkpoint queue – link list of dirty blocks

Copyright © Oracle Corporation, 2001. All rights reserved.


Types of Checkpoints

• Full checkpoint
– All dirty buffers are written
– SHUTDOWN NORMAL, IMMEDIATE, or TRANSACTIONAL
– ALTER SYSTEM CHECKPOINT
• Incremental checkpoint (Fast-Start checkpoint)
– Periodic writes
– Only write the oldest blocks
• Partial checkpoint
– Dirty buffers belonging to the tablespace
– ALTER TABLESPACE BEGIN BACKUP
– ALTER TABLESPACE tablespace OFFLINE NORMAL

Copyright © Oracle Corporation, 2001. All rights reserved.


CKPT Process
Instance
SGA Shared pool
Shared SQL
Java pool Large pool
and PL/SQL
User Server Database Redo log Data dict.
process process buffer cache buffer cache
PGA
SMON DBWn PMON CKPT LGWR ARCn

Datafile 1 Control Redo log


file file 1
Parameter Redo log
file Datafile 2
file 2

Datafile 3
Password Archived
file log files
Database

Copyright © Oracle Corporation, 2001. All rights reserved.


Multiplexed Control Files
Instance
SGA Shared pool
Shared SQL
Java pool Large pool
and PL/SQL
User Server Database Redo log Data dict.
process process buffer cache buffer cache
PGA
SMON DBWn PMON CKPT LGWR ARCn

Datafile 1 Redo log


Control file 1
files
Parameter Redo log
file Datafile 2
file 2

Datafile 3
Password Archived
file log files
Database

Copyright © Oracle Corporation, 2001. All rights reserved.


Control Files in Enterprise Manager

Copyright © Oracle Corporation, 2001. All rights reserved.


ARCn Process and Archived Log Files
Instance
SGA Shared pool
Shared SQL
Java pool Large pool and PL/SQL
User Server Database Redo log Data dict.
process process buffer cache buffer cache
PGA
SMON DBWn PMON CKPT LGWR ARC0
ARC1

Datafile 1 Control Redo log


file file 1
Parameter Redo log Archived
Datafile 2 log files
file file 2
dest 2
Datafile 3
Password Archived
file Database log files
dest 1

Copyright © Oracle Corporation, 2001. All rights reserved.


Database Synchronization

• All datafiles (except offline and read-only) must be


synchronized for the database to open.
• Synchronization is based on the current
checkpoint number.
• Applying changes recorded in the redo log files
synchronizes datafiles.
• Redo log files are automatically requested by the
Oracle server.

Copyright © Oracle Corporation, 2001. All rights reserved.


Phases for Instance Recovery

1. Datafiles out-of-synch
Instance
2. Roll forward (redo)
SGA
3. Committed and non- Shared pool
committed data in files Shared SQL
Java pool Large pool
and PL/SQL
4. Roll back (undo)
Database Redo log Data dict.
5. Committed data in files buffer cache buffer cache

SQL*Plus Server SMON DBWn PMON CKPT LGWR ARCn


process
PGA
146.5 146.5 146.5
Control Redo log
Datafile 1 file file 1
146.5 145 Checkpoint
Undo Redo log
Datafile file 2
146.5
Undo Datafile 3

Database

Copyright © Oracle Corporation, 2001. All rights reserved.


Tuning Crash and Instance
Recovery Performance

• Tuning the duration of instance and crash recovery


• Tuning the phases of instance recovery

Copyright © Oracle Corporation, 2001. All rights reserved.


Tuning the Duration of Instance
and Crash Recovery

Methods to keep the duration of instance and crash


recovery within user-specified bounds:
• Set initialization parameters to influence the number
of redo log records and data blocks involved in
recovery.
• Size the redo log file to influence checkpointing
frequency.
• Issue SQL statements to initiate checkpoints.
• Parallelize instance recovery operations.

Copyright © Oracle Corporation, 2001. All rights reserved.


Initialization Parameters Influencing
Checkpoints

Parameter Definition

FAST_START_MTTR_TARGET Expected MTTR specified in seconds


Amount of time that has passed
LOG_CHECKPOINT_TIMEOUT
since the incremental checkpoint at
the position where the last write to
the redo log occurred
LOG_CHECKPOINT_INTERVAL Number of redo log file blocks that
can exist between an incremental
checkpoint and the last block written
to the redo log

Copyright © Oracle Corporation, 2001. All rights reserved.


Controlling Instance Crash Recovery Time

Copyright © Oracle Corporation, 2001. All rights reserved.


V$INSTANCE_RECOVERY

• Used to monitor the mechanisms available to limit


recovery I/O
• Statistics from this view to calculate which
parameter has the greatest influence on
checkpointing.

Copyright © Oracle Corporation, 2001. All rights reserved.


Tuning the Phases of
Crash and Instance Recovery

• Tuning the roll forward phase


• Tuning the rollback phase

Copyright © Oracle Corporation, 2001. All rights reserved.


Tuning the Rolling Forward Phase

• Parallel block recovery


• RECOVERY_PARALLELISM specifies the number of
concurrent recovery processes

Copyright © Oracle Corporation, 2001. All rights reserved.


Tuning the Rolling Back Phase

• Fast-start on-demand rollback


• Fast-start parallel rollback

Copyright © Oracle Corporation, 2001. All rights reserved.


Fast-Start On-Demand Rollback

Server process encountering data to be rolled back


performs the following:
• Rolls back the block containing the required row
• Hands off further recovery, which may be in parallel,
to SMON

Improved
response

Copyright © Oracle Corporation, 2001. All rights reserved.


Fast-Start Parallel Rollback

SMON

P000

P001

P002

P003
Undo
Tables
segment

Copyright © Oracle Corporation, 2001. All rights reserved.


Controlling Fast-Start Parallel Rollback

FAST_START_PARALLEL_ROLLBACK parameter

Value Maximum Parallel Recovery Servers

FALSE None

LOW (default) 2 * CPU_COUNT

HIGH 4 * CPU_COUNT

Copyright © Oracle Corporation, 2001. All rights reserved.


Monitoring Parallel Rollback

• V$FAST_START_SERVERS
• V$FAST_START_TRANSACTIONS

Copyright © Oracle Corporation, 2001. All rights reserved.


Summary

In this lesson, you should have learned how to:


• Identify components of the instance and database
that are significant to recovery
• Tune crash and instance recovery

Copyright © Oracle Corporation, 2001. All rights reserved.


Practice 7 Overview

This practice covers the following topics:


• Querying dynamic performance views to determine
the current state and structure of the database
• Explaining the use of specific initialization
parameters
• Mirroring of the control files and redo log files

Copyright © Oracle Corporation, 2001. All rights reserved.

Vous aimerez peut-être aussi