Wednesday, July 24, 2013

Error ORA-20782 while deleting Golden Gate User

I got an error while deleting Golden Gate user. The error was as below.

SQL> select distinct
   owner
from
   dba_segments
where
   owner in
   (select username
    from dba_users
    where default_tablespace not in ('SYSTEM','SYSAUX')
   ) ;

OWNER
------------------------------
SCOTT
SENDER
GGATE

SQL> drop user ggate cascade;
drop user ggate cascade
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 2
ORA-20782: GoldenGate DDL Replication Error: Code :ORA-20782: Cannot DROP
object used in GoldenGate replication while trigger is enabled. Consult
GoldenGate documentation and/or call GoldenGate Technical Support if you wish
to do so., error stack: ORA-06512: at line 226
ORA-06512: at line 951

Solution

Since I had run the ddl_setup.sql which created the DDL trigger for Golden Gate user schema.
So before deleting the Golden Gate user , we need to drop the Golden Gate DDL trigger.

SQL> select * from dba_triggers where owner='GGATE';
no rows selected

SQL>  SELECT a.obj#, a.sys_evts, b.name
FROM trigger$ a,obj$ b
WHERE a.sys_evts > 0
AND a.obj#=b.obj#
AND baseobject = 0;

  OBJ#   SYS_EVTS NAME
---------- ---------- ------------------------------
     11990     524256 LOGMNRGGC_TRIGGER
     13175       4096 AW_TRUNC_TRG
     13177       8192 AW_REN_TRG
     13179        128 AW_DROP_TRG
     13885       8416 NO_VM_DDL
     13886        128 NO_VM_DROP_A
     55401         64 CDC_ALTER_CTABLE_BEFORE
     55402         32 CDC_CREATE_CTABLE_AFTER
     55403         32 CDC_CREATE_CTABLE_BEFORE
     55404        128 CDC_DROP_CTABLE_BEFORE
     56303         96 EXPFIL_RESTRICT_TYPEEVOLVE
     56304       8256 EXPFIL_ALTEREXPTAB_MAINT
     57530       4224 XDB_PI_TRIG
     56301        128 EXPFIL_DROPOBJ_MAINT
     56302        128 EXPFIL_DROPUSR_MAINT
     58827       4096 RLMGR_TRUNCATE_MAINT
     63684        128 SDO_DROP_USER
     63952         32 SDO_ST_SYN_CREATE
     63788        128 SDO_TOPO_DROP_FTBL
     68046     524256 SDO_GEOR_BDDL_TRIGGER
     68047     524256 SDO_GEOR_ADDL_TRIGGER
     68124        128 SDO_NETWORK_DROP_USER
     71594          1 MGMT_STARTUP
     75622     524256 GGS_DDL_TRIGGER_BEFORE
24 rows selected.

SQL> drop trigger GGS_DDL_TRIGGER_BEFORE;
Trigger dropped.

SQL> drop user ggate cascade;
User dropped.

1 comment: