Oracle日志文件相信經常使用Oracle數據庫的朋友都比較熟悉了,下面將為您介紹的是查詢Oracle日志文件的幾種方法,供您參考學習。
1.查詢系統使用的是哪一組日志文件:
select * from v$log;
2.查詢正在使用的組所對應的日志文件:
select * from v$logfile;
3.強制日志切換:
alter system switch logfile;
4.查詢歷史日志:
select * from v$log_history;
5.查詢日志的歸檔模式:
select dbid,name,created,log_mode from v$database;
6.查詢歸檔日志的信息:
select recid,stamp,thread#,sequence#,name from v$archived_log;
7.增加與刪除日志文件組
alter database add logfile group 1 ('/home1/oracle/oradata/ora8i/log1a.log'),'/home2/Oracle/oradata/ora8i/log1b.log') size 100M;
alter database drop logfile group 1;
8.增加與刪除日志成員
alter database add logfile member '/home1/oracle/oradata/ora8i/log1a.log' to group 1,'/home1/Oracle/oradata/ora8i/log2a.log' to group 2;
alter database drop logfile member '/home1/Oracle/oradata/ora8i/log1a.log' ;
9.日志文件移動
alter database rename file '/home1/oracle/oradata/ora8i/log1a.log' to '/home2/Oracle/oradata/ora8i/log1a.log';
執行該命令之前必須保證該日志文件物理上已經移動到新目錄
10.清除日志文件
alter database clear logfile '/home1/Oracle/oradata/ora8i/log1a.log';
該命令用於不能用刪除組及組成員命令刪除日志時使用