登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

飞哥的技术博客

世上无难事,只怕有心人!

 
 
 

日志

 
 
 
 

rman中CATALOG命令的使用  

2009-06-23 20:20:50|  分类: Oracle |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

 rman中CATALOG命令的使用收藏

 rman中CATALOG命令的使用:

CATALOG命令目的是将RMAN的备份集注册到控制文件

类似的一系列命令有:
CATALOG ARCHIVELOG '?/oradata/archive1_30.dbf', '?/oradata/archive1_31.dbf',
                  '?/oradata/archive1_32.dbf';
CATALOG DATAFILECOPY '?/oradata/users01.bak' LEVEL 0;
CATALOG START WITH '/tmp/arch_logs';
CATALOG RECOVERY AREA NOPROMPT;
CATALOG BACKUPPIECE '?/oradata/01dmsbj4_1_1.bcp';

但是注意这些命令是有限制的,其中的一个限制是不能注册备份文件到不同的数据库:
You cannot use CATALOG to catalog a file that belongs to a different database.
也就是说你至少还需要原数据库的控制文件。link.Phontol.com


RMAN> list backup summary;
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
23      B  F  A DISK        21-SEP-08       1       1       NO         TAG20080921T171042
24      B  F  A DISK        21-SEP-08       1       1       NO         TAG20080921T171539
34      B  F  A DISK        21-SEP-08       1       1       NO         TAG20080921T185036
35      B  F  A DISK        27-SEP-08       1       1       NO         TAG20080927T213046
36      B  F  A DISK        17-OCT-08       1       1       NO         TAG20081017T213842
37      B  F  A DISK        17-OCT-08       1       1       NO         TAG20081017T215115

下面是将备份集23复制到路径/backup/下之后CATALOG注册到数据库的控制文件中去:

RMAN> CATALOG BACKUPPIECE '/backup/o1_mf_nnndf_TAG20080921T171042_4fd3wmfm_.bkp';
cataloged backuppiece
backup piece handle=/backup/o1_mf_nnndf_TAG20080921T171042_4fd3wmfm_.bkp recid=35 stamp=668447775

RMAN> list backup;
List of Backup Sets
===================
BS Key  Type LV Size
------- ---- -- ----------
23      Full    606.24M
  List of Datafiles in backup set 23
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 540612     21-SEP-08 /opt/oracle/oradata/ge02/system01.dbf
  2       Full 540612     21-SEP-08 /opt/oracle/oradata/ge02/undotbs01.dbf
  3       Full 540612     21-SEP-08 /opt/oracle/oradata/ge02/sysaux01.dbf
  4       Full 540612     21-SEP-08 /opt/oracle/oradata/ge02/tbs_01.dbf
  5       Full 540612     21-SEP-08 /opt/oracle/oradata/ge02/users01.dbf
  6       Full 540612     21-SEP-08 /opt/oracle/oradata/ge02/indx01.dbf
  7       Full 491413     20-SEP-08 /opt/oracle/oradata/ge02/usertest01.dbf

  Backup Set Copy #1 of backup set 23
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:04:54     21-SEP-08       NO         TAG20080921T171042

    List of Backup Pieces for backup set 23 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    20      1   AVAILABLE   /opt/oracle/flash_recovery_area/GE02/backupset/2008_09_21/o1_mf_nnndf_TAG20080921T171042_4fd3wmfm_.bkp

  Backup Set Copy #2 of backup set 23
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:04:54     18-OCT-08       NO         TAG20080921T171042

    List of Backup Pieces for backup set 23 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    35      1   AVAILABLE   /backup/o1_mf_nnndf_TAG20080921T171042_4fd3wmfm_.bkp

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
24      Full    6.61M      DISK        00:00:05     21-SEP-08
        BP Key: 21   Status: AVAILABLE  Compressed: NO  Tag: TAG20080921T171539
        Piece Name: /opt/oracle/flash_recovery_area/GE02/autobackup/2008_09_21/o1_mf_s_666033339_4fd45z3p_.bkp
  Control File Included: Ckp SCN: 540716       Ckp time: 21-SEP-08
  SPFILE Included: Modification time: 21-SEP-08

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
34      Full    6.58M      DISK        00:00:01     21-SEP-08
        BP Key: 31   Status: AVAILABLE  Compressed: NO  Tag: TAG20080921T185036
        Piece Name: /opt/oracle/flash_recovery_area/GE02/autobackup/2008_09_21/o1_mf_n_666039036_4fd9qxr8_.bkp
  Control File Included: Ckp SCN: 543556       Ckp time: 21-SEP-08

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
35      Full    6.61M      DISK        00:00:05     27-SEP-08
        BP Key: 32   Status: AVAILABLE  Compressed: NO  Tag: TAG20080927T213046
        Piece Name: /opt/oracle/flash_recovery_area/GE02/autobackup/2008_09_27/o1_mf_s_666566928_4fwfd9rz_.bkp
  Control File Included: Ckp SCN: 671981       Ckp time: 27-SEP-08
  SPFILE Included: Modification time: 27-SEP-08

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
36      Full    974.31M    DISK        00:12:21     17-OCT-08
        BP Key: 33   Status: AVAILABLE  Compressed: NO  Tag: TAG20081017T213842
        Piece Name: /opt/oracle/flash_recovery_area/GE02/backupset/2008_10_17/o1_mf_nnndf_TAG20081017T213842_4hk5c2rk_.bkp
  List of Datafiles in backup set 36
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 901178     17-OCT-08 /opt/oracle/oradata/ge02/system01.dbf
  2       Full 901178     17-OCT-08 /opt/oracle/oradata/ge02/undotbs01.dbf
  3       Full 901178     17-OCT-08 /opt/oracle/oradata/ge02/sysaux01.dbf
  4       Full 901178     17-OCT-08 /opt/oracle/oradata/ge02/tbs_01.dbf
  5       Full 901178     17-OCT-08 /opt/oracle/oradata/ge02/users01.dbf
  6       Full 901178     17-OCT-08 /opt/oracle/oradata/ge02/indx01.dbf
  7       Full 491413     20-SEP-08 /opt/oracle/oradata/ge02/usertest01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
37      Full    6.61M      DISK        00:00:06     17-OCT-08
        BP Key: 34   Status: AVAILABLE  Compressed: NO  Tag: TAG20081017T215115
        Piece Name: /opt/oracle/flash_recovery_area/GE02/autobackup/2008_10_17/o1_mf_s_668382675_4hk62r3l_.bkp
  Control File Included: Ckp SCN: 901741       Ckp time: 17-OCT-08
  SPFILE Included: Modification time: 17-OCT-08

分析:从上面发现backup set 23有两个copy,一个是原来的flash recovery area区域中的,另一个是/backup路径下刚刚注册到控制文件中去的那个文件备份

  评论这张
 
阅读(954)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018