Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
Expand all | Collapse all

Retrieve data sources/connections for packages and data modules

  • 1.  Retrieve data sources/connections for packages and data modules

    Posted Fri March 07, 2025 10:35 AM

    Hi,

    would anyone have a SQL to retrieve the list of packages and data modules along with the data sources they are using from the Cognos content store (ver 11.1.7)?

    I tried the free Motio which appears to have this for packages - but for a lot of them the data source list contains only an error like: Error occurred while loading data sources: RSV-SRV-0002 The document contains an error at line '1', column ' 137'.

    For data modules, it does not seem to provide any connection information.

    Thanks



    ------------------------------
    Tomáš Polakovič
    ------------------------------


  • 2.  RE: Retrieve data sources/connections for packages and data modules

    Posted Mon March 10, 2025 07:52 AM
    Edited by Thiago Teixeira Mon March 10, 2025 10:35 AM

    Hi Tomáš ! I don´t have CM on 11.1.7 on my Lab to test it, but this SQL could be a good starting point :

    ------

    SELECT 
        obj_names.name AS object_name,
        obj.search_path,
        CASE 
            WHEN obj.objectclass = 8 THEN 'Package'
            WHEN obj.objectclass = 3036 THEN 'Data Module'
            ELSE 'Other'
        END AS object_type,
        ds.name AS data_source_name,
        ds.search_path AS data_source_path
    FROM 
        cmobjects obj
    JOIN 
        cmobjectnames obj_names ON obj.id = obj_names.object_id
    LEFT JOIN 
        cmobjprops26 ref26 ON obj.id = ref26.id
    LEFT JOIN 
        cmobjects ds ON ref26.refobjid = ds.id
    WHERE 
        obj.objectclass IN (8, 3036) -- 8 = Package, 3036 = Data Module
    ORDER BY 
        object_type, object_name;

    ----

    cmobjects: Main table containing all Cognos content objects.
    objectclass = 8: Represents Packages.
    objectclass = 3036: Represents Data Modules.
    cmobjprops26: Table used for reference properties (i.e., links to data sources).
    cmobjectnames: Provides readable names for objects.




    ------------------------------
    Thiago Teixeira
    IBM Champion
    CTO - RCI Analytics Intelligence
    ------------------------------



  • 3.  RE: Retrieve data sources/connections for packages and data modules

    Posted Mon March 10, 2025 12:36 PM

    Hi, 

    thanks for the attempt, but most of those objects are called differently (ID ~ CMID) or don't exist at all (search_path). Class 8 is not package, but namespaceFolder‬, 3036 does not exist.

    Was this generated with LLM? I tried that path and it lead me nowhere.

    Thanks

    Tomas



    ------------------------------
    Tomáš Polakovič
    ------------------------------



  • 4.  RE: Retrieve data sources/connections for packages and data modules

    Posted Mon March 10, 2025 01:39 PM

    I'm setting up a lab with the same Cognos version to apply the necessary SQL updates and provide better support. Which Content Store database are you using-DB2, SQL, or Oracle?



    ------------------------------
    Thiago Teixeira
    IBM Champion
    CTO - RCI Analytics Intelligence
    ------------------------------



  • 5.  RE: Retrieve data sources/connections for packages and data modules

    Posted Mon March 10, 2025 02:54 PM

    DB2.

    Thank you



    ------------------------------
    Tomáš Polakovič
    ------------------------------



  • 6.  RE: Retrieve data sources/connections for packages and data modules

    Posted Mon March 10, 2025 02:57 PM

    Follow the SQL adjusted for CM on version 11.

    SELECT

    srcNames.name AS source_object_name,

    src.classid AS SourceClassID,

    refNames.name AS referenced_object_name,

    ref.classid AS ReferenceClassID

    FROM

    CMOBJECTS src

    JOIN CMOBJNAMES srcNames

    ON src.cmid = srcNames.cmid

    LEFT JOIN CMREFORD1 r

    ON src.cmid = r.cmid

    LEFT JOIN CMOBJECTS ref

    ON r.refcmid = ref.cmid

    LEFT JOIN CMOBJNAMES refNames

    ON ref.cmid = refNames.cmid

    WHERE

    r.refcmid IS NOT NULL AND refNames.ISDEFAULT=1 AND srcNames.ISDEFAULT=1

    ORDER BY

    source_object_name;

    Simply review the results, then filter by the SOURCECLASSID and REFERENCECLASSID that correspond to your Packages and Data Modules. 
    You can identify those class IDs by looking at the object names.
    Let me know if that helps.



    ------------------------------
    Thiago Teixeira
    IBM Champion
    CTO - RCI Analytics Intelligence
    ------------------------------



  • 7.  RE: Retrieve data sources/connections for packages and data modules

    Posted Tue March 11, 2025 10:12 AM

    Thanks...

    I was able to find the schema used in the data modules, but not the data source. That is, my data source name was not present in either  source_object_name or referenced_object_name, but I could seem the data module and the schemas it was using.

    Unfortunately, for packages, there was no data source listed - that is - the package name could only be found in the referenced_object_name, with the source_object_name containing the report which is using the package.



    ------------------------------
    Tomáš Polakovič
    ------------------------------



  • 8.  RE: Retrieve data sources/connections for packages and data modules

    Posted Wed March 12, 2025 03:00 AM

    Hi,

    This was an old requirement I had and it is quite complexe because :

    • packages can have many data sources
    • Packages can be multilanguage
    • and many more that I forgot

    When I tried to find a solution I went with Cognos SDK and found the most near solution.

    How to extract datasource information from the content store with the SDK

    Best regards



    ------------------------------
    German Rodriguez
    ------------------------------



  • 9.  RE: Retrieve data sources/connections for packages and data modules

    Posted Thu March 13, 2025 10:00 AM

    Hey Tomáš,

    You can use MetaManager (a similar tool to Motio) to obtain this information.  For packages, we can easily pull the datasource information, for data modules, rather than the datasource, those are often documented via deployment references (external to the data module, not necessarily external to Cognos).  

    I can set you up with a free key and walk you through this.  epleiss@microstrat.com or just visit us online, https://www.bspsoftware.com/products/metamanager/#mm-download, download the tool and request a trial key.  Tell them Eric sent you.



    ------------------------------
    Eric Pleiss
    Technical Sales Specialist
    BSP Software/Micro Strategies
    La Salle IL
    6183032966
    ------------------------------



  • 10.  RE: Retrieve data sources/connections for packages and data modules

    Posted Thu March 13, 2025 01:11 PM

    Tomáš Polakovič,

    Given your situation, I have attempted various approaches but was unable to develop a query that retrieves the required information. Although it might be possible to achieve this using the Cognos SDK, given the complexity involved, I strongly recommend utilizing BSP's MetaManager. It is an exceptional tool that I have successfully used to migrate thousands of user content items and security references across Packages, Reports, and Data Sources from the Series7 namespace to Active Directory, and it has proven to be highly effective.

    I wish you the best of luck. You are in good hands with MetaManager.

    Best regards,



    ------------------------------
    Thiago Teixeira
    IBM Champion
    CTO - RCI Analytics Intelligence
    ------------------------------