How to promote an auto-discovered Oracle Home using SQL+ and EM CLI
I need to script an EM CLI promotion of Oracle Homes as they are picked up by auto-discovery.
The CLI created by the SQL query below fails for lack of a reference to the O/H's directory location:
SELECT DISTINCT
'emcli add_target -name="'
|| entity_name
|| '" -type="'
|| entity_type
|| '" -host="'
|| host_name
|| '";'
FROM sysman.mgmt$manageable_entities
WHERE manage_status = '1'
AND promote_status = '1'
AND entity_type = 'oracle_home';
I need to pass the Oracle Home directory as part of the CLI command but I can't find it in the SYSMAN schema.