每日一句: Knowledge is a treasure, but practice the key to it. 知识是一座宝库,实践是打开宝库的钥匙。

Oracle日志文件的管理与查看

--Oracle日志文件管理与查看  
 select * from v$sql   (#查看最近所作的操作)
 --select * fromv $sqlarea(#查看最近所作的操作)

   
  -- 1.查询系统使用的是哪一组日志文件:
 select * from v$log;

 -- 2.查询正在使用的组所对应的日志文件:
  select * from v$logfile;

  --3.强制日志切换:
  alter system switch logfile;

   --4.查询历史日志:
  select * from v$log_history;

  --5.查询日志的归档模式:
   elect 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';
posted @ 2013-09-02 09:20  wuyongmao  阅读(1212)  评论(0编辑  收藏  举报