Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4482781
  • 博文数量: 109
  • 博客积分: 10011
  • 博客等级: 上将
  • 技术积分: 2457
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-18 19:04
文章分类

全部博文(109)

文章存档

2011年(1)

2010年(10)

2009年(36)

2008年(62)

我的朋友

分类: Oracle

2008-10-20 16:07:30

、连接到目标数据库(不用恢复目录数据库)

      Rman nocatalog target sys/change_on_isntall@testdb

      Rman catalog rman_user/rman_user@ora9rc target sys/change_on_install@testdb

SHOW命令:

      显示rman配置: RMAN> show all;

REPORT命令:

1RMAN> report schema                        报告目标数据库的物理结构;

2RMAN>report need backup days=3;            报告最近3天没有被备份的数据文件;

3RMAN> report need backup days 3 tablespace users;   USERS表空间上3天未备份的数据文件;

4RMAN> report need backup incremental 3;

                                                报告恢复数据文件需要的增量备份个数超过3次的数据文件;

5RMAN> report need backup redundancy 2 database;           报告备份文件低于2份的所有数据文件;

  RMAN>report need backup redundancy=2;

6RMAN> report need backup recovery window of 6 days;

                            报告文件报表的恢复需要超过6天的归档日志的数据文件;

7RMAN> report unrecoverable;               报告数据库所有不可恢复的数据文件;

8RMAN> report obsolete redunndancy 2; 报告备份次数超过2次的陈旧备份;

9RMAN>report obsolete;                       报告丢弃的备份;

LIST命令:列出备份信息

1、列出数据文件备份集

  RMAN>list backup         列出详细备份;

  RMAN>list expired backup     列出过期备份;

RMAN> list backup of database;     列出所有数据文件的备份集;

RMAN> list backup of tablespace user01; 列出特定表空间的所有数据文件备份集;

2RMAN> list backup of controlfile     列出控制文件备份集;

3RMAN> list backup of archivelog all      列出归档日志备份集详细信息;

    RMAN>list archivelog all;      列出归档日志备份集简要信息

4RMAN> list backup of spfile              列出SPFILE备份集;

5RMAN> list copy of datafile 5        列出数据文件映像副本;

6RMAN> list copy of controlfile           列出控制文件映像副本;

7RMAN> list copy of archivelog all    列出归档日志映像副本;

8RMAN> list incarnation of database       列出对应物/列出数据库副本;

9RMAN>list backup summary;    概述可用的备份;

           B表示backup

           F表示FULL

           A表示archive log

           0 1表示incremental backup

           S说明备份状态A AVAILABLE   X EXPIRED )

      10RMAN>list backup by file    按备份类型列出备份;

                    按照数据文件备份,归档日志备份,控制文件备份,服务器参数文件备份 列出

CROSSCHECK命令:校验备份信息

1RMAN> crosscheck backup             核对所有备份集;   

2RMAN> crosscheck backup of database      核对所有数据文件的备份集;   

3RMAN> crosscheck backup of tablespace users      核对特定表空间的备份集;   

4RMAN> crosscheck backup of datafile 4    核对特定数据文件的备份集;   

5RMAN> crosscheck backup of controlfile   核对控制文件的备份集;   

6RMAN> crosscheck backup of spfile    核对SPFILE的备份集;   

7RMAN> crosscheck backup of archivelog sequence 3 核对归档日志的备份集;   

8RMAN> crosscheck copy               核对所有映像副本;   

9RMAN> crosscheck copy of database       核对所有数据文件的映像副本;   

10RMAN> crosscheck copy of tablespace users       核对特定表空间的映像副本;   

11RMAN> crosscheck copy of datafile 6        核对特定数据文件的映像副本;   

12RMAN> crosscheck copy of archivelog sequence 4  核对归档日志的映像副本;   

13RMAN> crosscheck copy of controlfile       核对控制文件的映像副本;  

14RMAN> crosscheck backup tag='SAT_BACKUP';

15RMAN> crosscheck backup completed after 'sysdate - 2'

16RMAN> crosscheck backup completed between 'sysdate - 5' and 'sysdate -2 '

17RMAN> crosscheck backup device type sBT;

