ORACLE 11.2 性能调优之03 ( ADR使用 )

Posted 轻飘飘D

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORACLE 11.2 性能调优之03 ( ADR使用 )相关的知识,希望对你有一定的参考价值。

1.开启 adrci

[oracle@xag112 ~]$ adrci

      ADR base = "/u01/app/oracle"

adrci> show home
ADR Homes: 
diag/rdbms/db112/DB112
diag/tnslsnr/xag112/listener

adrci> set home diag/rdbms/db112/DB112

adrci> show home
ADR Homes: 
diag/rdbms/db112/DB112

2.显示所有问题

adrci> show problem

ADR Home = /u01/app/oracle/diag/rdbms/db112/DB112:
*************************************************************************
0 rows fetched

3.显示所有事件

adrci> show incident

ADR Home = /u01/app/oracle/diag/rdbms/db112/DB112:
*************************************************************************
0 rows fetched

4.跟踪alter 日志

#滚动显示 (类似tail -f alertlog一样)
adrci> show alert -tail -f
2020-07-11 19:01:13.365000 +08:00
CJQ0 started with pid=21, OS id=6128 
2020-07-11 19:01:16.492000 +08:00
Setting Resource Manager plan SCHEDULER[0x32DE]:DEFAULT_MAINTENANCE_PLAN via scheduler window
Setting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameter
Starting background process VKRM
VKRM started with pid=22, OS id=6130 
2020-07-11 19:01:19.998000 +08:00
XDB installed.
XDB initialized.
2020-07-11 19:06:12.558000 +08:00
Starting background process SMCO
SMCO started with pid=25, OS id=6175

#显示当前最后10条数据
adrci> show alert -tail
2020-07-11 19:01:13.365000 +08:00
CJQ0 started with pid=21, OS id=6128 
2020-07-11 19:01:16.492000 +08:00
Setting Resource Manager plan SCHEDULER[0x32DE]:DEFAULT_MAINTENANCE_PLAN via scheduler window
Setting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameter
Starting background process VKRM
VKRM started with pid=22, OS id=6130 
2020-07-11 19:01:19.998000 +08:00
XDB installed.
XDB initialized.
2020-07-11 19:06:12.558000 +08:00
Starting background process SMCO
SMCO started with pid=25, OS id=6175 

#显示当前最后10条数据
adrci> show alert -TAIL 10
2020-07-11 19:01:13.365000 +08:00
CJQ0 started with pid=21, OS id=6128 
2020-07-11 19:01:16.492000 +08:00
Setting Resource Manager plan SCHEDULER[0x32DE]:DEFAULT_MAINTENANCE_PLAN via scheduler window
Setting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameter
Starting background process VKRM
VKRM started with pid=22, OS id=6130 
2020-07-11 19:01:19.998000 +08:00
XDB installed.
XDB initialized.
2020-07-11 19:06:12.558000 +08:00
Starting background process SMCO
SMCO started with pid=25, OS id=6175 

5.在control中设置的保留时间之后的日志

adrci> show control

ADR Home = /u01/app/oracle/diag/rdbms/db112/DB112:
*************************************************************************
ADRID         SHORTP_POLICY  LONGP_POLICY  LAST_MOD_TIME        LAST_AUTOPRG_TIME LAST_MANUPRG_TIME  ADRDIR_VERSION   ADRSCHM_VERSION   ADRSCHMV_SUMMARY   ADRALERT_VERSION     CREATE_TIME                              
------------- -------------- ------------- -------------------- ----------------- ------------------ ---------------  ----------------  ----------------   -----------------    ------------- 
2949729008    720            8760          2020-07-10 23:19:05                                       1                 2                   80              1                    2020-07-10 23:19:05       

#改trace files保留72小时
adrci>  set control (SHORTP_POLICY = 72)        


adrci> set control (LONGP_POLICY = 96)  

#改incident file保留96小时
adrci> show control

ADR Home = /u01/app/oracle/diag/rdbms/db112/DB112:
*************************************************************************
ADRID         SHORTP_POLICY  LONGP_POLICY  LAST_MOD_TIME        LAST_AUTOPRG_TIME LAST_MANUPRG_TIME  ADRDIR_VERSION   ADRSCHM_VERSION   ADRSCHMV_SUMMARY   ADRALERT_VERSION     CREATE_TIME                              
------------- -------------- ------------- -------------------- ----------------- ------------------ ---------------  ----------------  ----------------   -----------------    ------------- 
2949729008    72             96            2020-07-11 19:29:53                                       1                 2                 80                 1                   2020-07-10 23:19:05 

6.进入OS命令模式

adrci> host
[oracle@xag112 ~]$ 

[oracle@xag112 ~]$ pwd
/home/oracle
[oracle@xag112 ~]$ exit
exit
adrci>

以上是关于ORACLE 11.2 性能调优之03 ( ADR使用 )的主要内容,如果未能解决你的问题,请参考以下文章

ORACLE 11.2 性能调优之04 ( FBDA-闪回数据归档 )

性能调优之6-Tomcat参数调优

Spark性能调优之JVM调优

Oracle调优之no_unnest和unnest用法简介

性能调优之三十六计 —— 「优中取优」字符串拼接 篇

性能调优之三十六计 —— 「优中取优」字符串拼接 篇