The Oracle Redo log files: add, drop and alter

Wednesday, May 17 2006 @ 10:20 AM CDT

Contributed by: sv800

Oracle Online Redo log files, adding redo log file to groups, dropping, renaming and relocating redo log files.

The main purpose of the Oracle redo log files is to recover and “redo” the transactions in case of a database failure.

The update transactions are being written to both, data files and redo log files to be used in case of a crash.

Exception to this rule is the use of the clause NOLOGGING option in a direct load inserts. It will cause that REDO LOG files no being updated. 

Typical configuration requires 3 Online Redo Log Files or at least two.
A second disk configuration is recommended.

The organization is in groups and the update of the Redo file is cyclic and sequentially. 

How to add Online Redo Log File Groups

Assuming Oracle already have group 1 and group 2, this command will create a third group (Unix directory):

ALTER DATABASE ADD LOGFILE GROUP 3
(‘$HOME/ORADATA/directory/log3a.rdo’,
‘$HOME/ORADATA/directory/log3b.rdo’)
SIZE 1 M;

Multiplexing the Redo Log Files: procedure to have 2 or more copies of the redo log files in different disks.

How to drop Oracle online redo log files:

ALTER DATABASE DROP LOGFILE GROUP 3;
(Drop all group 3 redo log file)

ALTER DATABASE DROP LOGFILE MEMBER 
‘$HOME/ORADATA/directory/log3a.rdo’
(Drop the group member file only)

Before dropping a Log File: 
- Cannot be active at time of dropping, need to switch to other redo log file before dropping the log file. The system needs a valid member on the group, same to say you can delete all file members from a redo log file.
- Why the disk space is not available after dropping a member of a redo log file group? The process does no delete the physical dropped log files from directory. The files need to de deleted using the operating system commands. (unix command to delete a file: rm file.name)

How rename and relocate an Oracle online redo log files:

ALTER DATABASE RENAME FILE ‘$HOME/ORADATA/directory/log3a.rdo’ TO
‘$HOME/ORADATA/newdirectory/log3b.rdo’;

Before renaming and relocating Redo Log Files
- Shutdown the database
- Open the database mount but not open
- Execute the rename command
- Open the database as a normal (OPEN).

0 comments



http://peoplecnc.com/whitepapers/article.php?story=20060517102036880