ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 管理REDO

管理REDO

原创 Linux操作系统 作者:jifei0611 时间:2008-02-22 14:41:02 0 删除 编辑

说到REDO不能不说REDO的作用?

REDO记录了数据改变,生成ARCHIVELOG和当前的REDO为数据的灾难恢复提供了保障.

一个INSTANCE至少两组日志.

REDO的状态

        ■ UNUSED - Online redo log has never been written to. This is the state

of a redo log that was just added, or just after a RESETLOGS, when it

is not the current redo log.

■ CURRENT - Current redo log. This implies that the redo log is active.

The redo log could be open or closed.

■ ACTIVE - Log is active but is not the current log. It is needed for

crash recovery. It may be in use for block recovery. It may or may not

be archived.

■ CLEARING - Log is being re-created as an empty log after an ALTER

DATABASE CLEAR LOGFILE statement. After the log is cleared, the

status changes to UNUSED.

■ CLEARING_CURRENT - Current log is being cleared of a closed

thread. The log can stay in this status if there is some failure in the

switch such as an I/O error writing the new log header.

■ INACTIVE - Log is no longer needed for instance recovery. It may be

in use for media recovery. It might or might not be archived.

 

增加日志组

alter database add logfile group 4

('/u02/oradata/sid/redo04a.redo',

 '/u03/oradata/sid/red04b.redo'

)

size 50M;

增加日志成员

规则

1.      日志组的不同成员要存放到不同的盘

2.      相同日志组的成员大小要相同

3.      增加成员时要处于要增加的组的成员必处于INACTIVE状态

步骤

1.      检查成员大小

select group#,thread#,members,bytes/1024/1024||'M' "SIZE" from v$log

2.      增加

alter database add logfile member

'/u03/oradata/sid/red03b.redo'

to group 3;

删除日志组

条件:已归档

alter database drop logfile group 4;

删除成员

如果要删除的成员是最后一个成员不能删除

NOTE:只是从数据库中删除,并不从OS中删除

alter database drop logfile member

'/u03/oradata/sid/redo01b.log';

与REDO有关V$

V$log,V$logfile

日志的切换频率

最好控制在5次/每小时以內

相关命令整理

alter system switch logfile

alter system archive log current

我不知道上面二个命令有什么不同,有知道告诉我好吗

archive log list

alter database add logfile group

alter database add logfile member

alter database drop logfile group

alter database drop logfile member

alter database clear logfile group

alter database clear logfile member

当然你DATABASE CONTROL,TOAD等可视化工具进行管理

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

上一篇: 处理redo损坏
下一篇: DATABASE LINK
请登录后发表评论 登录
全部评论

注册时间:2008-01-12

  • 博文量
    143
  • 访问量
    268011