How To Drop Extract Capture Process Permanently on GoldenGate

I will give some code and explain to how to drop extract capture processes permanently on GoldenGate.

You can drop all extract capture processes with the below PL/SQL code.

BEGIN
     FOR i IN (SELECT capture_name FROM dba_capture)
     LOOP
         DBMS_CAPTURE_ADM.STOP_CAPTURE(i.capture_name, true);
         DBMS_CAPTURE_ADM.DROP_CAPTURE (i.capture_name, true);
     END LOOP;
 END;
 /

If you want to continues manual, you can follow the below code. It will work.

$ sqlplus / as sysdba
SQL> select capture_name from dba_capture;
Result:
CAPTURE_NAME
-------------
GGS$CAP_DSSSDDSS
SQL> exec DBMS_CAPTURE_ADM.STOP_CAPTURE('GGS$CAP_DSSSDDSS', true);
SQL> exec DBMS_CAPTURE_ADM.DROP_CAPTURE('GGS$CAP_DSSSDDSS', true);

If your capture process status is active while operation time, probably you will get the below error. Before drop operation, you must call STOP_CAPTURE procedure. Otherwise, you will get the below error.

ORA-01338 Other process is attached to Logminer session
ORA-06512 at "SYS.DBMS_CAPTURE_ADM_INTERNAL", line 238
ORA-06512 at "SYS.DBMS_CAPTURE_ADM_INTERNAL", line 225
ORA-06512 at "SYS.DBMS_CAPTURE_ADM", line 268

Lastly, you can drop to GoldenGate capture process in GoldenGate bash terminal with the below code.

GGSCI> dblogin userid gguser password xxxx
GGSCI> stop extract_process_name
GGSCI> unregister extract extract_process_name
GGSCI> delete extract_process_name

Leave a Reply

Your email address will not be published. Required fields are marked *