View Archive
sql> archive log list;
Database log mode archive mode AutoArchive enable
archive endpoint use_db_recovery_file_dest
the oldest online log sequence 2536 the
next archive log sequence 2538
Current log sequence 2538
Check the storage location first
Sql> show parameter recover;
NAME TYPE VALUE
-----------------------------------------------------------------------------
db_recovery_file_dest string D:\app\Administrator\flash_recovery_area
Db_recovery_file_ Dest_size Big integer 50G
recovery_parallelism integer 0
You can see the archive log D:\app\Administrator\ The Flash_recovery_area directory is not purged periodically, and the time is long, and the folder takes up a lot of space. If you cannot manually delete directly under the operating system, you should use the Rman deletion of Oracle to connect to the target db:
RMAN Target sys/sysoracle123
In the Rman Command window, enter the following command:
Crosscheck Archivelog all;
--Verifying that the archive log for DB is the file at the specified location of the Log_archive_dest parameter, and that when the archive log is manually deleted, the Rman backup detects that the log is missing and cannot proceed further. So at this point you need to manually perform the crosscheck process, after which Rman backups can be restored to normal.
Delete expired archivelog all; ---Delete an expired log:
You can also specify a date deletion
DELETE Archivelog all COMPLETED before ' SYSDATE-7 ';
--(Specify to delete archive log 7 days ago)
Other Related orders:
--View archived Log listings: List
archivelog all;
--View the list of failed archive logs: Listing
expired Archivelog all;
Periodically clear Archivelog:
--You can write the following code as a. bat file, add a new scheduled task under the control Surface Task schedule:
RMAN target sys/sysoracle123
crosscheck archivelog all;
Delete Expired archivelog all;
DELETE noprompt Archivelog all COMPLETED before ' SYSDATE-7 ';
---Notes
have been deleted after the test file, but the directory is not deleted, obsessive-compulsive disorder can be deleted by other means