Skip to main content
6 events
when toggle format what by license comment
Aug 20, 2021 at 8:39 comment added sarat I used in this way... PRIMARY_HO=$(sqlplus -s "/ as sysdba" <<-EOF set pages 0 feed off select distinct machine from v\$session where username='PUBLIC' and osuser='oracle' and rownum<2 order by machine;
Aug 19, 2021 at 13:33 vote accept Franco
Aug 19, 2021 at 10:59 comment added Franco It will give both primary hosts if it's a RAC DB. Which is fine ... I just need one of them. Would like to add a prefix to the result though ... which doesn't appear to work when using the distinct function. Any ideas? (I've updated the Q above).
Aug 19, 2021 at 10:37 comment added sarat There wouldn't be any issue - You are firing this SQL from the standby database - so this query will show the hostname of the primary alone.
Aug 19, 2021 at 9:59 comment added Franco The following command words: select distinct(machine) from v$session where username='PUBLIC' and osuser='oracle' and machine <> (select PRIMARY_DB_UNIQUE_NAME from v$database); But could there be issues if there are multiple standbys and the primary is a RAC?
Aug 19, 2021 at 3:49 history answered sarat CC BY-SA 4.0