ResolutionThe tnsnames.ora should be configured as follows:
net_service_name_PRIM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradbprod01)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = net_service_name)
)
)
net_service_name_STBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradbkapprod01)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = net_service_name)
)
)
And then create two agents for these two entries.
Note: net_service_name_PRIM is the primary database, and net_service_name_STBY is the standby database. If the PRIM is down, and the primary change to be STBY, then you will see data from net_service_name_STBY.
Having one agent to monitor both primary and standby database it is not supported configuration.
Please find a general information about monitoring Data Guard environment using Foglight:
• In order to monitor Data Guard environment using Foglight you would need to setup 2 agents – one for the primary and another one of the standby. You should define two different entries in his tnsnames.ora file for Foglight connection.
• If the standby is in a mounted mode, Foglight is able to add that agent, but it won’t be monitored since it’s in a mounted state and it can’t access it. However, once there will be a switchover and the standby will become Primary, Foglight will automatically monitor it.
• If the standby is in an open read only mode (aka Active Data Guard), It's fully support monitoring that standby Databases as if it’s a regular instance – i.e. all the performance data is available (e.g. dashboards, PI, alarms)
• It can be monitored the gap between primary and the mounted standby by executing queries on the Primary Database.
• It will provide the following alarms:
“DBO - DG Applied Gap” This alarm is invoked when the last applied log sequence# on the archive destination indicates a gap that exceeds a predefined threshold. Ensuring that the gap between the standby and the primary instances is kept as small as possible is important in order to prevent failover to the standby from causing large amount of data losses in a crisis situation.
“DBO - DG Received Gap” This alarm is invoked when the last received log sequence# on the archive destination indicates a gap that exceeds a predefined threshold. Ensuring that the gap between the standby and the primary instances is kept as small as possible, it is important in order to prevent failover to the standby from causing large amount of data losses in a crisis situation.
Foglight monitors Primary database until it is available (the database is in the open mode). All existent connections that are connected to the Primary database will lost contact and disconnect due to the failover. After the switchover is completed and the Standby database changes its role to the primary database and mode to open, the application is able to reconnect to the new Primary database. Therefore, only then Foglight will automatically begin to monitor the activity of the new Primary database.
During the switchover Standby database needs to recovery uncompleted transactions that weren’t finished in the primary database. On that time the Standby database is in the mounted mode so Foglight won’t be able to monitor its activity, only when database changes its mode to open Foglight starts to monitor its activity.