Showing results for 
Search instead for 
Do you mean 

ORA-20132: Table is Not Version Enabled error when attempt to use BeginDDL

by Technical Evangelist on ‎04-01-2016 08:44 AM - edited on ‎04-06-2016 02:00 PM by Moderator (964 Views)

Symptoms

GeoMedia Oracle Object LTT data server relies on Oracle's Workspace Manager for transaction and revision set commands. Oracle Workspace Manager provides a proceedure called BeginDDL which can be used to disable a seccured table to allow modifications to the table.

When upgrading version enabled (securred) tables to Oracle 12c using:

BEGIN
DBMS_WM.BeginDDL('MyTableName');
END;

The following error may occur:

ORA-20132: table 'OWNER.MyTableName' is not version enabled
ORA-06512: at WMSYS.LT, line 2470
ORA-06512: at line 2

Diagnosis

A check of the folloiwng:

SELECT OWNER, TABLE_NAME, STATE FROM ALL_WM_VERSIONED_TABLES;

shows

OWNER TABLE_NAME STATE
------------------------------ ------------------------------ -------------
MYOWNER MyTableName LWEV

What is LWEV and how do we fix it?

Solution

LWEV is lightweight version enabled. The LWEV state may indicate that post install part of the upgrade did not complete or there is a problem with constraints. Try running the following:

 

EXEC DBMS_WM.RecoverMigratingTable('MyTableName', TRUE);

 

If there are a lot of tables in this state, you can try:

 

EXECUTE DBMS_WM.RecoverAllMigratingTables;

 

but usually its best to try to fix one and once that is done, then use the RecoverAll. The problem can also be caused by triggers or constraints on the original data and in 12c, usually its privilege related. In any case, this should get you past the LWEV issue to the real problem. In the case above, RecoverMigratingTable returned the following:

 

ORA-20221: MYOWNER.MyTableName could not be recovered from Migration Error. Please query all_wm_vt_errors view to get the error
ORA-01720: grant option does not exist for 'WMSYS.WM$24$_MW$'
ORA-06512: at "WMSYS.LT", line 10018
ORA-06512: at line 1

 

SELECT OWNER, TABLE_NAME, STATE, STATUS, ERROR_MSG, SQL_STR FROM ALL_WM_VT_ERRORS;

 

Should give a hint in how to fix this, in this case its a privilege problem:

 

CONNECT SYS/pswd@server as SYSDBA
GRANT ALL ON WMSYS.WM$24$_MW$ TO MYOWNER WITH GRANT OPTION;

 

Then run

EXEC DBMS_WM.RecoverMigratingTable('MyTableName', TRUE);

 

again and the problem whould be solved. Keep in mind that security on 12c (11g as well) is a lot tighter

If you are using GeoMedia here, you also need to grant the following:

 

GRANT SELECT ON SYS.GV_$SESSION TO PUBLIC WITH GRANT OPTION;
GRANT SELECT ON SYS.V_$SESSION TO PUBLIC WITH GRANT OPTION;

 

Or grant to your specific user instead of PUBLIC.

Contributors