oracle clean up the archive log (cache)

 

1. The connection destination DB with RMAN:

  rman target /

  RMAN target sys/*****@orcl

2. In the RMAN command window, enter the following command (to clean up all archived logs):

  crosscheck archivelog all;

  delete expired archivelog all;

  Or clean up the log before the specified time (archivelog):

  DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7'; (delete specified archive log 7 days ago);

  Or directly as follows:

  RMAN target sys/*****@orcl;

  DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';

  =================================================================

  RMAN target sys/*****@orcl

  DELETE NOPROMPT ARCHIVELOG UNTIL TIME "TO_DATE('XXXX-XX-XX','YYYY-MM-DD')";

3. Other related commands:

  View the archive log list:

  List All ARCHIVELOG;

  archive log list to view failure:

  List All expired The ARCHIVELOG;

4. periodically clear archivelog:

  the following code can be written .bat file, under Control Panel in the Task Scheduler add a new scheduled task:

  RMAN target SYS / ***** @ orcl

  CROSSCHECK ARCHIVELOG All;

  the Delete expired the ARCHIVELOG All;

1. The connection destination DB with RMAN:

  rman target /

  RMAN target sys/*****@orcl

2. In the RMAN command window, enter the following command (to clean up all archived logs):

  crosscheck archivelog all;

  delete expired archivelog all;

  Or clean up the log before the specified time (archivelog):

  DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7'; (delete specified archive log 7 days ago);

  Or directly as follows:

  RMAN target sys/*****@orcl;

  DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';

  =================================================================

  RMAN target sys/*****@orcl

  DELETE NOPROMPT ARCHIVELOG UNTIL TIME "TO_DATE('XXXX-XX-XX','YYYY-MM-DD')";

3. Other related commands:

  View the archive log list:

  List All ARCHIVELOG;

  archive log list to view failure:

  List All expired The ARCHIVELOG;

4. periodically clear archivelog:

  the following code can be written .bat file, under Control Panel in the Task Scheduler add a new scheduled task:

  RMAN target SYS / ***** @ orcl

  CROSSCHECK ARCHIVELOG All;

  the Delete expired the ARCHIVELOG All;

Guess you like

Origin www.cnblogs.com/lcword/p/11546144.html