Thursday, September 1, 2016

HANA : Inactive version error while Object Import

Home


Issue : We get following error while importing a view in HANA system.
"Error saving object: Repository: More than one inactive version exists; there exist already an inactive versions for object "


This happened because someone has an inactive version of the view in their user space. Other user might be editing it in parallel Or did not activated it after import.
In our case the other user's HANA ID is underlined in red.

Prerequisite: For solution option 2 ,You need read access to System Privilege : REPO.WORK_IN_FOREIGN_WORKSPACE

Solution : You have three options to solve your problem. Please choose best as per your case.

Option 1 :
The easiest solution is to ask the other user to activate the view or use the 'Revert to activate' option (from context menu after selecting the view) to roll back the view changes. This will restore the previous active version and then you can import/activate the view with your ID.

Option 2 : 
If the other user is not available then you can take control from other user by following this option :
Open the view in the editor(generally by double clicking it in Administrative perspective), and you will see warning. 
Now press the "Switch Version" button(highlighted) and select the last option.



You can use the option "Take over from USER" option to take over the control of inactive version.
You need following authorization assigned to you , otherwise the option will be disabled for you(like in screenshot above). This authorization will provide access to take control of inactive objects from other users.
System Privilege required for taking control  : REPO.WORK_IN_FOREIGN_WORKSPACE

Once you have the control then you can proceed with the import , re-import the view and then activate it.


Option 3:
The inactive or active views are stored in table INACTIVE_OBJECT and ACTIVE_OBJECT of "_SYS_REPO" schema. You can use following SQL to see if there are any inactive version of your view is present in the system or not.

select * from "_SYS_REPO"."INACTIVE_OBJECT" where object_name = 'YOUR_VIEW_NAME';
Example 
Select * from "_SYS_REPO"."INACTIVE_OBJECT" where object_name = 'CA_AGING_VENDOR_VIEW'
output of above query:




If you want to delete inactive object, you can execute delete statements for  this object in INACTIVE_OBJECT table.

delete from "_SYS_REPO"."INACTIVE_OBJECT" where object_name = 'CA_AGING_VENDOR_VIEW'

Once the inactive version is deleted you can proceed with re-import and activation of view.

No comments:

Post a Comment