Oracle 数据库安装之后,重做日志默认为 3组,如果需要新增删除,可以通过以下方式!
查询:
setline222colmemberfora60selecta.group#,b.membermember,a.bytes/1024/1024"size(M)"fromv$loga,v$logfilebwherea.group#=b.group#;
新增:
单机数据库:
alterdatabaseaddlogfilegroup4'/oradata/orcl/redo04.log'size50M; alterdatabaseaddlogfilegroup5'/oradata/orcl/redo05.log'size50M; alterdatabaseaddlogfilegroup16'/oradata/orcl/redo16.log'size1024M; alterdatabaseaddlogfilegroup17'/oradata/orcl/redo17.log'size1024M; alterdatabaseaddlogfilegroup18'/oradata/orcl/redo18.log'size1024M;
RAC集群数据库:
alterdatabaseaddlogfilethread1group4'/oradata/orcl/redo04.log'size50M, group5'/oradata/orcl/redo05.log'size50M, group6'/oradata/orcl/redo06.log'size50M; alterdatabaseaddlogfilethread2group7'/oradata/orcl/redo07.log'size50M, group8'/oradata/orcl/redo08.log'size50M, group9'/oradata/orcl/redo09.log'size50M;
删除:
alterdatabasedroplogfilegroup16; alterdatabasedroplogfilegroup17; alterdatabasedroplogfilegroup18;
📢 注意:如果当前要删除的 logfile 状态不是 INACTIVE
,那么删除会报错,需要执行 ALTER SYSTEM SWITCH LOGFILE;
来切换日志,直到状态为 INACTIVE
才可以删除!