delete backup backset move backupset 备份集的操作

Goal

In this document, I will list some methods for deleting rman backupset.

NOTE: In the images and/or the document content below, the user information and environment data used
represents fictitious data from the Oracle sample schema(s),Public Documentation delivered with an
Oracle database product or other training material. Any similarity to actual environments, actual
persons, living or dead, is purely coincidental and not intended in any manner.

For the purposes of this document, the following fictitious environment is used as an example
to describe the procedure:

Database/Instance Name = orcl11204

Directory = /refresh/home/app/11.2.0.4 and all subdirectories

Solution

For example, we have some backup, which can be confirmed via "list backup" command:

RMAN> list backup;

List of Backup Sets

===================

BS Key Type LV Size Device Type Elapsed Time Completion Time


1 Full 1005.95M DISK 00:00:06 24-OCT-18

BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20181024T085438

Piece Name: /refresh/home/app/11.2.0.4/oracle/product/11.2.0.4/dbhome_4/dbs/01tgf1ie_1_1

List of Datafiles in backup set 1

File LV Type Ckp SCN Ckp Time Name


1 Full 986146 24-OCT-18 /refresh/home/app/11.2.0.4/oracle/oradata/orcl11204/system01.dbf

2 Full 986146 24-OCT-18 /refresh/home/app/11.2.0.4/oracle/oradata/orcl11204/sysaux01.dbf

3 Full 986146 24-OCT-18 /refresh/home/app/11.2.0.4/oracle/oradata/orcl11204/undotbs01.dbf

4 Full 986146 24-OCT-18 /refresh/home/app/11.2.0.4/oracle/oradata/orcl11204/users01.dbf

Please allow me to list the following methods:

Method 1:

delete backupset <backupset number>;

eg:

RMAN> delete backupset 1;

Method 2:

delete backupset tag <tag number>;

eg:

RMAN> delete backupset tag=TAG20181024T085438;

Method 3:

You can also delete backupset those backed up before a particular time:

delete completed before "TO_DATE('Date String','MM/DD/YYYY HH24:MI:SS')";

For example:

delete backup completed before "TO_DATE('09/23/2018 08:00:00','MM/DD/YYYY HH24:MI:SS')";

And also, if backupset file is deleted by OS command, then you can delete related information via RMAN by using "force".

eg:

RMAN> delete force backupset 1;

RMAN> delete force backupset tag=TAG20181024T085438;

RMAN> delete force noprompt backup completed before "TO_DATE('09/23/2018 08:00:00','MM/DD/YYYY HH24:MI:SS')";

Please note if recovery catalog is configured please ensure you connect to the recovery catalog when running the above commands

In your scenario you can use RMAN command "backup" to copy or move the backups/logs to any other location.See RMAN reference on BACKUP BACKUPSET
http://docs.oracle.com/cd/E11882_01/backup.112/e10643/rcmsynta007.htm#RCMRF90026

For example:

-- to copy backupset to FS according to TAG

backup backupset from tag 'TAG' to destination '/disk/BKP_COPY';

backup backupset from tag 'TAG' format '/disk/BKP_COPY/%U';

-- to copy according to TIME

backup device type disk backupset completed after "sysdate-1" format '/disk/BKP_COPY/%U';

-- to move backupset from ASM to FS

backup backupset from tag 'TAG' format '/disk/BKP_COPY/%U' delete input;

-- to move back to ASM
backup backupset from tag 'TAG' format '+BKP_DG' delete input;

-- monitor # of copies

list backupset summary;

-- monitor location

list backupset;

list backupset tag 'TAG';

相关推荐
码农阿豪24 分钟前
Oracle 到金仓数据库迁移实战:一次真正“落地”的国产替代之旅
java·数据库·oracle
曹牧2 小时前
Oracle闪回区配置与故障处理操作指南
数据库·oracle
Apple_羊先森2 小时前
ORACLE数据库巡检SQL脚本--15、表空间的运行状态
数据库·sql·oracle
数据与人2 小时前
ksql 元命令完整帮助
数据库·oracle
姚远Oracle ACE3 小时前
Step-by-Step: 在 Linux 上使用 VMware 安装 Oracle 26ai RAC 数据库
linux·数据库·oracle
sg_knight4 小时前
如何通过 SQL*Plus 连接 Oracle 数据库(使用 Instant Client)
运维·数据库·sql·oracle·database·关系型数据库·sql puls
DBA小马哥6 小时前
Oracle兼容替换案例:某省运营商传输网管系统国产化落地实战
数据库·oracle
倔强的石头1067 小时前
关系数据库替换用金仓:从 Oracle 到 KingbaseES 的迁移实战
数据库·oracle·kingbase
半岛铁盒BKB7 小时前
Oracle19c分区表全局索引维护指南
oracle·hash-index
Amarantine、沐风倩✨1 天前
一次线上性能事故的处理复盘:从 SQL 到扩容的工程化思路
java·数据库·sql·oracle