Delete backup copies from RMAN catalog with ddutil command
You can use the
ddutil -r command with specific command options to delete the backup copies with certain tag IDs or certain time ranges from the RMAN catalog. The
-a DRY_RUN option specifies to only report which backup copies will be deleted, and not perform any backup copy deletion.
NOTE:
You must run the
ddutil -r command as the root user.
Starting with version 19.12, all Oracle backups are assigned a unique tag ID. By default, the
ddutil -r command deletes the RMAN catalog entries for the latest tagged backup copies.
Dry run of ddutil command reports backup copies to be deleted
When you run the
ddutil -r command with the
-a DRY_RUN option, the command does not perform any backup copy deletion from the RMAN catalog, but only reports the backup copies to be deleted:
ddutil -r -a SID=<SID> -a DRY_RUN=TRUE [-b <begin_time>] -e <end_time> [-a TAG_NAME=<tag_ID> -a CONNECTION_TYPE={OS|DB|WALLET} -a TNS_SERVICE=<TNS_service>]
Other than the
-a DRY_RUN option, the only mandatory options are
-a SID=<SID> and
-e<end_time>. The other listed options are optional.
For example, the following command reports the backup copies to be deleted from the RMAN catalog for the specified SID, time, tag ID, and database authentication connection:
ddutil -r -a SID=orcl -a DRY_RUN=TRUE -e "Thu Jul 29 16:00:13 IST 2022" -a TAG_NAME=23d20a24 -a CONNECTION_TYPE=DB -a TNS_SERVICE=orcl
RMAN instance:
Oracle system ID: orcl
Following backup pieces will be deleted from catalog:
./PLCTLP-d2394afd-08d6-4093-bf18-32d17418fa3b/Automated_data_ORCL_1630219917_gn13r70f_1
./PLCTLP-d2394afd-08d6-4093-bf18-32d17418fa3b/Automated_data_ORCL_1630219917_gm13r70f_1
./PLCTLP-d2394afd-08d6-4093-bf18-32d17418fa3b/Automated_data_ORCL_1630219917_go13r70j_1
:
Delete all backups with a specified asset tag
To delete all the backups from the RMAN catalog with a specified asset tag, run the
ddutil -r command with the
-a TAG_NAME=<tag_ID> option.
For example:
OS Authentication:
ddutil -r -a SID=orcl -a TAG_NAME=d617af34 -e "Thu Jul 29 16:00:13 IST 2022"
Database Authentication:
ddutil -r -a SID=orcl -a TAG_NAME=d617af34 -e "Thu Jul 29 16:00:13 IST 2022" -a CONNECTION_TYPE=DB -a TNS_SERVICE=orcl
Wallet Authentication:
ddutil -r -a SID=orcl -a TAG_NAME=d617af34 -e "Thu Jul 29 16:00:13 IST 2022" -a CONNECTION_TYPE=WALLET -a TNS_SERVICE=orcl
Delete all backups for a specified time range
To delete all the backups from the RMAN catalog for a specified time range, run the
ddutil -r command with the
-b<begin_time> (optional) and
-e<end_time> options.
For example:
OS Authentication:
ddutil -r -a SID=orcl -b "Fri Jul 1 16:00:00 IST 2022" -e "Thu Jul 29 16:00:13 IST 2022"
Database Authentication:
ddutil -r -a SID=orcl -b "Fri Jul 1 16:00:00 IST 2022" -e "Thu Jul 29 16:00:13 IST 2022" -a CONNECTION_TYPE=DB -a TNS_SERVICE=orcl
Wallet Authentication:
ddutil -r -a SID=orcl -b "Fri Jul 1 16:00:00 IST 2022" -e "Thu Jul 29 16:00:13 IST 2022" -a CONNECTION_TYPE=WALLET -a TNS_SERVICE=orcl
Data is not available for the Topic
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please select whether the article was helpful or not.
Comments cannot contain these special characters: <>()\