COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Cognos Administration => Topic started by: mrcool on 11 Sep 2014 08:49:59 PM

Title: Cognos package and datasource dependency from content store
Post by: mrcool on 11 Sep 2014 08:49:59 PM
Hi All,

I am able to fetch all the packages and datasources from the content store but not finding a way to establish the association between them.
Could any one help me with the query or tables which has the relation between the package and datasource?
I don't want to use free tools like motio as it's not suitable for my requirement.
I would also like to know where I can find the model xml in content store as the table(CMOBJPROPS7) specified in the documentation doesn't have model xml in it.

Thanks,
mc
Title: Re: Cognos package and datasource dependency from content store
Post by: saumil287 on 12 Sep 2014 12:25:45 AM
Hi,
  The reports xml is stored in CMOBJPROPS7  table and datasources are stored in a seperate table.

The model.xml(I think) comes from a multiple table. Also the model.xml is stored locally in your project file location.

The association Info is present inside the model.xml file in the bottom which also contains a package Info. That package Info is present in report specification xml

Regards
saumil
Title: Re: Cognos package and datasource dependency from content store
Post by: mrcool on 13 Sep 2014 07:12:35 AM
Thanks Saumil. Do you have any SQL to find the association?
Title: Re: Cognos package and datasource dependency from content store
Post by: mrcool on 15 Sep 2014 10:57:08 PM
Please help me with the content store table that has model.xml spec. I browsed all the tables but couldn't find it anywhere.

Thank you.
Title: Re: Cognos package and datasource dependency from content store
Post by: saumil287 on 16 Sep 2014 02:19:01 AM
Hi,

What you want is model.xml which you can get form the local project file of cognos framework manager.
Go to the project folder of what model.xml you want and then look for model.xml.

you can use SDK to access the model.xml from the server.

If you are getting the model.xml from local folder then why you want to go to the server and access that?

Thanks & Regards
saumil sanghvi

Title: Re: Cognos package and datasource dependency from content store
Post by: mrcool on 16 Sep 2014 02:41:54 AM
Thanks Saumil. Basically I want to know the data source associated with the reports. As I can not get that association directly I am trying to find out model.xml in content store to find out the datasource of the package.
Title: Re: Cognos package and datasource dependency from content store
Post by: edewerth on 17 Sep 2014 08:58:27 AM
Given the variety of methodologies of configuration, my package and reports are open freely to be used by any of the 300 datasources  that I have and we can control that by security Roles so you might want to see what roles also have access to the reports and package.
Title: Re: Cognos package and datasource dependency from content store
Post by: mrcool on 23 Sep 2014 08:42:23 PM
Thanks Edward, As of now I am looking for only the data sources of my reports. I have tried everything I know but still no luck.
Title: Re: Cognos package and datasource dependency from content store
Post by: saumil287 on 26 Sep 2014 05:56:07 AM
Hi,

If you know the cognos framework manager project which is used to create package and use that package to create reports then you can identify which datasource the reports are using?

SOLN: Go to the model.xml of the FM project, open that xml look for datasources tag which are used in the model at that bottom in the file, You will get the datasource name then you can edit tthe datasource to look at which database it is pointing to?

2nd approach: The reports for which you want to find the datasource, there is a report function which you can place in the report which gives you the name of the datasource the report is using.
I did previouly long back but not recognize it, you can go through the available list of functions from report studio

Thanks & Regards
saumil sanghvi

Title: Re: Cognos package and datasource dependency from content store
Post by: mrcool on 01 Oct 2014 07:28:16 PM
Thanks Saumil.

I cannot go with either of your solution as I have so many models and reports. I am looking for a generic solution which can give me the information I am looking for.
Title: Re: Cognos package and datasource dependency from content store
Post by: mrcool on 01 Oct 2014 07:55:22 PM
Is there any KB document using SDK?
Title: Re: Cognos package and datasource dependency from content store
Post by: saumil287 on 19 Oct 2014 03:36:37 AM
Hi,

I also gone through the content store, but no model is found,
but using sdk, you can fetch the model.xml from content store which might acessing multiple tables and then creates a model.xml

You need to check with sdk sample in cognos

Thanks & Regards
saumil sanghvi
Title: Re: Cognos package and datasource dependency from content store
Post by: CognosAnalytics on 04 Nov 2014 07:08:51 PM
Hello mrcool,
You will need to use SDK to get this information exported into csv/txt. These are the major steps you would take when going the SDK route.
1)Search for all reports/queries.
2)Get the package name for each report.
3)For each package, extract the model and save it in a temp XML file.
4)Parse the temp file using DOM to get the node value for cmDataSource tag within the XML.

But I have a question, do you really need a report to data source association? That information "can be" vague. Just to give you a very simple scenario: A model has references to 3 data sources and has multiple query subjects, lets say Query Subject 1, Query Subject 2 and Query subject 3. Query subject 1 pulls data from data source 1, Query subject 2 pulls data from data source 2 and Query subject 3 pulls it from data source 3. All these query subjects form one package and is published to the portal. Now, Report 1 uses Query Subject 1, Report 2 uses Query subject 2 and Report 3 uses Query subject 3.

If you were to write an SDK code, which is possible, Report 1 will point to package 1 and package 1 will point to all 3 data sources. This information can be ambiguous and not entirely accurate as Report 1 is never tied to Data source 2 or 3, may be not in your case, but just trying to show a possibility.

For SDK help, to get package names from reports, please check this IBM KB:
https://www-304.ibm.com/support/docview.wss?uid=swg21374788

For getting Data source names from the package, using SDK get the model.xml for that package and save it, then parse it using DOM for the tag <cmDataSource> in the XML.

Let me know if you need more info on this.

-Cognos810