18RMAN> crosscheck archivelog all;

19RMAN> crosscheck archivelog like '%ARC00012.001'

20RMAN> crosscheck archivelog from sequence 12;

21RMAN> crosscheck archivelog until sequence 522;

DELETE:删除备份

1RMAN> delete obsolete;      删除陈旧备份;

2RMAN> delete expired backup; 删除EXPIRED备份     

3RMAN> delete expired copy;   删除EXPIRED副本;

4RMAN> delete backupset 19;   删除特定备份集;

5RMAN> delete backuppiece ''d:\backup\DEMO_19.bak''   删除特定备份片;

6RMAN> delete backup      删除所有备份集;

7RMAN> delete datafilecopy ''d:\backup\DEMO_19.bak''  删除特定映像副本;

8RMAN> delete copy   删除所有映像副本;

9RMAN> delete archivelog all delete input;

  RMAN> delete backupset 22 format = ''d:\backup\%u.bak'' delete input

                       在备份后删除输入对象;

10RMAN> delete backupset id;

CHANGE命令:改变备份集的状态

1RMAN> change backupset 22 unavailable      改变备份集状态;   

2RMAN> change datafilecopy ''d:\backup\demo_37.bak'' unavailable     改变映像副本状态;

3RMAN> change backupset 156 keep forever logs         使备份集156永久保留;

4RMAN> change backupset 198 keep until ''sysdate+60'' logs       使备份集198保留60;

5RMAN> change backupset 156 nokeep         免除备份集156的保留期限;

6change backupset 117,118 delete;

7change backuppiece 1304 delete;

8change archivelog until logseq =544 delete;

CONFIGURE命令

   显示当前的配置信息

       

       查询RMAN设置中非默认值:  

SQL> select name,value from v$rman_configuration;

   常用的configure选项

       保存策略(retention policy)

   configure retention policy to recovery window of 3 days;

   configure retention policy to redundancy 3;

   configure retention policy clear;

       备份优化backup optimization

   configure backup optimization on;

   configure backup optimization off;

   configure backup optimization clear;

       默认设备default device type

   configure default device type to disk;

   configure default device type to stb;

   configure default device type clear;

       控制文件controlfile

   configure controlfile autobackup on;

   configure controlfile autobackup format for device type disk to '/cfs01/backup/conf/conf_%F';

   configure controlfile autobackup clear;

   configrue controlfile autobackup format for device type disk clear;

   configrue snapshot controlfile name to '/cfs01/backup/snapcf/scontrofile.snp';

   configrue snapshot controlfile name clear;

       并行数(通道数) device type disk|stb parallelism n;

   configure device type disk|stb parallelism 2;

   configure device type disk|stb clear;

   configure channel device type disk format 'e/:rmanback_%U';

   configure channel device type disk maxpiecesize 100m

   configure channel device type disk rate 1200K

   configure channel 1 device type disk format 'e/:rmanback_%U';

   configure channel 1 device type disk maxpiecesize 100m

       生成备份副本datafile|archivelog backup copies

   configure datafile backup copies for device type disk|stb to 3;

   configure archivelog backup copies for device type disk|stb to 3;

   configure datafile|archivelog backup copies for device type disk|stb clear

   backup device type disk database

   format '/disk1/backup/%U', '/disk2/backup/%U', '/disk3/backup/%U';

       排除选项exclude

   configure exclude for tablespace 'users';

   configrue exclude clear;

       备份集大小maxsetsize

   configure maxsetsize to 1G|1000M|1000000K|unlimited;

   configure maxsetsize clear;

       其它选项auxiliary

   CONFIGURE AUXNAME FOR DATAFILE 1 TO '/oracle/auxfiles/aux_1.f';

   CONFIGURE AUXNAME FOR DATAFILE 2 TO '/oracle/auxfiles/aux_2.f';

   CONFIGURE AUXNAME FOR DATAFILE 3 TO '/oracle/auxfiles/aux_3.f';

   CONFIGURE AUXNAME FOR DATAFILE 4 TO '/oracle/auxfiles/aux_4.f';

   

   CONFIGURE AUXNAME FOR DATAFILE 1 CLEAR;

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