ITPub博客

首页 > Linux操作系统 > Linux操作系统 > How To Resize and/or Add Redo Logs [ID 602066.1]

How To Resize and/or Add Redo Logs [ID 602066.1]

原创 Linux操作系统 作者:wangsir_918 时间:2011-08-15 10:08:45 0 删除 编辑

Applies to:

Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 10.2.0.4 - Release: 9.2 to 10.2
Information in this document applies to any platform.

Goal

The purpose of this document is to demonstrate: 

A. How to resize and/or add redo logs. 

B. How to determine the optimal size for redo logs


Solution

 A.  How to resize and/or add redo logs. 

1. Review information on existing redo logs.

SELECT a.group#, b.member, a.status, a.bytes
FROM v$log a, v$logfile b
WHERE a.group#=b.group#

2. Add new groups

ALTER DATABASE ADD LOGFILE group 4 ('/log01A.dbf', '/log01B.dbf ') SIZE 512M;
ALTER DATABASE ADD LOGFILE group 5 ('/log02A.dbf', '/log02B.dbf ') SIZE 512M;
ALTER DATABASE ADD LOGFILE group 6 ('/log03A.dbf', '/log03B.dbf ') SIZE 512M;


3. Check the status on all redo logs again.

SELECT a.group#, b.member, a.status, a.bytes
FROM v$log a, v$logfile b
WHERE a.group#=b.group#

4.  Drop the online redo log groups that are not needed.  You must have the ALTER DATABASE system privilege.

Note: Before dropping an online redo log group, consider the following restrictions and precautions:

a.  An instance requires at least two groups of online redo log files, regardless of the number of members in the groups. (A group is one or more members.)

b. You can drop an online redo log group only if it is INACTIVE. If you need to drop the current group, first force a log switch to occur.

By using this command :

ALTER SYSTEM SWITCH LOGFILE;

c. Make sure an online redo log group is archived (if archiving is enabled) before dropping it.  This can be determined by:

GROUP# ARC STATUS
---------   ---     ----------------
1             YES   ACTIVE
2             NO    CURRENT
3             YES   INACTIVE
4             YES   UNUSED
5             YES   UNUSED
6             YES   UNUSED

d.  Check that the group is inactive and archived before dropping it .

SELECT GROUP#, ARCHIVED, STATUS FROM V$LOG;

 

ALTER DATABASE DROP LOGFILE GROUP 3;


e.  After dropping an online redo log group, make sure that the drop completed successfully, and then use the appropriate operating system command to delete the dropped online redo log files.  For more information refer to Note 395062.1


B.  How to determine the optimal size for redo logs

You can use the V$INSTANCE_RECOVERY view column OPTIMAL_LOGFILE_SIZE to determine the size of your online redo logs. This field shows the redo log file size in megabytes that is considered optimal based on the current setting of FAST_START_MTTR_TARGET. If this field consistently shows a value greater than the size of your smallest online log, then you should configure all your online logs
to be at least this size.

Note, however, that the redo log file size affects the MTTR. In some cases, you may be able to
refine your choice of the optimal FAST_START_MTTR_TARGET value by re-running the MTTR Advisor with your suggested optimal log file size.

You can also refer to this Note 1038851.6 - How to Estimate Size of Redo Logs

Please note that there is no column OPTIMAL_LOGFILE_SIZE in
V$INSTANCE_RECOVERY view in 9i. It only applies to 10g.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25801738/viewspace-704842/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-07-18

  • 博文量
    40
  • 访问量
    77637