SQL/MX 2.x Installation and Management Guide (H06.04+)

Reorganizing SQL/MX Tables and Maintaining Data
HP NonStop SQL/MX Installation and Management Guide540436-001
10-7
Using a Query to Obtain DDL Lock and Process ID
Information
When the cause of the failure is fixed, you should perform a RECOVER command—or
in the case of some failed MODIFY operations, a FUP RELOAD command—to cancel
or resume the utility operation.
Using a Query to Obtain DDL Lock and Process ID Information
You can issue a query to read the metadata and generate a list of DDL locks on a
given object or set of objects. This query example retrieves information about the DDL
locks and the MXCMP process IDs associated with the catalog SAMDBCAT and the
schema SALES:
set schema samdbcat.definition_schema_version_1200;
select substring (o.object_name from 1 for 15) as lock_name,
o.object_type as type,
l.operation,
l.status,
substring (l.process_id from 1 for 25) as
process_id
from objects o, ddl_locks 1
where l.object_uid = o.object_uid and o.schema_uid =
(select schema_uid
from nonstop_sqlmx_system.system_schema.schemata
where schema_name = 'SALES' and cat_uid =
(select cat_uid
from nonstop_sqlmx_system.system_schema.catsys
where cat_name = 'SAMDCAT'
)
)
for read uncommmitted access
order by l.object_uid;
LOCK_NAME UTIL STATUS PROCESS_ID
----------------------- ----- -------- ---------------------
CUSTOMER_77179541_2217 PI 4 \FIGARO.$:3:321:2235264
You can use the TACL command STATUS process-name to determine whether the
process ID returned by the query is running or is nor present. If the named process is
running, the returned lock information is for an active DDL lock. If the named process is
not present, the returned lock information is for an inactive DDL lock.
This and other information returned by the query can be used to determine whether
you need to perform a RECOVER or a FUP RELOAD operation on a MODIFY request.
For more information, see Using RECOVER or FUP RELOAD to Recover a Failed
MODIFY Operation and Reset the Flag on page 10-13.
While a DDL lock is active, the utility operation that holds the lock is assumed to be
running.