ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle备份常用命令

oracle备份常用命令

原创 Linux操作系统 作者:oracle_db 时间:2012-04-21 15:08:25 0 删除 编辑
1.list backup;列出数据库中所有的备份信息。
2.list backup of controlfile;列出所有备份的控制文件。
3.list backup of datafile ' 或者 list backup of datafile 对应数据文件的ID号。数据文件全路径.dbf';列出指定的备份的数据文件。
4.list backup of archivelog all;列出所有备份的归档文件。
5.list copy of tablespace '表空间名';列出指定表空间的备份信息。
6.list expired backup;列出无效备份。
7.delete obsolete;删除过期备份。
8.delete expired backup;删除无效备份。
9.delete expired copy;删除expired副本。
10.delete backupset 备份集编号;删除指定备份集。
11.delete backup;删除所有备份集。
12.delete copy;删除所有映像副本。
13.report need backup;查看所需要的备份文件
14.report need backup tablespace 表空间名;查看指定表空间是否需要备份。
15.crosscheck archivelog all;检查归档文件是否 有效
16.crosscheck backup;检查所有备份集。
RMAN> crosscheck backup;

using channel ORA_DISK_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/flash_recovery_area/DBTEST/backupset/2012_04_21/o1_mf_nnndf_TAG20120421T153359_7s4rq7v6_.bkp recid=22 stamp=781198439
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/flash_recovery_area/DBTEST/backupset/2012_04_21/o1_mf_ncnnf_TAG20120421T153359_7s4rsm9k_.bkp recid=23 stamp=781198515
Crosschecked 2 objects


RMAN> 
17.修改备份状态用CHANGE,如修改表空间

RMAN> backup tablespace users format '/backup/rmanbackup/userscp';

Starting backup at 21-APR-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/u01/oradata/dbtest/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-APR-12
channel ORA_DISK_1: finished piece 1 at 21-APR-12
piece handle=/backup/rmanbackup/userscp tag=TAG20120421T155115 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-APR-12

RMAN> list backup of tablespace users;


List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
24      Full    2.02M      DISK        00:00:00     21-APR-12      
        BP Key: 28   Status: AVAILABLE  Compressed: NO  Tag: TAG20120421T155115
        Piece Name: /backup/rmanbackup/userscp
  List of Datafiles in backup set 24
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1388204    21-APR-12 /u01/oradata/dbtest/users01.dbf

RMAN> change backup of tablespace users unavailable;

changed backup piece unavailable
backup piece handle=/backup/rmanbackup/userscp recid=28 stamp=781199475
Changed 1 objects to UNAVAILABLE status


RMAN> list backup of tablespace users;


List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
24      Full    2.02M      DISK        00:00:00     21-APR-12      
        BP Key: 28   Status: UNAVAILABLE  Compressed: NO  Tag: TAG20120421T155115
        Piece Name: /backup/rmanbackup/userscp
  List of Datafiles in backup set 24
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1388204    21-APR-12 /u01/oradata/dbtest/users01.dbf

RMAN> 
如果没有指定表空间位置,来改变状态,不会成功。如:

RMAN> change backupset 22 unavailable;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of unavailable command on ORA_DISK_1 channel at 04/21/2012 15:46:29
ORA-19813: cannot have unavailable file /u01/flash_recovery_area/DBTEST/backupset/2012_04_21/o1_mf_annnn_TAG20120421T154318_7s4s8px3_.bkp in DB_RECOVERY_FILE_DEST

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15720542/viewspace-721885/,如需转载,请注明出处,否则将追究法律责任。

上一篇: rman backup
下一篇: RMAN提高备份速度
请登录后发表评论 登录
全部评论

注册时间:2008-11-13

  • 博文量
    158
  • 访问量
    313983