(7) Maintaining Redo Log Files

  • SQL> select * from v$log  (status: current/active/inactive/unused)

    SQL> select * from v$logfile (status: blank(in use)/stale(incomplete)/delete)

  • Force log switch and CKPT
    SQL> alter system checkpoint
    SQL> alter system switch logfile
    FAST_START_MTTR_TARGET  (MTTR: meantime to recovery) (9i)  包含下面参数
    FAST_START_IO_TARGET  (8i)
    LOG_CHECKPOINT_INTERVAL
    LOG_CHECKPOINT_TIMEOUT
  • Adding (drop) Online Redo Log Groups
    SQL> alter database add logfile group 6 ('xxx1','xxx2') size 1m;
    SQL> alter database drop logfile group 6;
    不能删除:当前日志组,活动日志组,没有归档的日志组
  • Adding Online Redo Log Members
    SQL> alter database add logfile member 'xxx1' to group 6;
    SQL> alter database drop logfile member 'xxx1';
    不能删除:最后一个
  • Clearing, Renaming and Relocation Online Redo Log
    SQL> alter database clear logfile 'xxx'   (reinit)
    SQL> alter database clear unarchived logfile 'xxx'   (reinit)       need fullbackup database

    SQL> alter database rename file 'xxx' to 'xxx1'

  • Archived Redo Log File (Recovery and online backup)
    SQL> shutdown immediate
    SQL> startup mount
    SQL> alter database archivelog/noarchivelog;  切换日志模式
    SQL> alter database open;
    database full backup
    SQL> archive log list
    SQL> select * from v$archived_log;   
    SQL> alter system set log_archive_start=TRUE scope=spfile; 自动存档
  • LOG Minor
    (1) set directory  (UTL_FILE_DIR)
    (2) create file
          dbms_logmnr_d.build('aaa.ora','D:\oracle\admin\orcl9i\cdump');
    (3) add/remove log file
          dbms_logmnr.add_logfile(remove_logfile)('D:\oracle\oradata\orcl9i\REDO02.LOG',dbms_logmnr.new);
    (4) start logmnr
          dbms_logmnr.start_logmnr(dictfilename=>'D:\oracle\admin\orcl9i\cdump\aaa.ora');
    (5) select * from v$logmnr_contents (sql_redo/sql_undo)

 

你可能感兴趣的:(File)