~oracle/oradiag_oracle directory

https://community.oracle.com/message/10591499


The oradiag directory is used for ADR logging in 11g. Normally ADR logging is only used for 11g databases, however the 11g agent uses an 11g client which means this will also create client logging for ADR. For the database the ADR directory (oradiag_<owning user> directory, eg. oradiag_oracle) location can be determined by the database 'diagnostic_dest' parameter and by default is located in $ORACLE_BASE. For the client, the default location for the ADR will be $ORACLE_HOME<of client>/log. However if the <client home>/log directory does not exist (which is the case in a default agent install), then the ADR directory will be created in $HOME as follows:-

$HOME/oradiag_<owning user>/diag/clients/user_<owning user>/host_*

It's possible to view either the sqlnet.log or the log.xml , to see the expected location of the 'missing' client base directory.

$HOME/oradiag_<owning user>/diag/clients/user_<owning user>/host_*/trace/sqlnet.log
$HOME/oradiag_<owning user>/diag/clients/user_<owning user>/host_*/alert/log.xml

For example:-

Extract from sqlnet.log

[oracle@machine1 trace]$ pwd
/home/oracle/oradiag_oracle/diag/clients/user_oracle/host_135730584_11/trace
[oracle@machine1 trace]$ tail sqlnet.log
Tue Mar 20 10:29:22 2012
Directory does not exist for read/write [u01/orabase/11107dbase/log] [u01/orabase/11107dbase/log/diag/clients]
Tue Mar 20 10:29:23 2012
Directory does not exist for read/write [u01/orabase/11107dbase/log] [u01/orabase/11107dbase/log/diag/clients]
Tue Mar 20 10:33:09 2012
Directory does not exist for read/write [u01/orabase/11107dbase/log] [u01/orabase/11107dbase/log/diag/clients]
Tue Mar 20 10:33:55 2012
Directory does not exist for read/write [u01/orabase/12cagent/core/12.1.0.1.0/log] []
Tue Mar 20 10:36:25 2012
Directory does not exist for read/write [u01/orabase/12cagent/core/12.1.0.1.0/log] []

Extract from log.xml

<msg time='2012-03-17T21:53:41.122+00:00' org_id='oracle' comp_id='clients'
type='UNKNOWN' level='16' host_id='machine1'
host_addr='10.xxx.xxx.xxx' version='1'>
<txt>Directory does not exist for read/write [u01/orabase/12cagent/core/12.1.0.1.0/log] []
</txt>
</msg>

Extract from sqlnet.log

Tue Feb 28 12:51:41 2012
Directory does not exist for read/write [u01/app/Middleware/agent11g/log] []
[oracle@rmachine2 trace]$

If the directory that ADR is trying to write to doesn't exist, then these ADR files will be created in $HOME.
To stop the oradiag_<owning user> directory from being created in the $HOME directory, do the following:

Either:-

1) create the 'missing' directory referred to in the error message (will be $ORACLE_HOME<of client>/log/diag/clients). Note that 'missing' directory has to take the form of <path referred to in error message>/log/diag/clients. For example:-

/u01/orabase/12cagent/core/12.1.0.1.0/log/diag/clients
/u01/orabase/11107dbase/log/diag/clients
/u01/app/Middleware/agent11g/log/diag/clients

or

2a) In $ORACLE_HOME<of AGENT>/network/admin create or update the sqlnet.ora with:

DIAG_ADR_ENABLED=on
ADR_BASE=<desired location for the ADR info>

eg.

echo $ORACLE_HOME
/u01/app/Middleware/agent11g
cd $ORACLE_HOME/network/admin
more sqlnet.ora

DIAG_ADR_ENABLED=on
ADR_BASE=/u01/app/Middleware/agent11g/sysman/log

2b. Create the directory referred to in step 2a. In this example the $ORACLE_HOME<ofagent>/sysman/log directory would already exist so would not need to be
pre-created.

3) Stop and restart the agent.
cd $ORACLE_HOME/bin

./emctl stop agent
./emctl start agent

4) Delete the oradiag_<owning user> directory from $HOME

Notice that unless sqlnet client trace is turned on, nothing will be written to the ADR directory if the above changes have been made successfully. (The entries which were previously written to the ADR directory in $HOME were because of the expected directory structure not existing), so after following the above, this situation should now be rectified.

How to test if the subsequent ADR info will be written to the desired location?

To test that the ADR directory location has been changed successfully and is no longer writing to $HOME

A) Set the following parameter in the sqlnet.ora ($ORACLE_HOME<of agent>/network/admin)

trace_level_client=16

For example, contents of sqlnet.ora will be:-

DIAG_ADR_ENABLED=on
ADR_BASE=/u01/app/Middleware/agent11g/sysman/log
trace_level_client=16

(Note: If ADR_BASE directory is not set (for example, if following instructions from step 1) the ADR info will go to the 'default' location which will now be $ORACLE_HOME/log/diag/clients )

B) stop and restart the agent

C) confirm that the directories are created under the location specified in point 2a.

D) stop the agent

E) comment out the tracing from sqlnet.ora, for example:-
#trace_level_client=16

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值