Self-Solve Knowledge Search

Minimize Maximize
Error 'Failed to fetch data from ANALYSIS_ITEM_FOLDERS'
Title :
Error 'Failed to fetch data from ANALYSIS_ITEM_FOLDERS'
Document ID :
KM01892541
Product - Version:
quality center ;
OS :
Updated :
Fri Oct 16 06:21:33 GMT 2015
Summary :
Sometimes after the user copying a new project from other project, the user might get the 'Failed to fetch data from ANALYSIS_ITEM_FOLDERS' error when they login to the new copied project and access Analysis view in Dashboard.
Problem

image text

 

And there is nothing display in the Analysis view page:

image text

Once the user try to create any object, they will get the following error:

image text

If the user check the QC log file, they might find the following error message:

Failed to fetch data from ANALYSIS_ITEM_FOLDERS; [Mercury][Oracle JDBC Driver][Oracle]ORA-00942: table or view does not exist Failed SQL: /* ~~QC */ SELECT AIF_DESCRIPTION,AIF_ID,AIF_LOGICAL_NAME,AIF_NAME,AIF_OWNER,AIF_PARENT_ID,AIF_PATH,AIF_SEGMENT_ID,AIF_VER_STAMP,AIF_PUBLIC FROM ANALYSIS_ITEM_FOLDERS LEFT OUTER JOIN VF_ANALYSIS_ITEM_FOLDERS ON AIF_ID = VF_ANALYSIS_ITEM_FOLDERS.VF_AIF_ID WHERE ((AIF_ID IN (/*P*/2415)) AND (EXISTS (SELECT 1 FROM ANALYSIS_SEGMENTS WHERE AS_ID = AIF_SEGMENT_ID AND (AS_IS_PUBLIC = /*P*/'Y' OR AIF_OWNER IN (/*P*/'admin',/*P*/'__default__'))))) ORDER BY AIF_ID ASC;

Cause

 

Mostly the issue happens in the following circumstance:

 

1. When we copy the huge project from SQL server to Oracle, if during the DB data copy there is any error occur, the copy task will stop. But after we correct the error, ALM provide a feature that we can recover the copy. If we recover the copy, the project will be created as well

image text

2. Incorrect Owner ship of the tables (In case of SQl server)

3. If it is oracle , the user has no enough object permissions.

 

The root cause for this issue is somehow the following views in DB for analysis view was not copied correctly to the new project DB or they are missing:

VF_ANALYSIS_ITEM_FOLDERS

VF_ANALYSIS_ITEMS

 

In such situation verify and repair tool might be not able to fix the issue.

Fix
To fix this issue the user need to create or replace the view manually in new project DB. Use the following Query to create the missing view:

 

CREATE OR REPLACE FORCE VIEW "<Schema/DB name >"."VF_ANALYSIS_ITEM_FOLDERS" ("VF_AIF_ID", "AIF_PUBLIC") AS SELECT ANALYSIS_ITEM_FOLDERS.AIF_ID AS VF_AIF_ID, ANALYSIS_SEGMENTS.AS_IS_PUBLIC AS AIF_PUBLIC FROM ANALYSIS_ITEM_FOLDERS INNER JOIN ANALYSIS_SEGMENTS ON ANALYSIS_ITEM_FOLDERS.AIF_SEGMENT_ID = ANALYSIS_SEGMENTS.AS_ID;

 

CREATE OR REPLACE FORCE VIEW "<Schema/DB name >"."VF_ANALYSIS_ITEMS" ("VF_AI_ID", "AI_PUBLIC") AS SELECT ANALYSIS_ITEMS.AI_ID AS VF_AI_ID, ANALYSIS_SEGMENTS.AS_IS_PUBLIC AS AI_PUBLIC FROM ANALYSIS_ITEMS INNER JOIN ANALYSIS_SEGMENTS ON ANALYSIS_ITEMS.AI_SEGMENT_ID = ANALYSIS_SEGMENTS.AS_ID;