Pruning archive log files

Contributors NetAppZacharyWambold Download PDF of this page

You can prune the archive log files from the archive log locations while creating a backup.

  • Archive log files must be backed up by the current backup operation.

    If pruning is specified along with other backups that do not contain archive log files, the archive log files are not pruned.

  • The database must be in the mounted state.

    If the database is not in mounted state, enter the -force option along with backup command.

While performing a backup operation, you can specify the following:

  • Scope of pruning:

    • Delete all the archive log files.

    • Delete the archive log files until the specified System Change Number (SCN).

    • Delete the archive log files until the specified time.

    • Delete the archive log files before the specified time period.

  • Destination from where the archive log files must be pruned.

    Note Even when the archive log file pruning fails in one destination, SnapManager continues to prune the archive log files from the other destinations.

Before deleting the archive log files, SnapManager verifies the following:

  • Archive log files are backed up at least once.

  • Archive log files are shipped to Oracle Dataguard Standby database, if any.

  • Archive log files are captured by Oracle streams capture process, if any.

If the archive log files are backed up, shipped to standby, and captured by the capture process, SnapManager deletes all the archive log files in a single execution. However, if there are any archive log files that are not backed up, not shipped to standby, or not captured by the capture process, SnapManager deletes the archive log files one-by-one. The deletion of archive logs files in a single execution is faster than deleting archive logs one-by-one.

SnapManager can also group the archive log files and delete them batch-by-batch. Each batch will have a maximum of 998 files. This value can be configured below 998 by using the configuration parameter maximum.archivelog.files.toprune.atATime in the smo.config file.

SnapManager uses Oracle Recovery Manager (RMAN) commands to delete the archive log files. However, SnapManager does not integrate with the RMAN retention policies and deletion policies.

Note If you delete the archive log files from the archive log destinations, the pruning of archive log files fails.

SnapManager does not support pruning of archive log files in the following scenarios:

  • Archive log files are located in the flash recovery area.

  • Archive log files are located in the Standby database.

  • Archive log files are managed by both SnapManager and RMAN.

    1. Enter the following command: smo backup create -profile profile_name {[-full {-online | -offline | -auto} [-retain {-hourly | [-daily | -weekly | -monthly | -unlimited}] [-verify] | [-data [[-filesfiles [files]] | [-tablespaces-tablespaces [-tablespaces]] [-datalabellabel] {-online | -offline | -auto} [-retain {-hourly | [-daily | -weekly | -monthly | -unlimited]} [-verify] | [-archivelogs [-labellabel] [-commentcomment][-backup-destpath1 [,[path2]]] [-exclude-destpath1 [,path2]]] [-prunelogs {-all | -untilSCNuntilSCN | -until-dateyyyy-MM-dd:HH:mm:ss | -before {-months | -days | -weeks | -hours}} -prune-destprune_dest1,[prune_dest2]] [-taskspectaskspec]} -dump [-force] [-quiet | -verbose]

      If you want to…​

      Then…​

      Prune archive log files

      Specify the following options:

      • -prunelogs specifies deleting the archive log files while creating a backup.

        • -all specifies deleting all the archive log files.

        • -untilSCN specifies deleting the archive log files until the specified SCN.

        • -until-date specifies deleting the archive logs including the specified date and time.

        • -before {-months

      -days

      -weeks

      -hours} specifies deleting the archive log files before the specified time period.

      Include the destination from where the archive log files are to be pruned