Query to Get Hostname Instance Name and Startup Time for Oracle RAC Database

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
As a DBA if you are supporting multiple database environments, it is difficult to maintain the list of instance and database details. Using this query, you will be able to easily to fetch the details from the database. This query also give you the startup time for each instance. 


SQL Query
set pages 1000 lines 120
col instance_name for a20
col host_name for a70

alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';

select instance_name, host_name, startup_time from gv$instance order by 1;
advertisements
 
Sample Output
INSTANCE_NAME        HOST_NAME                                    STARTUP_TIME
-------------------- -------------------------------------------- --------------------
proddev1            proddev1                                      10-mar-2021 13:25:30
proddev10           proddev10.usshr11.orclcom1.prodvcn.com	  05-mar-2021 02:10:05
proddev11           proddev11.usshr11.orclcom1.prodvcn.com        05-mar-2021 14:04:17
proddev12           proddev12.usshr11.orclcom1.prodvcn.com        05-mar-2021 02:16:05
proddev2            proddev2                                      19-mar-2021 17:12:17
proddev3            proddev3.usshr11.orclcom1.prodvcn.com         05-mar-2021 14:14:20
proddev4            proddev4.usshr11.orclcom1.prodvcn.com         05-mar-2021 02:58:54
proddev5            proddev5.usshr11.orclcom1.prodvcn.com         05-mar-2021 14:04:16
proddev6            proddev6.usshr11.orclcom1.prodvcn.com         05-mar-2021 02:58:52

_____________________________________________________________________________________________________________________

0 comments:

Post a comment

Labels

Oracle (575) General (60) Unix (47) Blog (23) Script (12) OCI (3) SQL* Loader (3) Software (1)
 

acehints.com Copyright 2011-21 All Rights Reserved | Site Map | Contact | Disclaimer