Skip to content

Commit

Permalink
Show the RAC instances where a configured service is active
Browse files Browse the repository at this point in the history
  • Loading branch information
rammpeter committed Oct 24, 2024
1 parent c0ffa52 commit ea4a37f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/controllers/env_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/views/env/_list_services.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit ea4a37f

Please sign in to comment.