Make all business objects unknowledgeable

Version 1
    Question

    Script to make all business objects unknowledgeable so that they are not included within your knowledge build.  Apply on a test system first and take a full database backup.

    Answer

    -- script to make all business objects unknowledgeable, except the

    -- knowledge management objects such as article which must remain knowledgeable.

     

    DELETE FROM md_class_behaviour

    WHERE md_behaviour_type_guid = '98682EA8-75BD-42BD-80FC-47CD1A03FABF' -- guid for knowledgeable behaviour

    AND md_class_type_guid IN (

         SELECT md_guid FROM md_class_type

         WHERE md_module_guid != 'f04b4ad2-ef05-46a6-8497-b4ab0a7a5958' -- guid for knowledge module

    )

     

     

    -- Remove the knowledgable flag on attributes of business objects, again excluding

    -- the knowledge management domain.

     

    UPDATE md_attribute_type SET md_knowledge_flags = 0 WHERE md_guid IN (

         SELECT T1.md_guid FROM md_attribute_type T1

              JOIN md_class_type T2 ON T1.md_class_type_guid = T2.md_guid

              WHERE T2.md_module_guid <> 'f04b4ad2-ef05-46a6-8497-b4ab0a7a5958'

              AND T1.md_knowledge_flags > 0

         )

    Environment

    ITBM all versions