On a non-production database I was getting the following error when trying to delete archive logs with RMAN.
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process archived log file name=+RECO/DBP1/ARCHIVELOG/2017_05_07/thread_1_seq_32041.11548.943352263 thread=1 sequence=32041
This database does not have any golden gate processes associated with it, so why doesn’t Oracle want to delete the archive log?
The database was rebuilt with a copy of a production database that did have golden gate running on it.
We can see the name of the extract that is still registered with the database.
SYS dbp01> select CAPTURE_NAME from dba_capture; CAPTURE_NAME -------------------------------------------------------------------------------------------------------------------------------- OGG$CAP_EXTDBP01 Elapsed: 00:00:00.35
Since the database was a copy of our production database that did have golden gate running, it till thinks there is a valid extract. Connecting to the database and unregistered the extract allows the archive log to be deleted.
GGSCI (dclxoradbd01) 1> dblogin userid ggs, password xxxx Successfully logged into database. GGSCI (dclxoradbd01 as ggs@dp5fact1) 9> UNREGISTER EXTRACT EXTFWBP database Successfully unregistered EXTRACT EXTFWBP from database.
UPDATE 11/13/2017:
One additional helpful command if you don’t have goldengate installed on the host where you are getting this error, you can remove the extract directly from the database
SQL> exec DBMS_CAPTURE_ADM.DROP_CAPTURE('OGG$CAP_EXTDBP01') PL/SQL procedure successfully completed.
Update 08/10/2018
I usually just generate the code I need to run like this since I usually want to drop all the captures
select 'exec DBMS_CAPTURE_ADM.DROP_CAPTURE('''||CAPTURE_NAME||''');' from dba_capture;