diff --git a/app/controllers/env_controller.rb b/app/controllers/env_controller.rb index 01868d5..114ced9 100644 --- a/app/controllers/env_controller.rb +++ b/app/controllers/env_controller.rb @@ -338,13 +338,17 @@ def list_services session_where_values << @pdb_name end - @services = sql_select_all ["SELECT v.*, s.Sessions - FROM DBA_Services v + @services = sql_select_all ["SELECT v.*, s.Sessions, a.Active_Instances + FROM DBA_Services v LEFT OUTER JOIN (SELECT /*+ NO_MERGE */ Service_Name, COUNT(*) Sessions FROM gv$Session s #{session_where_string} GROUP BY Service_Name ) s ON s.Service_Name = v.Name + LEFT OUTER JOIN (SELECT /*+ NO_MERGE */ Name, LISTAGG(Inst_ID, ', ') WITHIN GROUP (ORDER BY Inst_ID) Active_Instances + FROM gv$Active_Services + GROUP BY Name + ) a ON a.Name = v.Name #{where_string} "].concat(session_where_values).concat(where_values) render_partial diff --git a/app/views/env/_list_services.html.erb b/app/views/env/_list_services.html.erb index 86b97f5..1733a90 100644 --- a/app/views/env/_list_services.html.erb +++ b/app/views/env/_list_services.html.erb @@ -17,6 +17,7 @@ column_options << {caption: 'ID', data: proc{|rec| fn(rec.service_id)}, title: "Unique ID for the service", align: :right} column_options << {caption: 'Name', data: proc{|rec| rec.name}, title: "Name of the service"} column_options << {caption: 'Network name', data: proc{|rec| rec.network_name}, title: "Network name used to connect to the service"} + column_options << {caption: 'Active instances', data: proc{|rec| rec.active_instances}, title: "RAC instances where the service is active"} if PanoramaConnection.rac? column_options << {caption: 'Sessions', data: link_sessions, title: "Number of currently connected sessions", align: :right} column_options << {caption: 'Creation', data: proc{|rec| localeDateTime(rec.creation_date)}, title: "Date the service was created"} column_options << {caption: 'Failover method', data: proc{|rec| rec.failover_method}, title: "Failover method (BASIC or NONE) for the service"}