>데이터 베이스 >MySQL 튜토리얼 >Oracle关于日志文件基本操作

Oracle关于日志文件基本操作

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB원래의
2016-06-07 17:00:061118검색

1.查询系统使用的是哪一组日志文件: select * from v$log; 2.查询正在使用的组所对应的日志文件: select * from v$logfile; 3.强制日志切换: alter system switch logfile; 4.查询历史日志: select * from v$log_history; 5.查询日志的归档模式: select

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';
该命令用于不能用删除组及组成员命令删除日志时使用

8.查看归档日志占用空间:
SELECT space_limit/1024/1024/1024 AS "Quota_G",space_used/1024/1024 AS "Used_M",space_used/space_limit*100 "Used_%",space_reclaimable AS reclaimable,number_of_files AS files FROM v$recovery_file_dest ;

9.修改归档日志空间大小
alter system set DB_RECOVERY_FILE_DEST_SIZE=40g;

10.查看归档日志列表
RMAN> list archivelog all;
删除归档日志
RMAN> delete archivelog until time 'sysdate-1' ;
双机下也可以用
delete obsolete;
crosscheck archivelog all;
delete expired archivelog all;

11. 用list expired看看是否有失效的archive log,证明没有失效的archive log:
RMAN> list expired archivelog all;

linux

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.