Building block views
You can use the building block views to write queries based on the Tivoli® Common Data Model (CDM) point of view. These views are useful if you are familiar with the CDM; they do not require any knowledge of where configuration items are stored in the TADDM database base tables.
- For DB2® databases: create_building_block_views_db2.sql
- For Oracle databases: create_building_block_views_oracle.sql
- from CDM object type to building block database view name
- from attribute to database view column name
- from relationship to JOIN syntax
BB_%_V
In
each view name, the %
is the name of the object type.
Each object type is mapped to a building block view, yielding more
than 1,000 available building block database views representing object
types.For example, the CDM defines the sys.windows.WindowsComputerSystem
object
type, which is stored in the COMPSYS base table in the TADDM database.
This table also includes many other object types that extend the sys.ComputerSystem
object
type (for example, sys.LinuxUnitaryComputerSystem
).
To query sys.windows.WindowsComputerSystem
configuration
items from the database using a building block view, you would query
the BB_WINDOWSCOMPUTERSYSTEM20_V database view.
BB_%J
For more information
about these special views, see JOIN definitions.View definitions
For each building block view, the comments include a section describing the view and the corresponding CDM objects. For example, the view definition section of the BB_WINDOWSCOMPUTERSYSTEM20_V building block view is as follows:
-- ######## model.topology.sys.windows.WindowsComputerSystem ########
--
-- View...... BB_WINDOWSCOMPUTERSYSTEM20_V
-- Class......................... model.topology.sys.windows.WindowsComputerSystem
-- Super classes................. model.topology.sys.ComputerSystem
-- model.topology.core.ManagedElement
-- model.ModelObject
-- model.topology.process.itil.ConfigurationItem
model.topology.sys.WindowsComputerSystem
object
type, and also lists several superclasses from which this type also
inherits attributes and relationship definitions.Column definitions for attributes
For each column corresponding to a CDM attribute, the comments include a section describing the column and the corresponding attribute. For example, the column definition section for the CPUSPEED_C column of the BB_WINDOWSCOMPUTERSYSTEM20_V view is as follows:
-- Column.... CPUSPEED_C
-- Attribute..................... CPUSpeed
-- Java Type..................... long, primitive
-- Declared By................... model.topology.sys.ComputerSystem
CPUSpeed
attribute defined by the model.topology.sys.ComputerSystem
object type. This
attribute is inherited by the model.topology.sys.WindowsComputerSystem
type. It
also lists the Java™ type used to represent the value of the
attribute.describe
command: Describe
command returns multiple columns including the names of database views, which you can use to query
the data displayed in the Details Panel
tab.db2 describe table BB_WindowsComputerSystem20_V
Column definitions for [0..1] relationships
-- Column.... PK__OSRUNNING_C
-- Attribute..................... OSRunning
-- Java Type..................... model.topology.sys.OperatingSystem, notContained
-- Declared By................... model.topology.sys.ComputerSystem
OSRunning
relationship defined by the model.topology.sys.ComputerSystem
object
type. It also shows that the Java type
of the attribute value is, in this case, another CDM type (model.topology.sys.OperatingSystem
).PK__
.
From a relational database point of view, the value of such a column
is the GUID of the configuration item on the other side of the relationship.The time stamp column in TADDM 7.3.0.3, and later
(timestamp)
string:-- Column.... LASTSTOREDTIME_C
-- Attribute..................... lastStoredTime
-- Java Type..................... long, primitive (timestamp)
-- Declared By................... model.ModelObject
- LASTSTOREDTIME_C, which is set to
long
type, for example1445417251307
. - LASTSTOREDTIME_T, which contains human readable time stamp, for example
Oct 21, 2015 10:47:31 AM
.
_T
.JOIN definitions
OSRunning
relationship of the BB_WINDOWSCOMPUTERSYSTEM20_V view is as
follows:-- Join......
-- Attribute..................... OSRunning
-- Java Type..................... model.topology.sys.OperatingSystem, notContained
-- Declared By................... model.topology.sys.ComputerSystem
-- Test Join..................... SELECT COUNT(1) FROM
-- BB_WINDOWSCOMPUTERSYSTEM20_V T1,
-- BB_OPERATINGSYSTEM62_V T2
-- WHERE T1.PK__OSRUNNING_C = T2.PK_C
sys.windows.WindowsComputerSystem
configuration
item might have a relationship to multiple sys.FileSystem
configuration
items, represented by a contains
relationship using
the fileSystems
attribute of sys.windows.WindowsComputerSystem
:-- Join......
-- Attribute..................... fileSystems
-- Java Type..................... Array of model.topology.sys.FileSystem, array
-- Declared By................... model.topology.sys.ComputerSystem
-- Test Join..................... SELECT COUNT(1) FROM
-- BB_WINDOWSCOMPUTERSYSTEM20_V T1,
-- BB_COMPUTERSYSTTEMS_88841D4BJ T2,
-- BB_FILESYSTEM71_V T3
-- WHERE T1.PK_C = T2.PK__JDOID_C
-- AND T3.PK_C = T2.PK__FILESYSTEMS_C
Many-to-many relationships are stored in the intermediary mapping table (in this example, the BB_COMPUTERSYSTTEMS_88841D4BJ mapping table).