码迷,mamicode.com
首页 > 数据库 > 详细

oracle归档文件管理

时间:2014-08-09 11:50:08      阅读:363      评论:0      收藏:0      [点我收藏+]

标签:oracle   归档   

归档文件管理

oracle归档文件,常常出现爆满或者挂载不上,这里简单介绍一例爆满的案例。

备份归档文件Backup archivelog all

备份归档日志

1sql>alter system archive logcurrent;   归档一下当前日志

2Sql>show parameter archive;          查看归档目录

3Rman>backup archivelog all;           备份归档

Rman>backup archivelog all delete allinput    备份完删除归档

Rman>backup database plus archivelog  备份数据库和归档日志

归档文件管理

SQL> select * from v$log;   归档状态

   GROUP#    THREAD#  SEQUENCE#     BYTES    MEMBERS ARC STATUS

---------- ---------- ---------- -------------------- --- ----------------

FIRST_CHANGE# FIRST_TIME

 1       1    5638  52428800   1 NO INACTIVE  1.2895E+13 26-JUL-14

 2       1    5639   5242880  1 NO CURRENT  1.2895E+13 26-JUL-14

 4       1   5635  10485760  1 NO INACTIVE  1.2895E+13 25-JUL-14

SQL> select * from v$recovery_file_dest; 归档大小

NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES 

----------- ---------- --------------------------------

/home/oracle/flash_recovery_area   21474836482133713408                 0               23

SQL>select * from v$flash_recovery_area_usage; 空间使用,归档备份接近100% 

FILE_TYPE   PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES

------------ ------------------------------------------- ---------------

CONTROLFILE                 0                             0                0

ONLINELOG                  4.88                     0                1

ARCHIVELOG              27.62                     0             19

BACKUPPIECE             66.86                     0                3

IMAGECOPY                    0                             0                0

FLASHBACKLOG                       0                             0                0

6 rows selected.

SQL> alter system set db_recovery_file_dest_size=10g;

System altered.

SQL> select * from v$recovery_file_dest;

NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES

----------- ---------- --------------------------------

/home/oracle/flash_recovery_area  1.0737E+10 2234790400                    0              26

SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE   PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES

------------ ------------------------------------------- ---------------

CONTROLFILE                 0                             0                0

ONLINELOG                   .98                     0                1

ARCHIVELOG               6.47                     0             22

BACKUPPIECE             13.37                     0                3

IMAGECOPY                    0                             0                0

FLASHBACKLOG                       0                             0                0

6 rows selected.

Rman>backup database plus archivelogdelete input; 备份数据库和归档日志,同时删除已备份的归档日志

Rman>backup archivelog from sequence 79until sequance 82; 根据序列号

Rman>backup archivelog from time sysdate-15until time sysdate-7”;备份15天前到7天前归档日志

4sql>alter system archive logcurrent;  再次做日志归档,归档期间日志

 Rman>list archivelog all;


本文出自 “嘟嘟的成长日记” 博客,请务必保留此出处http://3402313.blog.51cto.com/3392313/1537812

oracle归档文件管理,布布扣,bubuko.com

oracle归档文件管理

标签:oracle   归档   

原文地址:http://3402313.blog.51cto.com/3392313/1537812

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!