I have a (probably simple) query about how to find an Oracle 19c primary database's host by querying a mounted standby using sqlplus. I can get the primary name as follows:
select PRIMARY_DB_UNIQUE_NAME from v$database;
But how can I find the primary's host in a similar way?
Many thanks.
As mentioned below in the discussion with sarat the following cmd based on his suggestion works:
select distinct(machine) from v$session where username='PUBLIC' and osuser='oracle' and machine <> (select PRIMARY_DB_UNIQUE_NAME from v$database);
but I need to add a leading header to the output in order to grab the result from the spool file afterwards.
select 'title'||distinct(machine) from v$session where username='PUBLIC' and osuser='oracle' and machine <> (select PRIMARY_DB_UNIQUE_NAME from v$database)
This fails though? Any way around that? Thanks.