Can I create alert on ora-20118 from Enterprise Manager? Can I create an alert on a user-defined ORA- error?

I want EM to notify me when the following error happens:

begin
raise_application_error(-20118, 'myerror');
end;
/
You could use DBMS_SYSTEM.KSDWRT to write the error to the alert log when you catch the relevant exception.

Then you can configure Enterprise Manager to alert on that error code. You've two options here:


Modify the regex for the existing error log analysis to cover this error code. This would be much easier, but might be a little inflexible.
Write a Metric Extension to check the alert log for this error. This would be a lot more difficult, but would allow you to create customised error messages and responses to this specific error.