SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Utilities
HP NonStop SQL/MX Reference Manual540440-003
5-3
Checking File Locks
Checking File Locks
When you run the DUP, import, MODIFY, POPULATE INDEX or PURGEDATA
utilities, they lock files. If the operation fails before completion, you need to check the
file locks to determine if you need to run the RECOVER utility to undo or resume the
failed partition operation.
To find out whether a failed partition operation needs to be recovered, issue this query
from an MXCI prompt:
select substring(o.object_name from 1 for 40)
as object_name, o.object_type
from
nonstop_sqlmx_<system name>.system_schema.catsys c,
nonstop_sqlmx_<system name>.system_schema.schemata s,
<cat>.definition_schema_version_1200.objects o,
<cat>.definition_schema_version_1200.ddl_locks d
where c.cat_name = '<cat>'
and c.cat_uid = s.cat_uid
and s.schema_name = '<schema>'
and s.schema_uid = o.schema_uid
and o.object_name = '<table name>'
and o.object_type = 'BT'
and d.base_object_uid = o.object_uid;
You can use this query for range partitioned indexes, replacing table name with
index name, and 'BT' with 'IX'.
A typical output of this query is:
OBJECT_NAME OBJECT_TYPE
---------------------------------------- -----------
EMPLOYEES BT
--- 1 row(s) selected.
>>
In this example, EMPLOYEES is the name of the object. You need to run the
RECOVER utility.
If the query does not return rows, the failed partition operation has rolled back
completely. You do not need to perform recovery.