Disclaimer

Thursday, 5 December 2024

DELETE INPUT vs DELETE ALL INPUT in RMAN

 


1. DELETE INPUT


  • How it works:
    RMAN deletes only the archived logs from the destination it used for the backup.

  • Example with multiple destinations (/dest1, /dest2, /dest3):
    If RMAN backed up the logs from /dest1, it will delete only the logs in /dest1. Logs in /dest2 and /dest3 will remain untouched.

  • Use Case:
    When you want to clean up only the archive log files from the specific destination used in the backup.


BACKUP ARCHIVELOG ALL DELETE INPUT;
In this example, RMAN backs up all archived logs and then deletes only the logs that were successfully backed up.




2. DELETE ALL INPUT

  • How it works:
    RMAN backs up one copy of each log sequence and then deletes all copies of the backed-up logs from all destinations.

  • Example with multiple destinations (/dest1, /dest2, /dest3):
    If RMAN backs up a log sequence, it will delete the log from /dest1, /dest2, and /dest3, clearing all copies.

  • Use Case:
    When you want to remove all duplicate copies of the archived logs after confirming they are backed up.


BACKUP ARCHIVELOG ALL DELETE ALL INPUT;
In this example, RMAN backs up all archived logs and then deletes all logs matching the backup criteria from the disk, regardless of whether they were used in the backup.








Key Differences Between DELETE INPUT and DELETE ALL INPUT

  1. DELETE INPUT:

    • Behavior: Deletes archived logs only from the location (one of the LOG_ARCHIVE_DEST_n) that RMAN used for the backup.
    • Use Case: Use when you want to remove only the archived logs from the specific destination that was backed up.
    • Impact: Other destinations remain untouched.

    Example:

    • LOG_ARCHIVE_DEST_1 = '/dest1'
    • LOG_ARCHIVE_DEST_2 = '/dest2'
    • If RMAN backs up logs from /dest1 and you use DELETE INPUT, only logs in /dest1 will be deleted.

    Command:

    BACKUP ARCHIVELOG ALL DELETE INPUT;
  2. DELETE ALL INPUT:

    • Behavior: Deletes archived logs from all configured destinations (LOG_ARCHIVE_DEST_n), regardless of which destination RMAN used for the backup.
    • Use Case: Use when you want to clean up archived logs across all destinations after they have been backed up.
    • Impact: Removes all copies of the archived logs from all destinations.

    Example:

    • Logs from /dest1 and /dest2 will both be deleted after the backup.

    Command:

    BACKUP ARCHIVELOG ALL DELETE ALL INPUT;




Key Notes

  • Both commands ensure the logs are backed up before they are deleted.
  • Use DELETE ALL INPUT carefully, as it will remove all copies of the backed-up logs.



No comments:

Post a Comment

How to recovery PDB when PDB database is dropped in Oracle

  How to recovery PDB when PDB database is dropped :) [oracle@rac01 ~]$ sqlplus '/as sysdba' SQL*Plus: Release 21.0.0.0.0 - Product...