Posted By: zstringer Error Message in Sessions > SQL Monitor - 02/23/24 02:47 PM
Hi all,
Suffering significant slowdowns of a PL/SQL process that used to be faster. Tables and indexes are analyzed on a daily basis. When I look at a problematic SQL statement in Tools > Sessions, when I click on SQL Monitor I get these errors:

ORA-31011: XML parsing failed
ORA-06512: at "SYS.DBMS_SQLTUNE", line 18940
ORA-19213: error occurred in XML processing at lines 1
LPX-00242: invalid use of ampersand ('&') character (use &)
ORA-06512: at "SYS.XMLTYPE", line 272
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_SQLTUNE", line 14318
ORA-06512: at "SYS.DBMS_SQLTUNE", line 19036
ORA-06512: at "SYS.DBMS_SQLTUNE", line 19367
ORA-06512: at line


Has anyone seen this?
Thanks!
-Peter
To obtain some more diagnostic information, can you modify the PL/SQL Developer shortcut and add the DebugSQL parameter? For example:

"C:\Program Files\PLSQL Developer 15\plsqldev.exe" DebugSQL

Reproduce the problem and send me the debug.txt file that is generated in the %APPDATA%\PLSQL Developer 15 directory (e.g. C:\Users\<User>\AppData\Roaming\PLSQL Developer 15).
I'll email you the file. This seems to be the relevant section:

00:00:45.332 TOracleQuery $10C5C5E0 Start Query.Execute
SQL = select m.sql_text, dbms_sqltune.report_sql_monitor(sql_id => m.sql_id, type => 'HTML', report_level => 'ALL') AS report
from v$sql_monitor m
where m.sid = :sid and m.session_serial# = :serial#
order by 1
:SID = 2978
:SERIAL# = 55336
00:00:45.831 TOracleQuery $10C5C5E0 End
Result = ORA-31011: XML parsing failed
ORA-06512: at "SYS.DBMS_SQLTUNE", line 18940
ORA-19213: error occurred in XML processing at lines 1
LPX-00242: invalid use of ampersand ('&') character (use &)
ORA-06512: at "SYS.XMLTYPE", line 272
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_SQLTUNE", line 14318
ORA-06512: at "SYS.DBMS_SQLTUNE", line 19036
ORA-06512: at "SYS.DBMS_SQLTUNE", line 19367
ORA-06512: at line 1
Duration = 0.5
00:00:50.823 CloseQuery
Thanks. This problem seems to be caused by Oracle Bug 13087312. The only workaround suggested by Oracle Support is to replace report_level => 'ALL' with report_level=>'-BINDS'. Can you try this? To do so, click on the "Define Session Queries" button on the Session Window toolbar, go to the "Details" tab, select the "SQL Monitor" query, and modify the query accordingly.
Sorry for the late reply - that fixed the problem. Thanks Marco!
© Allround Automations forums