DIAGNOSTIC_ DeST (diagnostic log path)

catalogue

  describe

Refer to Database Reference 19C

Refer to the Automatic Storage Management Administrator's Guide 19C

  Refer to Database Administrator's Guide 19C

Verification test

  describe

        The regular storage path of Oracle database instance's diagnostic logs is $ORACLE_BASE/diag/rdbms/db_unique_name/sid /, in specific scenarios (such as shell script detecting possible database instances on the server), you can judge which database instances may exist on the server through this path (sid folder name) of the file system. (the description information about the path in several official documents is inconsistent, so it is not tested and verified one by one here)

Refer to Database Reference 19C

        Starting from Oracle Database 11g Release 1(11.1), the diagnostic information of each database instance is located in diagnostic_ In the private directory specified by DeST initialization parameter.

        DIAGNOSTIC_ The dest default parameter value is derived from $oracle_ The value of the base environment variable. If $Oracle_ If base is not set, Oracle derived from Oracle common installer settings_ BASE. If "ORACLE_BASE" is not set, "$ORACLE_HOME/rdbms/log" is used.

        This parameter can be set on each instance. Oracle recommends that each instance in the cluster be diagnostic on a shared disk_ Dest sets the same directory location.

        The storage path of diagnostic information is as follows (home directory of Automatic Diagnostic Repository (ADR)):

<diagnostic_dest>/diag/rdbms/<dbname>/<instname>

        For example, if the database name is proddb and the instance name is proddb1, the ADR home directory will be < diagnostic_ dest>/diag/rdbms/proddb/proddb1.

Refer to the Automatic Storage Management Administrator's Guide 19C

        Diagnostic for ASM instances_ The default value of DeST is $Oracle specified when installing grid_ Base, for example:

Example 3-1    Sample diagnostic directory for an Oracle ASM instance

$ ls $ORACLE_BASE/diag/asm/+asm/+ASM

alert  cdump  hm  incident  incpkg  ir  lck  metadata  stage  sweep  trace

  Refer to Database Administrator's Guide 19C

        Automatic diagnostic repository (ADR) is a directory structure stored outside the database. Therefore, when the database is shut down, it can be used for problem diagnosis. The ADR root directory is called ADR base, and its location information is set in DIAGNOSTIC_DEST initialization parameter. If the parameter value is omitted or empty, the database will set diagnostic as follows at startup_ DEST:

1) If the environment variable Oracle is set_ Base, then "DIAGNOSTIC_DEST" is set to Oracle_ The directory specified by base.

2) If the environment variable "ORACLE_BASE" is not set, set "DIAGNOSTIC_DEST" to ORACLE_HOME/log.

       In ADR base, there can be multiple ADR home directories, where each ADR home directory is the root directory of all diagnostic data (trace, dump, alarm log, etc.) for a specific instance of a specific Oracle product or component. For example, in an Oracle Real Application Clusters environment with Oracle ASM, each database instance, Oracle ASM instance, and listener has an ADR home.

  The ADR home directory is located in a subdirectory of the ADR base directory and is named according to the product or component type. The directory structure is as follows:

        Depending on the configuration, other subdirectories may be created in ADR. Some products automatically clear expired ADR diagnostic data. For other products, you can periodically use the PURGE command of the ADRCI utility to clear expired diagnostic data.

        The location of each ADR home is given by the following path, which starts from the ADR base directory:

diag/product_type/product_id/instance_id

For example, for a database whose SID and database unique name are equal to orclbi, ADR home will be located in the following location:

ADR_base/diag/rdbms/orclbi/orclbi/

Similarly, the ADR home path of an Oracle ASM instance in a single instance environment is:

ADR_base/diag/asm/+asm/+asm/

There are subdirectories containing diagnostic data in each ADR home directory.

Some subdirectories and their contents are shown in table 9-2.

Figure 9-2 shows the complete directory structure of the database instance ADR.

 

        Oracle Clusterware uses ADR and has its own Oracle home and Oracle base. The ADR directory structure of Oracle Clusterware is different from that of database instances. There is only one instance of Oracle Clusterware on a system, so Clusterware ADR homes uses only the host name of the system as the differentiator. When configuring Oracle Clusterware, ADR home uses crs as the product type and instance ID, and uses the system hostname as the product ID. Therefore, on the host named dbprod01, CRS ADR home will be:

ADR_base/diag/crs/dbprod01/crs/

Verification test

Modify db_unique_name test to verify ADR home path information:

SQL> show parameter db_unique_name;
db_unique_name                       string                            CDB02_PRI

SQL> select name,value from v$diag_info;
Diag Enabled                   TRUE
ADR Base                       /u01/app/oracle
ADR Home                       /u01/app/oracle/diag/rdbms/cdb02_pri/CDB02
Diag Trace                     /u01/app/oracle/diag/rdbms/cdb02_pri/CDB02/trace
Diag Alert                     /u01/app/oracle/diag/rdbms/cdb02_pri/CDB02/alert
Diag Incident                  /u01/app/oracle/diag/rdbms/cdb02_pri/CDB02/incident
Diag Cdump                     /u01/app/oracle/diag/rdbms/cdb02_pri/CDB02/cdump
Health Monitor                 /u01/app/oracle/diag/rdbms/cdb02_pri/CDB02/hm
Default Trace File             /u01/app/oracle/diag/rdbms/cdb02_pri/CDB02/trace/CDB02_ora_62061.trc
Active Problem Count           0
Active Incident Count          0
ORACLE_HOME                    /u01/src/ora19c

SQL> alter  system set db_unique_name=cdb02 scope=spfile;

SQL> shutdown immediate;

SQL> startup;

SQL> show parameter db_unique_name;
db_unique_name                       string                            CDB02

SQL> select name,value from v$diag_info;
Diag Enabled                   TRUE
ADR Base                       /u01/app/oracle
ADR Home                       /u01/app/oracle/diag/rdbms/cdb02/CDB02
Diag Trace                     /u01/app/oracle/diag/rdbms/cdb02/CDB02/trace
Diag Alert                     /u01/app/oracle/diag/rdbms/cdb02/CDB02/alert
Diag Incident                  /u01/app/oracle/diag/rdbms/cdb02/CDB02/incident
Diag Cdump                     /u01/app/oracle/diag/rdbms/cdb02/CDB02/cdump
Health Monitor                 /u01/app/oracle/diag/rdbms/cdb02/CDB02/hm
Default Trace File             /u01/app/oracle/diag/rdbms/cdb02/CDB02/trace/CDB02_ora_62233.trc
Active Problem Count           1
Active Incident Count          1
ORACLE_HOME                    /u01/src/ora19c

 

 

 

Keywords: Database Oracle

Added by NilayKomal on Wed, 15 Sep 2021 04:20:37 +0300