【OMF】在OMF管理模式下日誌組新增效果

secooler發表於2010-10-16
1.查詢當前的日誌分配情況
sys@ora10g> select * from v$logfile

GROUP# MEMBER                                                                            
------ ----------------------------------------------------------------------------------
     1 /oracle/u02/oradata/ORA10G/onlinelog/o1_mf_1_4srphb4v_.log                        
     1 /oracle/u01/app/oracle/flash_recovery_area/ORA10G/onlinelog/o1_mf_1_4srphqtc_.log
     2 /oracle/u02/oradata/ORA10G/onlinelog/o1_mf_2_4srphzko_.log                        
     2 /oracle/u01/app/oracle/flash_recovery_area/ORA10G/onlinelog/o1_mf_2_4srpjhmg_.log
     3 /oracle/u02/oradata/ORA10G/onlinelog/o1_mf_3_4srpjsyx_.log                        
     3 /oracle/u01/app/oracle/flash_recovery_area/ORA10G/onlinelog/o1_mf_3_4srpkb83_.log

6 rows selected.

2.檢視並修改db_create_online_log_dest引數
該引數決定了在OMF模式下日誌新增的位置

sys@ora10g> show parameter db_create_online_log_dest

NAME                                     TYPE                 VALUE
---------------------------------------- -------------------- ---------------------------
db_create_online_log_dest_1              string               
db_create_online_log_dest_2              string               
db_create_online_log_dest_3              string
db_create_online_log_dest_4              string
db_create_online_log_dest_5              string

sys@ora10g> alter system set db_create_online_log_dest_1='/oracle/u01';

System altered.

sys@ora10g> alter system set db_create_online_log_dest_2='/oracle/u02';

System altered.

sys@ora10g> show parameter db_create_online_log_dest

NAME                                     TYPE                 VALUE
---------------------------------------- -------------------- ---------------------------
db_create_online_log_dest_1              string               /oracle/u01
db_create_online_log_dest_2              string               /oracle/u02
db_create_online_log_dest_3              string
db_create_online_log_dest_4              string
db_create_online_log_dest_5              string

3.在OMF方式下新增日誌組
sys@ora10g> select * from v$log;

GROUP# THREAD#  SEQUENCE#      BYTES MEMBERS ARC STATUS   FIRST_CHANGE# FIRST_TIM
------ ------- ---------- ---------- ------- --- -------- ------------- ---------
     1       1         13  209715200       2 YES INACTIVE        448865 10-MAR-09
     2       1         14  209715200       2 YES INACTIVE        473775 10-MAR-09
     3       1         15  209715200       2 NO  CURRENT         495189 11-MAR-09

sys@ora10g> alter database add logfile group 4 size 10m;

Database altered.

sys@ora10g> select * from v$log;

GROUP#  THREAD#  SEQUENCE#      BYTES MEMBERS ARC STATUS    FIRST_CHANGE# FIRST_TIM
------ -------- ---------- ---------- ------- --- --------- ------------- ---------
     1        1         13  209715200       2 YES INACTIVE         448865 10-MAR-09
     2        1         14  209715200       2 YES INACTIVE         473775 10-MAR-09
     3        1         15  209715200       2 NO  CURRENT          495189 11-MAR-09
     4        1          0   10485760       2 YES UNUSED                0

sys@ora10g> select * from v$logfile;

GROUP# MEMBER                                                                            
------ ----------------------------------------------------------------------------------
     1 /oracle/u02/oradata/ORA10G/onlinelog/o1_mf_1_4srphb4v_.log                        
     1 /oracle/u01/app/oracle/flash_recovery_area/ORA10G/onlinelog/o1_mf_1_4srphqtc_.log
     2 /oracle/u02/oradata/ORA10G/onlinelog/o1_mf_2_4srphzko_.log                        
     2 /oracle/u01/app/oracle/flash_recovery_area/ORA10G/onlinelog/o1_mf_2_4srpjhmg_.log
     3 /oracle/u02/oradata/ORA10G/onlinelog/o1_mf_3_4srpjsyx_.log                        
     3 /oracle/u01/app/oracle/flash_recovery_area/ORA10G/onlinelog/o1_mf_3_4srpkb83_.log
     4 /oracle/u01/ORA10G/onlinelog/o1_mf_4_4vhx4fvj_.log                                
     4 /oracle/u02/ORA10G/onlinelog/o1_mf_4_4vhx4g4b_.log                                

8 rows selected.

4.小結
透過配置db_create_online_log_dest_1等一系列引數後,可以實現OMF自動新增日誌檔案的功能。
在相關引數指定的位置會自動建立"$ORACLE_SID/onlinelog/"目錄,如下所示:
/oracle/u01/ORA10G/onlinelog/o1_mf_4_4vhx4fvj_.log
/oracle/u02/ORA10G/onlinelog/o1_mf_4_4vhx4g4b_.log

Good luck.

secooler
10.10.16

-- The End --

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-566740/,如需轉載,請註明出處,否則將追究法律責任。

相關文章