更新时间:2023-09-04
- 如果需要添加redo日志,使用以下命令添加一组2048MB的日志文件。查询当前数据库中的日志情况:
set lines 200
set pages 200
col member for a40
col STATUS for a10
select l.thread#,l.GROUP# ,l.STATUS , lf.member, l.BYTES/1024/1024 size_mb
from V$LOG l ,v$logfile lf
where l.group#=lf.group#
order by 1,2,3;
- 单实例数据库添加一组日志文件,其中组数不能重复,日志文件路径与已有库需保持一致,各组日志文件不能重复:
alter database add logfile group 7 '/oracle/data/orcl/redo11.log' size 2048M;
- RAC数据库则应将日志文件添加到ASM磁盘组中,通常是“+DATA”组:
alter database add logfile THREAD 1 group 11 '+DATA' size 2048M;
alter database add logfile THREAD 2 group 21 '+DATA' size 2048M;
- 添加完成后再次检查日志文件:
set lines 200
set pages 200
col member for a40
col STATUS for a10
select l.thread#,l.GROUP# ,l.STATUS , lf.member, l.BYTES/1024/1024 size_mb
from V$LOG l ,v$logfile lf
where l.group#=lf.group#
order by 1,2,3;