Oracle 自动诊断信息库(Automatic Diagnostic Repository,(2)

[-tail [num] [-f]]: Output last part of the alert messages and
    output latest messages as the alert log grows. If num is not specified,
    the last 10 messages are displayed. If "-f" is specified, new data
    will append at the end as new alert messages are generated.

[-term]: Direct results to terminal. If this option is not specified,
    the results will be open in an editor.
    By default, it will open in emacs, but "set editor" can be used
    to set other editors.

[-file <alert_file_name>]: Allow users to specify an alert file which
    may not be in ADR. <alert_file_name> must be specified with full path.
    Note that this option cannot be used with the -tail option

Examples:
    show alert
    show alert -p "message_text like '%incident%'"
    show alert -tail 20

adrci>

3.使用 show alert 列出各个目录下的日志目录,输入编号4,系统会自动调用vi编辑器查看数据库的alert日志
adrci> show alert

Choose the alert log from the following homes to view:

1: diag/tnslsnr/RHEL53/listener
2: diag/clients/user_unknown/host_411310321_11
3: diag/clients/user_oracle/host_2175824367_11
4: diag/rdbms/ora11g/ora11g
Q: to quit

Please select option:4

4.另外一种查看方式是,指定具体的 homepath 然后使用“show alert -tail 15”查看对应日志文件的后15行
adrci> show homepath
ADR Homes:
diag/tnslsnr/RHEL53/listener
diag/clients/user_unknown/host_411310321_11
diag/clients/user_oracle/host_2175824367_11
diag/rdbms/ora11g/ora11g
adrci> set homepath diag/rdbms/ora11g/ora11g
adrci> show alert -tail 15
2009-02-27 14:25:05.036000 +08:00
Starting background process SMCO
SMCO started with pid=21, OS id=3855
Starting background process FBDA
FBDA started with pid=22, OS id=3857
replication_dependency_tracking turned off (no async multimaster replication found)
2009-02-27 14:25:07.246000 +08:00
Starting background process QMNC
QMNC started with pid=23, OS id=3859
2009-02-27 14:25:17.325000 +08:00
db_recovery_file_dest_size of 4096 MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
2009-02-27 14:25:33.727000 +08:00
Completed: ALTER DATABASE OPEN
2009-02-27 14:29:59.158000 +08:00
Starting background process CJQ0
CJQ0 started with pid=25, OS id=3892
adrci>


ADR的结构和位置:
  初始化参数diagnostic_dest指定了ADR的根目录。即使你忽略了该初始化参数。oracle也会创建ADR。
如果你设置了ORACLE_BASE环境变量,那么diagnostic_dest缺省值是该目录。如果你没有设置ORACLE_BASE变量,该参数值为$ORACLE_HOME/log目录。
  ADR存储所有oracle产品的诊断数据。ADR为每一个oracle产品及其实例分配一个单独的home目录。因此一个ADR目录包含多个home目录。
  每一个ADR的home目录是一个为每一个数据库实例或其它oracle产品或组件存储其诊断文件。其目录结构如下:
  ADR_base/diag/product_type/product_id/instance_id/
  比如一个 diagnostic_dest初始化参数为 /u05/app/oracle。那么一个oracle数据库的sid为prod1的home目录就如下所示:
  /u05/app/oracle/diag/rdbms/prod1/prod1/
  在一个ADR的home目录下有很多子目录:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/716a8e15e684b359638baa9b1d4f0eda.html