SQL>select group#, sequence#, bytes, members, status from v$log;
GROUP# SEQUENCE# BYTES MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 217 52428800 2 INACTIVE
2 218 52428800 2 CURRENT
3 216 52428800 2 INACTIVE
SQL> select group#,member from v$logfile;
GROUP# MEMBER
--- ----------------------------------------------------------------
3 /u01/oradata/WILSON/onlinelog/o1_mf_3_6bcsqtfj_.log
3 /u01/flash_recovery_area/WILSON/onlinelog/o1_mf_3_6bcsqtwv_.log
2 /u01/oradata/WILSON/onlinelog/o1_mf_2_6bcsqs3t_.log
2 /u01/flash_recovery_area/WILSON/onlinelog/o1_mf_2_6bcsqstm_.log
1 /u01/oradata/WILSON/onlinelog/o1_mf_1_6bcsqpty_.log
1 /u01/flash_recovery_area/WILSON/onlinelog/o1_mf_1_6bcsqqt0_.log
6 rows selected
ü添加redo log group
一些场景下,添加redo log group操作,需要指定group的编号和成员文件。
SQL> alter database add logfile ('/u01/oradata/WILSON/onlinelog/redo4a.log', '/u01/flash_recovery_area/WILSON/onlinelog/redo4b.log') size 10m;
Database altered
SQL> select group#, sequence#, bytes, members, status from v$log;
GROUP# SEQUENCE# BYTES MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 217 52428800 2 INACTIVE
2 218 52428800 2 CURRENT
3 216 52428800 2 INACTIVE
4 0 10485760 2 UNUSED
SQL> select group#,member from v$logfile;
GROUP# MEMBER
- ----------------------------------------------------------------
3 /u01/oradata/WILSON/onlinelog/o1_mf_3_6bcsqtfj_.log
3 /u01/flash_recovery_area/WILSON/onlinelog/o1_mf_3_6bcsqtwv_.log
2 /u01/oradata/WILSON/onlinelog/o1_mf_2_6bcsqs3t_.log
2 /u01/flash_recovery_area/WILSON/onlinelog/o1_mf_2_6bcsqstm_.log
1 /u01/oradata/WILSON/onlinelog/o1_mf_1_6bcsqpty_.log
1 /u01/flash_recovery_area/WILSON/onlinelog/o1_mf_1_6bcsqqt0_.log
4 /u01/oradata/WILSON/onlinelog/redo4a.log
4 /u01/flash_recovery_area/WILSON/onlinelog/redo4b.log
8 rows selected
注意,在10g以后,我们可以借助OMF(Oracle Managed File)对数据文件和日志文件进行透明化管理。Oracle会自动进行路径选择和名字命名。