|
本帖最后由 jiawang 于 2023-9-9 11:37 编辑
Oracle 的 ADRCI 工具主要用来管理 alert 文件、trace 文件、dump 文件等。
查看 v$diag_info 视图
SQL> select name,value from v$diag_info
2 ;
NAME VALUE
------------------------------ ------------------------------------------------------------------
Diag Enabled TRUE
ADR Base /u01/app/oracle
ADR Home /u01/app/oracle/diag/rdbms/orcl/orcl
Diag Trace /u01/app/oracle/diag/rdbms/orcl/orcl/trace
Diag Alert /u01/app/oracle/diag/rdbms/orcl/orcl/alert
Diag Incident /u01/app/oracle/diag/rdbms/orcl/orcl/incident
Diag Cdump /u01/app/oracle/diag/rdbms/orcl/orcl/cdump
Health Monitor /u01/app/oracle/diag/rdbms/orcl/orcl/hm
Default Trace File /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_44965.trc
Active Problem Count 0
Active Incident Count 0
NAME VALUE
------------------------------ ------------------------------------------------------------------
ORACLE_HOME /u01/app/oracle/product/19.3.0/db_1
12 rows selected.
SQL>
ADRCI 的相关命令[oracle@strong ~]$ adrci
ADRCI: Release 19.0.0.0.0 - Production on Fri Sep 8 09:04:27 2023
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle"
adrci> help
HELP [topic]
Available Topics:
CREATE REPORT
ECHO
ESTIMATE
EXIT
HELP
HOST
IPS
PURGE
RUN
SELECT
SET BASE
SET BROWSER
SET CONTROL
SET ECHO
SET EDITOR
SET HOMES | HOME | HOMEPATH
SET TERMOUT
SHOW ALERT
SHOW BASE
SHOW CONTROL
SHOW HM_RUN
SHOW HOMES | HOME | HOMEPATH
SHOW INCDIR
SHOW INCIDENT
SHOW LOG
SHOW PROBLEM
SHOW REPORT
SHOW TRACEFILE
SPOOL
There are other commands intended to be used directly by Oracle, type
"HELP EXTENDED" to see the list
adrci>
设置 ADRCI 的主目录adrci> set home diag/rdbms/orcl/orcl
adrci> show home
ADR Homes:
diag/rdbms/orcl/orcl
使用 show alert 命令查看 alertlog 信息
-- show alert -tail (默认是10条条目)
-- show alert -tail 20 (显示最后20个条目)
-- show alert -tail -f (和 tail -f alertlog 命令功能相同)
adrci> show alert -tail 20
2023-09-08 09:39:01.366000 +08:00
TNS-00513: Destination host unreachable
nt secondary err code: 113
nt OS err code: 0
2023-09-08 09:39:04.362000 +08:00
***********************************************************************
Fatal NI connect error 12543, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sztech)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcldg)(CID=(PROGRAM=oracle)(HOST=strong)(USER=oracle))))
VERSION INFORMATION:
TNS for Linux: Version 19.0.0.0.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 19.0.0.0.0 - Production
Version 19.3.0.0.0
Time: 08-SEP-2023 09:39:04
Tracing not turned on.
Tns error struct:
ns main err code: 12543
TNS-12543: TNS:destination host unreachable
ns secondary err code: 12560
nt main err code: 513
TNS-00513: Destination host unreachable
nt secondary err code: 113
nt OS err code: 0
TT00 (PID:13813): Error 12543 received logging on to the standby
adrci>
使用 show tracefile 命令查看 trace files(跟踪文件)adrci> show tracefile
diag/rdbms/orcl/orcl/trace/orcl_w007_24323.trc
diag/rdbms/orcl/orcl/trace/orcl_w005_14489.trc
diag/rdbms/orcl/orcl/trace/orcl_w004_24304.trc
diag/rdbms/orcl/orcl/trace/orcl_vktm_5205.trc
diag/rdbms/orcl/orcl/trace/orcl_vktm_4241.trc
diag/rdbms/orcl/orcl/trace/orcl_vktm_3203.trc
diag/rdbms/orcl/orcl/trace/orcl_vktm_13696.trc
diag/rdbms/orcl/orcl/trace/orcl_vkrm_5225.trc
diag/rdbms/orcl/orcl/trace/orcl_vkrm_4261.trc
diag/rdbms/orcl/orcl/trace/orcl_vkrm_3223.trc
diag/rdbms/orcl/orcl/trace/orcl_vkrm_13717.trc
diag/rdbms/orcl/orcl/trace/orcl_tt04_14042.trc
diag/rdbms/orcl/orcl/trace/orcl_tt03_13821.trc
模糊查询跟踪文件
adrci> show tracefile %mmon%
diag/rdbms/orcl/orcl/trace/orcl_mmon_5256.trc
diag/rdbms/orcl/orcl/trace/orcl_mmon_4291.trc
diag/rdbms/orcl/orcl/trace/orcl_mmon_3254.trc
diag/rdbms/orcl/orcl/trace/orcl_mmon_13748.trc
adrci>
按时间排序
adrci> show tracefile -rt
08-SEP-23 11:08:10 diag/rdbms/orcl/orcl/trace/orcl_m002_51258.trc
08-SEP-23 11:08:10 diag/rdbms/orcl/orcl/trace/orcl_m001_53003.trc
08-SEP-23 11:07:29 diag/rdbms/orcl/orcl/trace/orcl_tt04_14042.trc
08-SEP-23 11:07:28 diag/rdbms/orcl/orcl/trace/alert_orcl.log
08-SEP-23 11:07:28 diag/rdbms/orcl/orcl/trace/orcl_tt01_13815.trc
08-SEP-23 11:07:28 diag/rdbms/orcl/orcl/trace/orcl_tt00_13813.trc
使用 show incident 命令查看 incidentadrci> show incident
ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
INCIDENT_ID PROBLEM_KEY CREATE_TIME
-------------------- --------------------------------------------------------------------------
233 ORA 600 [kcffo_recreate_tmpf-04] 2021-12-02 12:08:45.618000 +08:00 234 ORA 7445 [eomg_migrate_if_oldnew()+61] 2021-12-02 12:09:59.881000 +08:00
1355 ORA 4031 2021-12-02 12:30:12.701000 +08:00
1356 ORA 4031 2021-12-02 12:36:45.941000 +08:00
1357 ORA 4031 2021-12-02 12:37:15.369000 +08:00
1358 ORA 4031 2021-12-02 12:37:21.223000 +08:00
1359 ORA 4031 2021-12-02 12:37:43.999000 +08:00
2562 ORA 4031 2021-12-02 12:42:47.572000 +08:00
2594 ORA 4031 2021-12-02 12:43:15.071000 +08:00
2595 ORA 4031 2021-12-02 12:43:15.891000 +08:00
2563 ORA 4031 2021-12-02 12:43:19.689000 +08:00
2586 ORA 4031 2021-12-02 12:43:21.068000 +08:00
查看某个 incident_id 对应的文件信息:
adrci> show tracefile -I 2586 diag/rdbms/hisdb/hisdb/incident/incdir_2586/hisdb_j000_2895_i2586.trc
查看某个 incident_id 对应的详细信息:
adrci> show incident -mode detail -p "incident_id=2586"
ADR Home = /usr/local/oracle/diag/rdbms/hisdb/hisdb:
*************************************************************************
**********************************************************
INCIDENT INFO RECORD 1
**********************************************************
INCIDENT_ID 2586
STATUS ready
CREATE_TIME 2021-12-02 12:43:21.068000 +08:00
PROBLEM_ID 3
CLOSE_TIME <NULL>
FLOOD_CONTROLLED none
ERROR_FACILITY ORA
ERROR_NUMBER 4031
ERROR_ARG1 32
ERROR_ARG2 shared pool
ERROR_ARG3 select obj# from oid$ where ...
ERROR_ARG4 KGLH0^31c9af70
ERROR_ARG5 kglHeapInitialize:temp
ERROR_ARG6 <NULL>
ERROR_ARG7 <NULL>
ERROR_ARG8 <NULL>
ERROR_ARG9 <NULL>
ERROR_ARG10 <NULL>
ERROR_ARG11 <NULL>
ERROR_ARG12 <NULL>
SIGNALLING_COMPONENT KGH
SIGNALLING_SUBCOMPONENT <NULL>
SUSPECT_COMPONENT <NULL>
SUSPECT_SUBCOMPONENT <NULL>
ECID <NULL>
IMPACTS 0
PROBLEM_KEY ORA 4031
FIRST_INCIDENT 1355
FIRSTINC_TIME 2021-12-02 12:30:12.701000 +08:00
LAST_INCIDENT 3612
LASTINC_TIME 2021-12-02 12:43:39.068000 +08:00
IMPACT1 34668547
IMPACT2 34668546
IMPACT3 0
IMPACT4 0
KEY_NAME Client ProcId
KEY_VALUE oracle@wgx.2895_140232683054912
KEY_NAME ProcId
KEY_VALUE 22.3
KEY_NAME SID
KEY_VALUE 26.7
KEY_NAME PQ
KEY_VALUE (0, 1638420193)
OWNER_ID 1
INCIDENT_FILE /usr/local/oracle/diag/rdbms/hisdb/hisdb/trace/hisdb_j000_2895.trc
OWNER_ID 1
INCIDENT_FILE /usr/local/oracle/diag/rdbms/hisdb/hisdb/incident/incdir_2586/hisdb_j000_2895_i2586.trc
1 rows fetched
|
|