- 查看现有日志文件组
SQL> select group#,member,status from v$logfile;
SQL> select group# from v$log;
GROUP#
----------
1
2
3
传送到redo文件所在文件夹
$ du -m redo01.log
100.00 redo01.log
- 创建临时使用的新日志文件组(4,5)
SQL> alter database add logfile group 4 '/tablespace/orcl/admin/redo04.log' size 200M;
Database altered.
SQL> alter database add logfile group 5 '/tablespace/orcl/admin/redo05.log' size 200M;
Database altered.
- 切换到新建日志组(4,5)
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 INACTIVE
3 INACTIVE
4 INACTIVE
5 CURRENT
- 删除原有的1,2,3日志文件组
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database drop logfile group 3;
Database altered.
- 重新创建1,2,3日志文件组
SQL> alter database add logfile group 1 '/tablespace/orcl/admin/redo01.log' size 200M;
Database altered.
SQL> alter database add logfile group 2 '/tablespace/orcl/admin/redo02.log' size 200M;
Database altered.
SQL> alter database add logfile group 3 '/tablespace/orcl/admin/redo03.log' size 200M;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 CURRENT
3 UNUSED
4 INACTIVE
5 INACTIVE
- 删除日志文件组4,5
SQL> alter database drop logfile group 4;
Database altered.
SQL> alter database drop logfile group 5;
Database altered.
7.RAC增加redo文件
select * from v$logfile
select * from v$log
select group#, sequence#, members, bytes, status, archived from v$log;
ALTER DATABASE add LOGFILE THREAD 1 group 6 '+DATA' SIZE 200M;