How to clean up full Oracle archived logs?

You can use the following steps to clean up Oracle archived logs:

  1. Firstly, check the storage path of the archive logs by using the following SQL statement:
  2. Retrieve the “name” and “value” columns from the “v$parameter” table where the “name” column contains the term “arc_dest”.
  3. Check the VALUE column in the results to confirm the storage path of the archived logs.
  4. To confirm the current archive mode using SQL statements, you can execute the following SQL query:
  5. Retrieve the log mode from the database view v$database.
  6. If the archive mode is set to ARCHIVELOG, it indicates that the archive mode is enabled and archive log cleanup is required.
  7. Use RMAN for archivelog cleanup. Start by connecting to RMAN with the following command:
  8. Log in to the database as the target user.
  9. The following command can be used in RMAN to clean up expired archive logs:
  10. Delete all archived log files that were completed more than 7 days ago.
  11. This command will delete all completed archive logs that are older than 7 days. The retention time can be adjusted as needed.
  12. You can use the following command to confirm the number of archived logs that have been cleaned:
  13. Mark as outdated.
  14. This command will display archived logs that are considered to be outdated.
  15. Lastly, exit RMAN and restart the database.
  16. Leave;
  17. Immediately shut down.
  18. Begin a new business venture.
  19. These commands will exit RMAN and restart the database, ensuring that the cleanup of archive logs has taken effect.

Please be cautious when cleaning up archived logs to ensure that important logs that have not been backed up are not deleted. It is recommended to back up the archived logs before cleaning to prevent data loss.

bannerAds