[OCI DWH] [MySQL] Query to Find Count of Applications that are Not Attached to Anything

 A MySQL Query for the NetApp OnCommand Insight (OCI) Data Warehouse (DWH), to find the count of applications that are not attached to anything in dwh_inventory.application.

SELECT count(*) FROM(
  SELECT applicationId FROM application AS a
  LEFT JOIN(
    SELECT distinct t0.applicationID FROM(
      SELECT applicationID FROM host_to_application union
      SELECT applicationID FROM internal_volume_to_application union
      SELECT applicationID FROM qtree_to_application union
      SELECT applicationID FROM share_to_application union
      SELECT applicationID FROM storage_to_application union
      SELECT applicationID FROM switch_port_to_application union
      SELECT applicationID FROM switch_to_application union
      SELECT applicationID FROM vm_to_application union
      SELECT applicationID FROM volume_to_application
    ) as t0
  ) AS t1 ON t1.applicationID = a.id
  WHERE t1.applicationId IS NULL
) as t2;

IT Infrastructure Monitoring with OnCommand Insight - OCI | NetApp


Note: We found all the application tables in dwh_inventory by running:
use dwh_inventory;
show tables like '%app%';

Comments