Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1212106
  • 博文数量: 1211
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 14340
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-09 11:20
文章分类

全部博文(1211)

文章存档

2011年(1)

2008年(1210)

我的朋友

分类: 服务器与存储

2008-06-14 13:57:26

 11g在备份和恢复方面新增了很多的功能,无论是性能、功能性、安全性和可操作性方面都有了不同程度的提高。

  这一篇介绍RMAN删除归档日志时的验证。

  在11g以前的版本,的rman并没有和其他日志应用系统紧密结合起来,因此,rman删除归档日志的时候并不会判断这个日志是否对其他系统仍然有用。

  当rman删除日志后,可能会发现其他的系统比如DATA GUARD、STREAMS等由于日志被删除而无法正常工作。

  从11g开始,rman在删除时会首先判断,这个日志是否其他系统仍然需要,当其他需要仍然需要这个日志时,rman会报警,且不会删除这个日志。

  先看看10g下的情况:

  SQL> conn as sysdba已连接。

  SQL> select sequence# from v$managed_standby where status = 'WAIT_FOR_LOG';

  SEQUENCE#

  ----------

  577

  SQL> shutdown immediate

  ORA-01109: 数据库未打开

  已经卸载数据库。

  ORACLE 例程已经关闭。

  SQL> exit从 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production

  With the Partitioning, OLAP and Data Mining options 断开

  $ rman target /

  恢复管理器: Release 10.2.0.3.0 - Production on 星期四 9月 13 04:14:09 2007

  Copyright (c) 1982, 2005, Oracle. All rights reserved.

  连接到目标数据库: TESTRAC (DBID=4291216984)

  RMAN> delete archivelog sequence 577;

  使用目标数据库控制文件替代恢复目录分配的通道: ORA_DISK_1通道 ORA_DISK_1: sid=286 实例=testrac1 devtype=DISK分配的通道: ORA_DISK_2通道 ORA_DISK_2: sid=308 实例=testrac2 devtype=DISK

  已存档的日志副本列表关键字 Thrd Seq S 时间下限 名称

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

  1981 1 577 A 31-8月 -07 /data1/archivelog/1_577_626291662.dbf

  是否确定要删除以上对象 (输入 YES 或 NO)? no

  在10g中,rman不会检查这个日志是否其他系统仍然需要,而在11g中,这个问题得到解决:

[oracle@yangtk ~]$ rman target / 
  Recovery Manager: Release 11.1.0.6.0 - Production on 
Sun Oct 21 09:02:08 2007
  Copyright (c) 1982, 2007, Oracle. All rights reserved.
  connected to target database: ORA11G (DBID=4026820313)
  RMAN> delete archivelog all;
  using target database control file instead of recovery catalog
  allocated channel: ORA_DISK_1
  channel ORA_DISK_1: SID=128 device type=DISK
  RMAN-08137: WARNING: archived log not deleted as it is still needed
  archived log file name=/data/oracle/oradata/ora11g/archivelog/
1_212_630620185.dbf thread=1 sequence=212
  RMAN-08137: WARNING: archived log not deleted as it is still needed
  archived log file name=/data/oracle/oradata/ora11g/archivelog/
1_213_630620185.dbf thread=1 sequence=213

阅读(387) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~