How do you find the database error which caused the Apache to show the 404-error?
Usually the error is found in the Apache error log. But you can also configure the mod_plsql to show more detailed information in the browser. This is very useful but should only used in development environments due to security reasons. Patrick wrote a nice blog posting about it.
But using Oracle Express Edition (XE) you don't have an Apache / mod_plsql configuration.
How do you find the errors here?
Since Oracle XE uses the http listener of the XMLDB, it needs to be configured through the DBMS_EPG interface. The documentation can be found here.
To see the error log similar to Apache, logon as SYSTEM via SQL*Plus and execute:
SQL>execute dbms_epg.set_global_attribute('log-level', 3);
The error log will go to the database trace file app/oracle/admin/XE/bdump/xe_s00?_????.trc.
Please ignore the bogus error message "Embedded PL/SQL Gateway: Unknown attribute 3" in the error log.
The log levels are:
0 - LOG_EMERG
1 - LOG_ALERT
2 - LOG_CRIT
3 - LOG_ERR
4 - LOG_WARNING
5 - LOG_NOTICE
6 - LOG_INFO
7 - LOG_DEBUG
To turn off the error logging, execute the following as SYSTEM:
SQL>execute dbms_epg.set_global_attribute('log-level', 0);
In order to show the error messages in the browser, you would configure parameter error-style using the DBMS_EPG.
Almost all parameters of the mod_plsql are configurable in the DBMS_EPG, too. They are just named differently (why?). You can find the mapping in the Oracle documentation.
So, how can we enable the debug style messages in XE. It is easy, just connect as SYSTEM to the database and issue the following command:
SQL>exec dbms_epg.set_dad_attribute('APEX', 'error-style', 'DebugStyle');
In order to revert to the standard message format, issue:
SQL>exec dbms_epg.delete_dad_attribute('APEX', 'error-style');
Then your browser will show the following error message instead of the standard 404-error page:
Now I have shown how to configure the DAD for XE, but how can you see the current configuration? My next post will cover these instructions.