Created
October 6, 2016 16:42
-
-
Save dotmaik1/266dd4d45d983f45c8a2435665b00ac6 to your computer and use it in GitHub Desktop.
delete archived redo logs not needed to flash back to a guaranteed restore point
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select extract(day from (sysdate - min(trunc(time))) day to second) + 1 | |
| from v$restore_point | |
| / | |
| I loaded the result into an environment variable. (Many thanks to whoever posted the code for that on this site. Experts Exchange rocks!) | |
| Then I used RMAN to delete the archivelogs like this: | |
| delete archivelog all completed before 'SYSDATE - $RESTORE_POINT_AGE'; | |
| rman | |
| connect target / | |
| CONNECT CATALOG RMAN/RMAN@RMANMX | |
| CROSSCHECK ARCHIVELOG ALL; | |
| DELETE NOPROMPT EXPIRED ARCHIVELOG ALL; | |
| DELETE NOPROMPT ARCHIVELOG UNTIL TIME 'SYSDATE-6'; | |
| catalog recovery area; | |
| First two commands are optional. But it is wise to use them. With these commands |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment