ORA-55622

ORA-55622: DML, ALTER and CREATE UNIQUE INDEX operations are not allowed on table...

Oracle Troubleshooting

DROP USER / Flashback Data Archive

Issue

Database version 12.2.0.1.0 on AIX.

DROP USER myschema CASCADE;

DROP USER myschema CASCADE*ERROR at line 1:ORA-00604: error occurred at recursive SQL level 1ORA-55622: DML, ALTER and CREATE UNIQUE INDEX operations are not allowed ontable "MYSCHEMA"."SYS_FBA_TCRV_127394"

Troubleshooting

SELECT * FROM DBA_FLASHBACK_ARCHIVE_TABLES;

no rows selected

COLUMN owner FORMAT a30

COLUMN object_name FORMAT a30

SELECT object_type, owner, object_name, object_id

FROM dba_objects

WHERE object_name LIKE '%127394%';


OBJECT_TYPE OWNER OBJECT_NAME OBJECT_ID----------------------- ------------------------------ ------------------------------ ----------TABLE MYSCHEMA SYS_FBA_DDL_COLMAP_127394 898036TABLE MYSCHEMA SYS_FBA_TCRV_127394 898040TABLE PARTITION MYSCHEMA SYS_FBA_HIST_127394 898038TABLE MYSCHEMA SYS_FBA_HIST_127394 898037TABLE SYS SYS_MFBA_NHIST_127394 898039INDEX MYSCHEMA SYS_FBA_TCRV_IDX1_127394 898041INDEX MYSCHEMA SYS_FBA_TCRV_IDX2_127394 898042
7 rows selected.
Hmm, if DBA_FLASHBACK_ARCHIVE_TABLES returns no rows, why are there objects? Let's see if there are corresponding segments...

SET LINESIZE 120

COLUMN owner FORMAT a10

COLUMN segment_name FORMAT a30

COLUMN partition_name FORMAT a30

COLUMN tablespace_name FORMAT a20

SELECT segment_type, owner, segment_name, partition_name, tablespace_name

FROM dba_segments

WHERE segment_name LIKE '%127394%';


SEGMENT_TYPE OWNER SEGMENT_NAME PARTITION_NAME TABLESPACE_NAME------------------ ---------- ------------------------------ ------------------------------ --------------------TABLE MYSCHEMA SYS_FBA_DDL_COLMAP_127394 FB_ARCHIVETABLE PARTITION MYSCHEMA SYS_FBA_HIST_127394 HIGH_PART FB_ARCHIVETABLE MYSCHEMA SYS_FBA_TCRV_127394 FB_ARCHIVEINDEX MYSCHEMA SYS_FBA_TCRV_IDX1_127394 FB_ARCHIVEINDEX MYSCHEMA SYS_FBA_TCRV_IDX2_127394 FB_ARCHIVE
Most Objects are reflected as Segments; it's just the TABLE owned by SYS unaccounted for. Do they have any data?

SELECT COUNT(*) FROM MYSCHEMA.SYS_FBA_DDL_COLMAP_127394;


COUNT(*)---------- 134

SELECT COUNT(*) FROM MYSCHEMA.SYS_FBA_HIST_127394;


COUNT(*)---------- 826

SELECT COUNT(*) FROM MYSCHEMA.SYS_FBA_TCRV_127394;


COUNT(*)---------- 2951
What about the SYS object without a segment?...

SELECT COUNT(*) FROM sys.SYS_MFBA_NHIST_127394;


COUNT(*)---------- 0
Given that this started when we tried to drop a user and DBA_FLASHBACK_ARCHIVE_TABLES returns no rows, perhaps we should drop the flashback archive. First let's double-check that nothing else appears to be using it by checking for other objects in the same tablespace...

SELECT segment_type, owner, segment_name, partition_name, tablespace_name

FROM dba_segments

WHERE tablespace_name = 'FB_ARCHIVE'


SEGMENT_TYPE OWNER SEGMENT_NAME PARTITION_NAME TABLESPACE_NAME------------------ ---------- ------------------------------ ------------------------------ --------------------TABLE MYSCHEMA SYS_FBA_TCRV_127394 FB_ARCHIVETABLE MYSCHEMA SYS_FBA_DDL_COLMAP_127394 FB_ARCHIVETABLE PARTITION MYSCHEMA SYS_FBA_HIST_127394 HIGH_PART FB_ARCHIVEINDEX MYSCHEMA SYS_FBA_TCRV_IDX1_127394 FB_ARCHIVEINDEX MYSCHEMA SYS_FBA_TCRV_IDX2_127394 FB_ARCHIVE
All good. Let's find the name of the flashback archive...

SELECT * FROM dba_flashback_archive;

SELECT * FROM dba_flashback_archive *ERROR at line 1:ORA-08181: specified number is not a valid system change numberORA-06512: at "SYS.SCN_TO_TIMESTAMP", line 1
That could be a clue to the root cause of the issue. Let's be more selective with our query to workaround this specific error...

COLUMN owner_name FORMAT a10

COLUMN flashback_archive_name FORMAT a30

SELECT owner_name, flashback_archive_name FROM dba_flashback_archive;


OWNER_NAME FLASHBACK_ARCHIVE_NAME---------- ------------------------------SYS MYFBA
Let's drop it...

DROP FLASHBACK ARCHIVE myfba;


Flashback archive dropped.
Let's try dropping our user again...

DROP USER myschema CASCADE;

drop user jcmsx cascade*ERROR at line 1:ORA-00604: error occurred at recursive SQL level 1ORA-55622: DML, ALTER and CREATE UNIQUE INDEX operations are not allowed ontable "JCMSX"."SYS_FBA_TCRV_127394"
Note that rerunning the query from dba_flashback_archive shows that the flashback archive still exists!So, let's resort to something unsupported (1). Make sure you engage Oracle Support before doing this in an environment that matters....

SELECT o.object_id, o. owner, o.object_name, t.property

FROM dba_objects_ae o, tab$ t

WHERE o.object_type = 'TABLE'

AND o.object_id = t.obj#

AND t.property = 9126805504

AND o.object_id IN ('898036','898040','898038','898037','898039','898041','898042');

Object numbers are from the earlier query of dba_objects. OBJECT_ID OWNER OBJECT_NAME PROPERTY---------- ---------- --------------------------- ---------- 898036 MYSCHEMA SYS_FBA_DDL_COLMAP_127394 9126805504 898040 MYSCHEMA SYS_FBA_TCRV_127394 9126805504

UPDATE tab$

SET property = 536870912

WHERE property = 9126805504

AND obj# IN ('898036','898040','898038','898037','898039','898041','898042');


2 rows updated.

COMMIT;


Commit complete.

DROP TABLE MYSCHEMA.SYS_FBA_TCRV_127394;


Table dropped.
Let's try dropping our user again...

DROP USER myschema CASCADE;

drop user myschema cascade*ERROR at line 1:ORA-00604: error occurred at recursive SQL level 1ORA-04020: deadlock detected while trying to lock object MYSCHEMA.SYS_FBA_HIST_127394
Let's try restarting the instance...

shutdown immediate

Database closed.Database dismounted.ORACLE instance shut down.

startup

ORACLE instance started.
Total System Global Area 2466250752 bytesFixed Size 8717688 bytesVariable Size 671091336 bytesDatabase Buffers 1778384896 bytesRedo Buffers 8056832 bytesDatabase mounted.Database opened.
Re-executing any of the queries above now returns "no rows selected". This is promising. Let's retry dropping our user again...

DROP USER myschema CASCADE;


User dropped.

Questions:

  1. Would bouncing the instance earlier in the process still have resolved the issue?

  2. What caused the spurious FBA objects to hang around even after the Archive was dropped?

  3. Has the direct update on TAB$ caused/left any other issues?

Bibliography & References


ORA-8181 WITH FLASHBACK ARCHIVE ENABLED TABLES IN 12.2.0.1 > (Doc ID 2593817.1)Bug 28451405 : ORA-08181 FBDA ERROR WHEN SELECTING FROM SYS.DBA_FLASHBACK_ARCHIVE IN 12.2FDA - Flashback Data Archive Usage and Best Practices (a.k.a. Total Recall) (Doc ID 2370465.1)
https://connor-mcdonald.com/2019/06/13/smon_scn_time-and-ora-8161-digging-deeper/ (ORA-8181)(1) https://www.morganslibrary.org/reference/flash_archive.htmlhttps://oracle-base.com/articles/12c/flashback-data-archive-fda-enhancements-12cr1https://docs.oracle.com/cd/E18283_01/server.112/e17110/statviews_3189.htm