From my experience there can be just 1 catalog per 1 linked server
You will need to create separate linked servers for each database on remote server (DB2) that you want to be available for querying on your "local" server (SQL Server)
How did you determine that the table(s) has no unique indexes? Primary keys and unique constraints are implemented via unique indexes (unless the are informational constraints, i.e. NOT ENFORCED). Try:
SELECT INDSCHEMA, INDNAME
WHERE UNIQUERULE IN ('U','P')
AND TABSCHEMA = '...'
AND TABNAME = '...'
It is important to understand that there is no significant difference between a primary key or unique key constraint and a unique index. To implement the concept of primary and unique key constraints, the database manager uses a combination of a ...
subscription_types (type) as
, subscriptions (user, sub_type, subscribed) as
('U1', 'type1', 'Y')
, ('U1', 'type2', 'Y')
, ('U2', 'type1', 'Y')
select u.user, t.type
select distinct s.user
from subscriptions s
) u, subscription_types t
where not exists (select 1 from subscriptions ...
It seems to me that you want the cartesian product between users and subscription_types, minus the subscriptions:
select distinct s.user, st.subscription_types
from subscriptions s
cross join subscription_types st
select user, sub_type
This can, of course, be expressed in other ways, but this is probably the most obvious one.
As a side note, REORGCHK is not the right way to determine if the table needs reorganization post-ALTER. It is intended to analyze object statistics to determine if the table or its indexes can be optimized in some way. Subsequently, an attempt to scan its indexes to update statistics will necessarily fail.
REORGCHK calculates several metrics, such as the ...
I'm not sure REORGCHK UPDATE STATISTICS is the way to go after a destructive operation (drop column) against a table. I suspect that the drop statement put a Z-lock on some catalog tables which prevents STATISTICS from being updated. If you are only interested in whether you need to reorg a table due to the drop you can:
SELECT NUM_REORG_REC_ALTERS, ...