SQL/MX 3.1 Installation and Management Guide (H06.23+, J06.12+)

Querying SQL/MX Metadata
HP NonStop SQL/MX Release 3.1 Installation and Management Guide663852-001
8-36
Displaying All DDL Locks on a Table
nonstop_sqlmx_<system name>.system_schema.schemata s,
objects o
where c.cat_uid = s.cat_uid
and c.cat_name = 'SAMDBCAT'
and s.schema_uid = o.schema_uid
and s.schema_name = 'SALES'
and o.object_name_space = 'TA'
order by object_name_space, table_name
for read uncommitted access;
TABLE_NAME NAME_SPACE TYPE SEC_CLASS
------------------------- ---------- ---- ---------------
CUSTLIST TA VI User Table
CUSTOMER TA BT User Table
HISTOGRAMS TA BT User Metadata
HISTOGRAMS_FREQ_VALS TA BT User Metadata
HISTOGRAM_INTERVALS TA BT User Metadata
MVS_TABLE_INFO_UMD TA BT OTHER
MVS_UMD TA BT OTHER
MVS_USED_UMD TA BT OTHER
ODETAIL TA BT User Table
ORDERS TA BT User Table
ORDREP TA VI User Table
PARTS TA BT User Table
Displaying All DDL Locks on a Table
This example (when run on the node on which the metadata is located) displays the
DDL locks on the table SAMDBCAT.SALES.CUSTOMER:
>> set schema samdbcat.definition_schema_version_<schema version>;
--- SQL operation complete.
>> select substring (o1.object_name from 1 for 25) as lock_name,
l.operation as util,
l.status,
substring (l.process_id from 1 for 25)
from objects o, objects o1, ddl_locks l
where o.object_name = 'CUSTOMER'
and o.object_uid = l.base_object_uid
and l.object_uid = o1.object_uid
and o.schema_uid = (select schema_uid
from nonstop_sqlmx_<system name>.system_schema.schemata
where
schema_name = 'SALES' and
cat_uid =
(select cat_uid
from nonstop_sqlmx_<system name>.system_schema.catsys