Oracle Scratchpad

March 12, 2024

Disable oradebug

Filed under: Infrastructure,Oracle,Troubleshooting — Jonathan Lewis @ 10:43 am GMT Mar 12,2024
Tags: ,

Here’s a little detail that I discovered recently when I wanted to do something a little exotic in 23c on the official Virtualbox VM. There’s been a hidden parameter to disable oradebug since (at least) 12.2.0.1. The clue is in the name:

_disable_oradebug_commands

The valid values for this parameter are none, restricted, and all. The default value in 12c, 18c, and 19c is none; the default value in 21.3 and 23.3 is restricted. This means some of the investigative code you may have used in the earlier versions may produce an error in the newer versions. To change the value you have to restart the database. Here are a couple of the error messages you might see:

_disable_oradebug_commands=all

SQL> oradebug setmypid
ORA-32519: insufficient privileges to execute ORADEBUG command: execution of ORADEBUG commands is disabled for this instance
SQL> 


_disable_oradebug_commands=restricted

SQL> oradebug setmypid
Statement processed.

SQL> oradebug peek 0x000000008E65E1D8 16
[08E65E1D8, 08E65E1E8) = 99FC0501 00000004 8E519690 00000000

SQL> oradebug call keiutFlush
ORA-32519: insufficient privileges to execute ORADEBUG command: execution of ORADEBUG commands is disabled for this instance

SQL> 


The “restricted” example above is the one that led me to the parameter when I was testing 23c. However, setting the value to “none” in the spfile and restarting the instance didn’t help. This is what I saw when I tried running my code from a PDB:

SQL> oradebug setmypid
Statement processed.
SQL> oradebug call keiutFlush
ORA-32519: insufficient privileges to execute ORADEBUG command: OS debugger privileges required for client
SQL> 

I have no idea how to give myself OS debugger privileges. It’s a nuisance, but since I’m running the whole thing from the server and have to have at least two sessions active for the testing I’m doing, it’s not a big issue to have one more running from the oracle (OS account) connected to the cdb$root to call the flush command.

Footnote

To check for the list of valid values for string parameters, you can query v$parameter_valid_values, but that view won’t show you the “underscore” parameters (the commented where clause above is the text in v$fixed_view_definition that allows Oracle to hide the hidden parameter). To see the valid values for the hidden parameters you need to access the x$ structure underneath the v$, and I wrote a little script (that has to be run by sys) to do that a long time ago.

4 Comments »

  1. […] Disabling oradebug (March 2024): it is possible to block any calls to oradebug. […]

    Pingback by Infrastructure Catalogue | Oracle Scratchpad — March 12, 2024 @ 10:46 am GMT Mar 12,2024 | Reply

  2. […] Disabling oradebug (March 2024): it is possible to block any calls to oradebug. […]

    Pingback by Troubleshooting catalogue | Oracle Scratchpad — March 12, 2024 @ 10:46 am GMT Mar 12,2024 | Reply

  3. It’s likely a data vault thing. 23c, at least the free one, can’t be relinked with dv_off either (deprecated).

    If data vault is set up, you should be able to ebable ORADEBUG with dbms_macadm.enable_oradebug. Not sure if that actually enables internal function calling or just other less intrusive things.

    https://docs.oracle.com/en/database/oracle/oracle-database/21/dvadm/oracle-database-vault-general-administrative-apis.html#GUID-2CEFBBEA-4261-47A9-A10B-8043391B09A6

    If “oradebug call” doesn’t work, you can always attach to your process with gdb and call keiutFlush() from there :-) There used to be a MOS article about how to call state dump functions directly (ksudss, ksudps) and hanganalyze (ksdhng) from OS debuggers. Couldn’t find it anymore though :-)

    Comment by Anonymous — March 13, 2024 @ 12:37 pm GMT Mar 13,2024 | Reply


RSS feed for comments on this post. TrackBack URI

Comments and related questions are welcome.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Website Powered by WordPress.com.