Tuesday, May 29, 2018

Can't Drop a User From DB

Symptom:

Issue is that we can't drop a user from sqlplus
SQL>  select object_name , OBJECT_TYPE,CREATED , STATUS from dba_objects
where owner='SQL_WIFGWIHDMSBUHBARKGXAYFYMT';

no rows selected

SQL> DROP USER SQL_WIFGWIHDMSBUHBARKGXAYFYMT CASCADE;
DROP USER SQL_WIFGWIHDMSBUHBARKGXAYFYMT CASCADE

ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-20000: Oracle Text error:
DRG-11338: policy SQL_WIFGWIHDMSBUHBARKGXAYFYMT"."JSON_FTS_IDX does not exist
ORA-06512: at "CTXSYS.DRUE", line 171
ORA-06512: at "CTXSYS.CTX_ADM", line 279
ORA-06512: at line 1

the user doesn't has any object show in dba_objects , and drop user failed
with "DRG-11338: policy SQL_WIFGWIHDMSBUHBARKGXAYFYMT"."JSON_FTS_IDX does not exist"


Diagnose:

1. Get your sqlplus ospid like xxxx
2. ALTER SESSION SET EVENTS '10046 trace name context forever, level 12';
3. DROP USER SQL_WIFGWIHDMSBUHBARKGXAYFYMT CASCADE;
4. check  trace directory *xxxx.trc
   the trc file includes the sql running including recursive sql.
5.ALTER SESSION SET EVENTS '10046 trace name context off';

Solution:

  Find the 'JSON_FTS_IDX' exists on dr$index while not exist on dba_objects.  Drop 'JSON_FTS_IDX' manually to clear the way

1 comment:

Unknown said...

How i can manually delete this index?
"drop index JSON_FTS_IDX FORCE" says index doesn't exist