OMF:oracle managed files oracle管理文件
1、设定日志成员存放目录
sql> alter system set DB_CREATE_ONLINE_LOG_DEST_1='C:\orcl1122\disk2';
System altered
sql> alter system set DB_CREATE_ONLINE_LOG_DEST_2='C:\orcl1122\disk3';
System altered
sql> alter system set DB_CREATE_ONLINE_LOG_DEST_3='C:\orcl1122\disk4';
System altered
2、以OMF命令运行加入一组新的重做日志
sql> alter database add logfile;
Database altered
3、查看
sql> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- -------- ---------------- ------------- ----------- ------------ -----------
1 1 13 52428800 512 1 NO INACTIVE 21995736819 2017-9-21 9 21995740613 2017-9-21 1
2 1 14 52428800 512 2 NO INACTIVE 21995740613 2017-9-21 1 21995744015 2017-9-21 1
3 1 15 52428800 512 1 NO CURRENT 21995744015 2017-9-21 1 281474976710
4 1 0 104857600 512 3 YES UNUSED 0 0
sql>
sql> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE
---------- ------- ------- -------------------------------------------------------------------------------- ---------------------
3 ONLINE C:\ORACEL\BASE\ORADATA\ORCL\REDO03.LOG NO
2 ONLINE C:\ORACEL\BASE\ORADATA\ORCL\REDO02.LOG NO
1 ONLINE C:\ORACEL\BASE\ORADATA\ORCL\REDO01.LOG NO
4 ONLINE C:\ORCL1122\DISK2\ORCL\ONLINELOG\O1_MF_4_DW6FOS5Q_.LOG NO
2 INVALID ONLINE C:\ORACEL\BASE\ORADATA\ORCL\REDO05.LOG NO
4 ONLINE C:\ORCL1122\DISK3\ORCL\ONLINELOG\O1_MF_4_DW6FOTJY_.LOG NO
4 ONLINE C:\ORCL1122\DISK4\ORCL\ONLINELOG\O1_MF_4_DW6FOZ2S_.LOG NO
7 rows selected
sql>
新增加的日志文件group 4
4、删除 物理文件自动删除
sql> alter database drop logfile group 4;
Database altered
sql>
5、查看 sql> select * from v$logfile; GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE ---------- ------- ------- -------------------------------------------------------------------------------- --------------------- 3 ONLINE C:\ORACEL\BASE\ORADATA\ORCL\REDO03.LOG NO 2 ONLINE C:\ORACEL\BASE\ORADATA\ORCL\REDO02.LOG NO 1 ONLINE C:\ORACEL\BASE\ORADATA\ORCL\REDO01.LOG NO 2 INVALID ONLINE C:\ORACEL\BASE\ORADATA\ORCL\REDO05.LOG NO sql>