No ADR base is set
To manage Automatic Diagnostic Repository (ADR), we used to use ADRCI command line to interact with server.
Node 1
[oracle@primary01 oracle]$ adrci
ADRCI: Release 19.0.0.0.0 - Production on Thu Jul 31 15:25:45 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle"
adrci>
It seems no problem at all. But for node 2, we found nothing there.
Node 2
[oracle@primary02 oracle]$ adrci
ADRCI: Release 19.0.0.0.0 - Production on Thu Jul 31 15:24:02 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
No ADR base is set
adrci>
No ADR base is set means that ADRCI cannot find the correct location to set ADR base for further operations.
No ADR homes are set
As a result, we have "No ADR homes are set", if we tried to show all ADR homes.
adrci> show homes
No ADR homes are set
Additionally, if you perform some commands on ADR home, you might see DIA-48494: ADR home is not set, the corresponding operation cannot be done.
Rationale
In fact, ADRCI uses a pointer file (adrci_dir.mif) to store the base location of repository. If the file was missing, it cannot find the ADR base.
Let's check existing of the file on node 1 and node 2.
Node 1
grid
[grid@primary01 grid]$ ls -l $ORACLE_HOME/log/diag/adrci_dir.mif
-rw-r----- 1 grid oinstall 14 Jul 06 14:09 /u01/app/19.0.0/grid/log/diag/adrci_dir.mif
oracle
[oracle@primary01 oracle]$ ls -l $ORACLE_HOME/log/diag/adrci_dir.mif
-rw-r----- 1 oracle asmadmin 16 Jul 31 15:08 /u01/app/oracle/product/19.0.0/db_1/log/diag/adrci_dir.mif
OK, node 1 has no problem.
Node 2
grid
[grid@primary01 grid]$ ls -l $ORACLE_HOME/log/diag/adrci_dir.mif
-rw-r----- 1 grid oinstall 14 Apr 22 08:35 /u01/app/19.0.0/grid/log/diag/adrci_dir.mif
oracle
[oracle@primary02 oracle]$ ls -l $ORACLE_HOME/log/diag/adrci_dir.mif
ls: 0653-341 The file /u01/app/oracle/product/19.0.0/db_1/log/diag/adrci_dir.mif does not exist.
For user oracle, the file does not exist in node 2. That's the problem.
Solution
To resolve the error, we take the following steps to set ADR base correctly.
- Create a folder for the pointer file.
- Copy the file from the other server
- Verify the result.
Since there's no such directory on node 2, we have to create one for it.
[oracle@primary02 oracle]$ mkdir -p $ORACLE_HOME/log/diag
If all database servers in the cluster have the same directory structure, then we can copy the file from the node 1.
[oracle@primary02 oracle]$ scp -p primary01:$ORACLE_HOME/log/diag/adrci_dir.mif $ORACLE_HOME/log/diag/
adrci_dir.mif 100% 16 1.5KB/s 00:00
Please note that, we use option -p to preserve the permission set and ownership from the source.
We enter ADRCI interactive mode again.
[oracle@primary02 oracle]$ adrci
ADRCI: Release 19.0.0.0.0 - Production on Thu Jul 31 15:28:38 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle"
adrci>
We have set it correctly.
Later on, we should purge ADR trace files on a regular basis for reclaiming some precious space.