delete force archivelog until time 'trunc(sysdate-4)' backed up 1 times to device type disk;
backup archivelog all not backed up;
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 2 TIMES TO DISK;
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 4 TIMES TO 'SBT_TAPE';
----磁带的策略不会用到disk上,需要单独设置
Symptoms
- Database A Cloned to Database B on Clone server.
- Golden Gate is Configured on Source datbase A. Database B which is cloned from Source doesnot need Golden Gate.
- Deletion of Archivelog on the Clone reports
RMAN-08137: warning: archived log not deleted, needed for standby or upstream capture process
archived log file name=<name> thread=1 sequence=1
Changes
Cause
The source database has Golden Gate configured.
Since a clone is a copy of the source database, it will have capture name entires in the dba_capture .
Solution
There are two options
Option 1 :- On Clone run use delete force option
Delete the Archivelog using Force Option
Rman target /
Rman> delete force archivelog all completed before 'sysdate-n' ; --->Replace n with the Number of days
Option 2:- On Clone Identify the Golden gate Capture information and drop them
SQL> Connect /as sysdba
SQL> select capture_name, capture_type, status, queue_owner, capture_user, start_scn, oldest_scn, required_checkpoint_scn from dba_capture;
The above will show the list the capture name on clone.
Run
Set serveroutput on ;
Set numwidth 20 ;
variable reqscn number;
variable reqrls number;
execute sys.dbms_rcvman.getRequiredSCN(:reqscn, :reqrls);
print reqscn;
print reqrls;
This SCN Primted Will Matches with REQUIRED_CHECKPOINT_SCN of the GG Capture Process
Drop the capture information on Clone where Goldengate is not configured/required.
SQL>exec dbms_capture_adm.drop_capture(capture_name=>'<Capture name>');
Once done
SQL> select capture_name, capture_type, status, queue_owner, capture_user, start_scn, oldest_scn, required_checkpoint_scn from dba_capture;
Should show no rows
----------------------------- force
Symptoms
This database have been converted from RAC to Standalone database .
Thread 2 or related Thread from previous RAC database has been disabled.
While backing up the archive logs using Rman following error is reported:
RMAN backup log:
RMAN-08515: archived log file name=<archivelog path>/<archivelogname>.dbf thread=1 sequence=114535
RMAN-08137: WARNING: archived log not deleted as it is still needed
RMAN-08515: archived log file name=<archivelog path>/<archivelogname>.dbf thread=1 sequence=114536
RMAN-08137: WARNING: archived log not deleted as it is still needed
RMAN-08515: archived log file name=<archivelog path>/<archivelogname>.dbf thread=1 sequence=1145
If using Primary and Standby database.
The archive logs have already been applied in the Standby database successfully.
Changes
This database have been converted from RAC to Standalone database .
Cause
The issue is caused due to following bug
Bug 9040665 ----> Closed as Duplicate of Bug 8367313
Abstract: RMAN-8137: WARNING: ARCHIVED LOG NOT DELETED AS IT IS STILL NEEDED.
Fixed In Ver: 11.2
Rman is not accounting for disabled nodes in RAC when Deleting archive log.
Solution
Check for the availability of one off patch for Bug 8367313
Download and apply one off patch Patch 8367313 if available
or
Workaround
=========
Use force" on the delete of archive log
For example
RMAN> delete force archivelog until time 'trunc(sysdate-4)' backed up 1 times to device type disk;
---------------force 的妙用
How to keep the archivelog in FRA for longer time wihtout getting deleted by FRA clean up job (Doc ID 3006383.1)
Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.
GOAL
1) Need to backup to disk once and only one backup of each archivelog has to be taken
2) Only older then 7 days archivelogs should be deleted
3) Need to force FRA not to cleanup backed up archivelogs those are less then sysdate-7
SOLUTION
1) Every time archivelog files are being backed up, include keywords "not backed up".
RMAN>
As per this configuration, FRA has to delete the archvielogs there were backed up to disk 2 times.
Also delete archivelog will not delete the archvielogs those were backed up only once.
Even if "delete archivelog all;" executed, this will produce error "RMAN-08138" and Archivelogs will not be deleted
3) Now, you can run delete archivelog script to delete the archivelogs older then 7 days:
RMAN> delete noprompt force archivelog until time 'sysdate-7';
----注意force的位置
RMAN> delete noprompt archivelog until time 'sysdate-7' force ;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "force": expecting one of: "all, backed, completed, device, for, guid, incarnation, like, tag, ;"
RMAN-01007: at line 1 column 51 file: standard input
NOTE: When you use FORCE, Archivelog deletion policy will not be honored
Important:
* You must keep more and adequate space in FRA to hold 7 days of archivelog
* As we force database to keep 7 days archivelogs, Need to add more space to FRA
* If FRA space usage reaches to 100%, then Database will be in hung state
---RMAN Archivelog Deletion Policy 'Backed up N Times' is Ignored (Doc ID 1487508.1)--磁带的策略不和disk一样,默认是disk
SYMPTOMS
RMAN delete input syntax ignores ARCHIVELOG DELETION POLICY BACKED UP N TIMES TO 'SBT_TAPE':
RMAN> backup archivelog sequence 260 delete input;
Starting backup at 25-may-11 18:12:40
using channel ORA_DISK_1
skipping archived log file
<path>\USE_RECOVERY_FILE_DEST1_260_744745422.DBF; already backed up 1 time(s)
channel ORA_DISK_1: deleting archived log(s)
archived log file name=<path>\USE_RECOVERY_FILE_DEST1_260_744745422.DBF RECID=369 STAMP=752067783
Finished backup at 25-may-11 18:12:40
This archived log should not have been deleted given that it has never been
backed up to tape.
CHANGES
CAUSE
Bug 12611721 - ARCHIVELOG DELETION POLICY BACKED UP N TIMES TO 'SBT_TAPE' IGNORED
The bug if fixed in Oracle Release 12.2
SOLUTION
Apply the fix for Bug 12611721
In the mean time you need to be mindful the ARCHIVELOG DELETION POLICY is only honored when the same channel type is used during the backup.
For example:
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 4 TIMES TO 'SBT_TAPE';
RMAN> run {
allocate channel t1 type 'sbt_tape' PARMS 'SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/tmp)';
backup database plus archivelog delete all input;
}
allocated channel: t1
channel t1: SID=130 device type=SBT_TAPE
channel t1: WARNING: Oracle Test Disk API
Starting backup at 13 SEP 2012 10:51:48
channel t1: starting archived log backup set
channel t1: specifying archived log(s) in backup set
input archived log thread=1 sequence=169 RECID=8 STAMP=792776480
input archived log thread=1 sequence=170 RECID=1 STAMP=792776330
input archived log thread=1 sequence=171 RECID=2 STAMP=792776331
input archived log thread=1 sequence=172 RECID=3 STAMP=792776334
channel t1: starting piece 1 at 13 SEP 2012 10:51:48
channel t1: finished piece 1 at 13 SEP 2012 10:51:51
piece handle=xxxx tag=TAG20120913T105148 comment=API Version 2.0,MMS Version 8.1.3.0
channel t1: backup set complete, elapsed time: 00:00:03
channel t1: deleting archived log(s)
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=<path>/o1_mf_1_169_840lqb12_.arc thread=1 sequence=169
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=<path>/o1_mf_1_170_840mh9rb_.arc thread=1 sequence=170
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=<path>/o1_mf_1_171_840mhbvx_.arc thread=1 sequence=171
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/<path>/o1_mf_1_172_840mhg32_.arc thread=1 sequence=172
Finished backup at 13 SEP 2012 10:51:51