How to fix error for ORA-01555: Snapshot too old during migration in RSA Via Identity Management and Governance (IMG)
2 years ago
Originally Published: 2016-03-04
Article Number
000056241
Applies To
RSA Product Set: Identity Management and Governance
RSA Product/Service Type: Enterprise Software
RSA Version/Condition:  6.9.1 P09 (Upgrade from 5.0.4 HF10)
Platform: WebSphere 8.5.5
Product Description: Access Certification Manager
Issue
When running a migration from 5.0.4 HF10 to 6.9.1 P09 after about 10-20 seconds, the migration fails with an ORA-01555 error and running over 9000 seconds.
 
Current UNDO Tablespace is 90 GB in size.
UNDO RETENTION is 900 seconds.

There are details of the error found in the migration log:
SQL/line#: 
/nswspd01/profiles/node/installedApps/nswspdCell/aveksa.ear/aveksa.war/WEB-INF/database/Upgrade/Initialization/postupdate/ACM-00009.sql(10): 
Start time [Wed Feb 24 03:49:49 GMT 2016] 
DECLARE 
v_idc_id T_DATA_COLLECTORS.ID%TYPE; 
v_idc_runs Metadata_Management_Pkg.idc_unif_runs_rt; 
v_count INTEGER; 
v_oracle_version VARCHAR2(4000) := NULL; 
BEGIN 
DBMS_OUTPUT.PUT_LINE('Creating Should-Have Exploded Data'); 

--@see ACM-23914: applying Oracle recommendation to use this internal optimizer setting to avoid situation such as below where we loop with varying data sets 
-- recommended setting does not seem to be compatible with Oracle 10.2.x 
select Version into v_oracle_version FROM PRODUCT_COMPONENT_VERSION WHERE Product like 'Oracle Database%'; 
if (v_oracle_version not like '10.2%' ) then 
execute immediate 'ALTER SESSION SET "_optimizer_use_feedback" = FALSE'; 
end if; 

FOR rdc_rec IN ( 
SELECT DC.LAST_PROCESSING_RUN_ID AS RUN_ID, RDC.ID AS RDC_ID, RDC.USES_IDC_ID AS IDC_ID 
FROM T_AV_RoleDataCollectors RDC 
JOIN T_DATA_COLLECTORS DC ON RDC.ID = DC.ID 
WHERE RDC.USES_IDC_ID IS NOT NULL 
AND DC.IS_DELETED ='FALSE' 
AND RDC.ID <> -1 
) LOOP 
v_idc_id := rdc_rec.IDC_ID; 
v_idc_runs := Metadata_Management_Pkg.Get_Latest_IDC_Unif_Runs(v_idc_id); 
SELECT COUNT(*) INTO v_count FROM T_AV_MODEL_EXPLODEDUSERENTS WHERE RDC_ID = rdc_rec.RDC_ID; 
IF v_count = 0 THEN 
Load_Role_Data_Pkg.Explode_ShouldHave_UserEnts(rdc_rec.RUN_ID, rdc_rec.RDC_ID, v_idc_id, v_idc_runs); 
END IF; 
END LOOP; 

DELETE FROM GTT_EXP_ROLES; 
INSERT INTO GTT_EXP_ROLES (ID, ROLE_TYPEID) SELECT ID, 'C' || ID FROM T_AV_ROLES WHERE RDC_ID = -1; 
Role_Management_Pkg.Explode_LocalRoles(); 
DELETE FROM GTT_EXP_ROLES; 

-- case where this table have tons of data...and has been greatly modified in migration stream 
Database_Statistics.GATHER_TABLE_IF_NEEDED('T_AV_MODEL_EXPLODEDUSERENTS'); 

FOR pending_rec IN ( 
SELECT v.ROLEVERSION_ID, NVL(x.rowCount, 0) as rowCount 
FROM T_AV_ROLEVERSIONS v 
LEFT OUTER JOIN ( 
SELECT ROLE_ID, COUNT(*) as rowCount 
FROM T_AV_MODEL_EXPLODEDUSERENTS 
WHERE ROLE_TYPE = 'P' 
AND ENTITLEMENT_TYPE <> 'pending-role' 
GROUP BY ROLE_ID 
) x 
ON x.ROLE_ID = v.ROLEVERSION_ID 
WHERE RDC_ID=-1 
AND LOCAL_EXPLODE_IND = 'N' 
AND v.ROLEVERSION_ID in (select a.ROLEVERSION_ID from T_AV_ROLEVERSIONS a 
WHERE ROLEVERSION_ID >= (select max(ROLEVERSION_ID) from T_AV_ROLEVERSIONS b 
WHERE b.STATE='X' and a.ROLE_ID=b.ROLE_ID) and a.RDC_ID=-1) 
) LOOP 
IF ( pending_rec.rowCount = 0 ) THEN 
Role_Management_Pkg.Explode_LocalRoleVersion(pending_rec.ROLEVERSION_ID); 
ELSE 
-- If we found any results ( 
UPDATE T_AV_ROLEVERSIONS arv 
SET arv.LOCAL_EXPLODE_IND = 'Y' 
WHERE arv.ROLEVERSION_ID = pending_rec.ROLEVERSION_ID; 
END IF; 

-- trying commit for each loop iteration to avoid severely skewed execution plans 
commit; 
END LOOP; 

DBMS_OUTPUT.PUT_LINE('Finished Creating Should-Have Exploded Data'); 
END; 
java.sql.SQLException: ORA-01555: snapshot too old: rollback segment number with name "" too small 
ORA-06512: at line 40 

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440) 
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) 
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837) 
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445) 
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191) 
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523) 
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193) 
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:999) 
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315) 
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1822) 
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1787) 
at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:280) 
at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.pmiExecuteUpdate(WSJdbcStatement.java:1804) 
at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeUpdate(WSJdbcStatement.java:1135) 
at com.aveksa.migration.jdbctool.SQLFileExecutor.execute(SQLFileExecutor.java:187) 
at com.aveksa.migration.jdbctool.SQLFileExecutor.execute(SQLFileExecutor.java:99) 
at com.aveksa.migration.jdbctool.IncrementalUpdate.update(IncrementalUpdate.java:488) 
at com.aveksa.migration.jdbctool.MigrateSchema.execute(MigrateSchema.java:113) 
at com.aveksa.migration.jdbctool.CheckDatabase.migrateSchema(CheckDatabase.java:1031) 
at com.aveksa.migration.jdbctool.CheckDatabase.runMigration(CheckDatabase.java:1575) 
at com.aveksa.migration.jdbctool.CheckDatabase.run(CheckDatabase.java:1618) 
.
.
---------------------------------
[0:00:00] File Completion Time: /nswspd01/profiles/node/installedApps/nswspdCell/aveksa.ear/aveksa.war/WEB-INF/database/Create Scripts/Create_Synonyms_Public_Schema.sql 
[21:45:38] Total Migration Time 
Report Summary Begin 
2 Errors found: 
java.sql.SQLException: ORA-01555: snapshot too old: rollback segment number with name "" too small 
ORA-06512: at line 40 
Examine the listed errors within this file. Please address the errors, if necessary, and perform the operation again. 
Report Summary End







 
Resolution
In an Oracle database setting, it would have an initialization parameter called undo_retention.

To resolve this issue, increase the value of this parameter to 12000 to stop the ORA-01555 error and allow the migration to complete without error.