In Previous posts, we have created below related posts:
- Create a Metric Extension (ME) to Monitor FRA Usage on OEM 12C
- Create an Incident Rule for Metric Extension ( ME ) to Monitor FRA Used in OEM 12C
Now and then, FRA usage is easily over threshold, DBA needs logon system and manually run a archivelog backup. It is easily to make database hung if FRA usage is 100%.
Here we use “Corrective Actions” to run a RMAN archivelog backup when the FRA is used over warning threshold.
Create a Corrective Action in Library
1)Create a Corrective Action in Library.
go to Enterprise -> Monitoring -> Corrective Actions
Create Library Corrective Action: OS Command
3) in Parameter section:
Command Type: Single Operation
Command: /home/oracle/ksh/oracle_al_backup_OEM_alert.sh %SID%
Here %SID% is the variable passed from OEM to the shell script as a parameter.
“oracle_al_backup_OEM_alert.sh” is a shell script:
a: %SID% is the instance name of the database.
b: The shell script also checks whether there are any RMAN backups is undergoing.
c: There are commands to connect to RMAN repository and target database respectively, then commence archivelog backup.
4) Leave “Credentials” and “Access” section as it is for now.
5) Click “Save to Library”.
Add Corrective Action to Metric
1)Go to a target cluster database home page->Cluster Database->Monitoring->Metric and Collection Settings
2) Click “Edit Key-based Metric” on the right for item ” Flash Recovery Area % Used”.
3) Click Edit
6) Choose the right corrective action from library, then Continue
9) Finally click OK to save the changes
10) After a little, a alert is received about “Corrective action status=Succeed”
Corrective action=RMAN_AUTO_BACKUP_ARCHIVELOGS Corrective action owner=SYSMAN Corrective action status=Succeeded Corrective action output=SID: RACTEST1 HOME: /u01/app/oracle/product/11.2.0/dbhome_1 BASE: /u01/app/oracle SID: RACTEST1 HOME: /u01/app/oracle/product/11.2.0/dbhome_1 BASE: /u01/app/oracle Host=RACTEST1.ractest Target type=Cluster Database Target name=RACTEST-CLUSTER Categories=Capacity Message=The value of Flash Recovery Area % Used for +FRA is 82 Severity=Warning Event reported time=Dec 22, 2016 9:01:54 PM EST Target Lifecycle Status=Development Comment=RAC TEST Operating System=Linux Platform=x86_64 Associated Incident Id=209879 Associated Incident Status=New Associated Incident Acknowledged By Owner=No Associated Incident Priority=High Associated Incident Escalation Level=0 Event Type=Metric Alert Event name=ME$RACRecoveryAreaSpace:FRA_PERCENT_USED Metric Group=ME$RACRecoveryAreaSpace Metric=FRA_PERCENT_USED Metric value=82 Key Value=+FRA Key Column 1=FRA_NAME Rule Name=Flash Recovery Area Percent Used for ME