我在 EM 做报告,我需要在这里弄清楚
我有这个查询:
SELECT
*
FROM
(
SELECT DISTINCT
patch.host as "PHost",
patch.home_location as "PDirectory",
patch.home_name as "PHome",
MAX(patch.INSTALLATION_TIME) as "Patched (Date)",
MAX(patch.PATCH_RELEASE) as "PVersion",
listagg(patch,',') WITHIN GROUP (ORDER BY patch) "Patches"
FROM
mgmt$applied_patches patch
GROUP BY patch.host, patch.home_location,patch.home_name
ORDER BY patch.host, patch.home_location
) "PCH",
(
SELECT DISTINCT
T1.PROPERTY_VALUE as "MHost",
T2.PROPERTY_VALUE as "MDirectory",
T3.PROPERTY_VALUE as "MVersion",
count(T4.PROPERTY_VALUE) as "Count of SID",
listagg(T4.PROPERTY_VALUE,',') WITHIN GROUP (ORDER BY T4.PROPERTY_VALUE) as "SID"
FROM
MGMT$TARGET_PROPERTIES T1,
MGMT$TARGET_PROPERTIES T2,
MGMT$TARGET_PROPERTIES T3,
MGMT$TARGET_PROPERTIES T4
WHERE
T1.TARGET_GUID = T2.TARGET_GUID
and T1.TARGET_GUID = T3.TARGET_GUID
and T1.TARGET_GUID = T4.TARGET_GUID
and T1.PROPERTY_NAME = 'MachineName'
and T2.PROPERTY_NAME = 'OracleHome'
and T3.PROPERTY_NAME = 'Version'
and T4.PROPERTY_NAME = 'SID'
GROUP BY T1.PROPERTY_VALUE, T2.PROPERTY_VALUE, T3.PROPERTY_VALUE
) "MGM"
WHERE
PDirectory = MDirectory
我收到错误 ORA-00904: "MDIRECTORY":....
我尝试了很多组合!(PCH.PDirectory = MGM.MDirectory, ......) 没有任何效果
干杯