Where in the database can we find the device alias?
Release : 20.3+
Component : UIM Operator Console - Inventory
The alias information is part of the CM_COMPUTER_SYSTEM_ATTR table. These records have a key and a value. The field you are looking for is cs_attr_key = DisplayAlias. The alias displayed in OC will be the in that record under the cs_attr_value field. You can join the CM_COMPUTER_SYSTEM table with the ATTR table on the cs_id field similar to the following:
Get a list of all systems and their alias:
SELECT
CS.ip,
CS.name,
CSA.cs_attr_key,
CSA.cs_attr_value
FROM CM_COMPUTER_SYSTEM_ATTR as CSA
JOIN CM_COMPUTER_SYSTEM CS on CS.cs_id=CSA.cs_id
WHERE CSA.cs_attr_key='DisplayAlias' order by cs.name
Get an alias for a specific system:
SELECT
CS.ip,
CS.name,
CSA.cs_attr_key,
CSA.cs_attr_value
FROM CM_COMPUTER_SYSTEM_ATTR as CSA
JOIN CM_COMPUTER_SYSTEM CS on CS.cs_id=CSA.cs_id
WHERE cs.name like '%system_name%' CSA.cs_attr_key='DisplayAlias'