Moving the DIAG directory

Just a very simple post, but sometimes these kinds of small items are, to my surprise, more looked after then I sometimes realize.

Database

I don’t like the Oracle 11 DIAG directory in its default place, namely in the $ORACLE_BASE. The remedy is very simple. Just create a new DIAG directory.

SQL> show parameter diag

NAME                                 TYPE        VALUE
------------------------------------ ----------- ----------
diagnostic_dest                      string      /oracle

SQL> alter system set diagnostic_dest='/u01/oracle'
  2  ;

System altered.

SQL> show parameter diag

NAME                                 TYPE        VALUE
------------------------------------ ----------- ----------
diagnostic_dest                      string      /u01/oracle

SQL> host

[oracle]$ cd /u01/oracle

[oracle]$ pwd

/u01/oracle

[oracle]$ ls -l

total 8
drwxr-xr-x 4 oracle oinstall 4096 Apr 15 21:09 diag
drwxr-xr-x 3 oracle oinstall 4096 Feb 12 04:59 oradata

.

Of course the oracle software owner that started the instance, needs the *nix privileges to do this. Also be aware that the old DIAG directory structure is still there and has to be moved, merged or deleted (as you may please).

The automatic diagnostic repository can be disabled or enabled via setting _diag_adr_enabled to false or true.

Listener

The diag directory can be changed on listener level by setting the “ADR_BASE_listener_name” and automatic diagnostic repository, ADR,  can be enabled (or disabled) via DIAG_ADR_ENABLED_listener_name“.

  • ADR_BASE specifies the base directory into which tracing and logging incidents are stored when ADR is enabled.
  • DIAG_ADR_ENABLED specifies whether ADR tracing is enabled.

These parameters are set in the listener.ora configuration file.

Marco Gralike Written by: