DBAI_les07_Rev1_1

Views:
 
Category: Entertainment
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Maintaining Redo Log Files:

Maintaining Redo Log Files

Objectives:

Objectives After completing this lesson, you should be able to do the following: Explain the purpose of online redo log files Outline the structure of online redo log files Control log switches and checkpoints Multiplex and maintain online redo log files Manage online redo logs files with OMF

Using Redo Log Files:

Using Redo Log Files Redo log files have the following characteristics: Record all changes made to data Provide a recovery mechanism Can be organized into groups At least two groups required Redo Log files

Structure of Redo Log Files:

Structure of Redo Log Files Group 2 Group 3 Group 1 Member Disk 1 Disk 2 Member Member Member Member Member

How Redo Log Files Work:

How Redo Log Files Work Redo log files are used in a cyclic fashion. When a redo log file is full, LGWR will move to the next log group. Called a log switch Checkpoint operation also occurs Information written to the control file

Forcing Log Switches and Checkpoints:

Forcing Log Switches and Checkpoints Forcing a log switch: Checkpoints can be forced by using: Setting FAST_START_MTTR_TARGET parameter ALTER SYSTEM CHECKPOINT command ALTER SYSTEM CHECKPOINT; ALTER SYSTEM SWITCH LOGFILE; FAST_START_MTTR_TARGET = 600

Adding Online Redo Log File Groups:

Adding Online Redo Log File Groups Group 1 Group 2 Group 3 ALTER DATABASE ADD LOGFILE GROUP 3 ('$HOME/ORADATA/u01/log3a.rdo', '$HOME/ORADATA/u02/log3b.rdo') SIZE 1M; log3b.rdo log3a.rdo log1a.rdo log1b.rdo log2a.rdo log2b.rdo

Adding Online Redo Log File Members:

Adding Online Redo Log File Members ALTER DATABASE ADD LOGFILE MEMBER '$HOME/ORADATA/u04/log1c.rdo' TO GROUP 1, '$HOME/ORADATA/u04/log2c.rdo' TO GROUP 2, '$HOME/ORADATA/u04/log3c.rdo' TO GROUP 3; Group 1 Group 2 Group 3 log1a.rdo log1b.rdo log2a.rdo log2b.rdo log1c.rdo log2c.rdo log3a.rdo log3b.rdo log3c.rdo

Dropping Online Redo Log File Groups:

Dropping Online Redo Log File Groups ALTER DATABASE DROP LOGFILE GROUP 3; log1a.rdo log2a.rdo log3a.rdo Group 1 Group 2 Group 3

Dropping Online Redo Log File Members:

Dropping Online Redo Log File Members ALTER DATABASE DROP LOGFILE MEMBER '$HOME/ORADATA/u04/log3c.rdo'; Group 1 Group 2 log1b.rdo log1c.rdo log1a.rdo log1b.rdo log2c.rdo log1a.rdo

Relocating or Renaming Online Redo Log Files :

Relocating or Renaming Online Redo Log Files Relocate or rename online redo log files in one of the two following ways: ALTER DATABASE CLEAR LOGFILE command Copy the online redo log files to the new location Execute the command Add new members and drop old members ALTER DATABASE CLEAR LOGFILE '$HOME/ORADATA/u01/log2a.rdo';

Online Redo Log File Configuration:

Online Redo Log File Configuration Group 2 Group 3 Group 1 Disk 3 Disk 2 Disk 1 ? Member Member Member Member Member

Managing Online Redo Log Files with OMF:

Managing Online Redo Log Files with OMF Define the DB_CREATE_ONLINE_LOG_DEST_n parameter: Group can be added with no file specification: Dropping a group: DB_CREATE_ONLINE_LOG_DEST_1 DB_CREATE_ONLINE_LOG_DEST_2 ALTER DATABASE DROP LOGFILE GROUP 3; ALTER DATABASE ADD LOGFILE;

Obtaining Group and Member Information:

Obtaining Group and Member Information Information about a group and its members can be obtained by querying the following views: V$LOG V$LOGFILE

Archived Redo Log Files :

Archived Redo Log Files Filled online redo log files can be archived. There are two advantages in running the database in ARCHIVELOG mode and archiving redo log files: Recovery: A database backup together with online and archived redo log files can guarantee recovery of all committed transactions. Backup: This can be performed while the database is open. By default, database is created in NOARCHIVELOG mode.

Archived Redo Log Files :

Archived Redo Log Files Accomplished automatically by ARCn Accomplished manually through SQL statements When successfully archived: An entry in the control file is made Records: archive log name, log sequence number, and high and low system change number (SCN) Filled redo log file cannot be reused until: A checkpoint has taken place File has been archived by ARCn Can be multiplexed Maintained by the DBA

Summary:

Summary In this lesson, you should have learned how to: Explain the use of online redo log files Obtain redo log file information Control log switches and checkpoints Multiplex and maintain online redo log files Manage online redo log files with OMF

Practice 7 Overview:

Practice 7 Overview This practice covers the following topics: Creating online redo log file groups and members Maintaining online redo log file groups and members Managing online redo log files using OMF

authorStream Live Help