Database Reference
In-Depth Information
Adding Online Redo Log Files to a Group
You may occasionally need to add a log file to an existing group. For example, if you have an online redo log group
that contains only one member, you should consider adding a log file (to provide a higher level of protection against a
single-log file member failure). Use the ALTER DATABASE ADD LOGFILE MEMBER statement to add a member file to an
existing online redo log group. You need to specify the new member file location, name, and group to which you want
to add the file:
SQL> alter database add logfile member '/u02/oraredo/O12C/redo01b.rdo' to group 1;
Make certain you follow standards with regard to the location and names of any newly added redo log files.
Removing Online Redo Log Files from a Group
Occasionally, you may need to remove an online redo log file from a group. For example, your database may have
experienced a failure with one member of a multiplexed group, and you want to remove the apostate member. First,
make sure the log file you want to drop isn't in the current group:
SELECT a.group#, a.member, b.status, b.archived, SUM(b.bytes)/1024/1024 mbytes
FROM v$logfile a, v$log b
WHERE a.group# = b.group#
GROUP BY a.group#, a.member, b.status, b.archived
ORDER BY 1, 2;
If you attempt to drop a log file that is in the group with the CURRENT status, you receive the following error:
ORA-01623: log 2 is current log for instance O12C (thread 1) - cannot drop
If you're attempting to drop a member from the current online redo log group, then force a switch, as follows:
SQL> alter system switch logfile;
Use the ALTER DATABASE DROP LOGFILE MEMBER statement to remove a member file from an existing online redo
log group. You don't need to specify the group number because you're removing a specific file:
SQL> alter database drop logfile member '/u01/oraredo/O12C/redo04a.rdo';
You also can't drop the last remaining log file of a group. A group must contain at least one log file. If you attempt
to drop the last remaining log file of a group, you receive the following error:
ORA-00361: cannot remove last log member ...
Moving or Renaming Redo Log Files
Sometimes, you need to move or rename online redo log files. For example, you may have added some new mount
points to the system, and you want to move the online redo logs to the new storage. You can use two methods to
accomplish this task:
Add the new log files in the new location, and drop the old log files.
Physically rename the files from the OS.
 
Search WWH ::




Custom Search