In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how to use the adrci command. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Adrci description
In oracle11g, the directory of dump file has changed, bdump and udump are integrated into trace, and cdump has a separate one.
Oracle has added a tool for ADRCI (Automatic Diagnostic Repository Command Interpreter)
Unified management of ASM instances and multiple database instances of alert files, background trace files, user trace files, dump files and so on.
And this tool can quickly query all trace files related to errors and package them into a zip file to fix the problem.
Relevant information is provided to the technical support of Oracle.
Second, view documents
1) enter and exit adrci
-- Show help
[root@oratest ~] # su-oracle
[oracle@oratest ~] $which adrci
~ / bin/adrci
[oracle@oratest trace] $adrci
ADRCI: Release 11.2.0.3.0-Production on Wed Dec 23 10:30:26 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
ADR base = "/ U01"
Adrci > help
HELP [topic]
Available Topics:
CREATE REPORT
ECHO
EXIT
HELP
HOST
IPS
PURGE
RUN
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 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 >
-- set the home directory of adrci:
Adrci > show home-if it is not the directory we want, we can specify set home diag/rdbms/tinadb/tinadb
ADR Homes:
Diag/rdbms/tinadb/tinadb
-- exit ADRCI:
Adrci > > exit or quit enter
-- remarks
1. Commands in adrci are case-insensitive but sensitive when using search strings, such as show tracefile% mmon%
two。 What if you can't use backspace in adrci
Like sqlplus, there are several options:
Use the de key
Use Ctrl+backspace
Delete the entire line using Ctrl+u (under bash)
Stty erase ^ h under the os command line (you can write directly under .profile / .bash _ profile of oracle)
2) View alert log
1.show alert-tail (default is 10 entries)
2.show alert-tail-f (like tail-f alertlog)
3.show alert
4.show alert-p "MESSAGE_TEXT like'% ORA-%'"
More visible help show alert
Note that the starting point of show alert is the log after the retention time set in control, or the log after purge, and the previous log cannot be displayed.
For example:
Adrci > show alert-tail-f
2015-12-23 08purl 35 purl 13.712000 + 08:00
Current log# 2 seq# 191 mem# 0: / u01/oradata/tinadb/redo02.log
Archived Log entry 296 added for thread 1 sequence 190 ID 0x637eb2fb dest 1:
2015-12-23 08Freight 50 purl 18.242000 + 08:00
Thread 1 advanced to log sequence 192 (LGWR switch)
Current log# 3 seq# 192 mem# 0: / u01/oradata/tinadb/redo03.log
Archived Log entry 297 added for thread 1 sequence 191 ID 0x637eb2fb dest 1:
2015-12-23 09VOV 05VOV 17.755000 + 08:00
Thread 1 advanced to log sequence 193 (LGWR switch)
Current log# 1 seq# 193 mem# 0: / u01/oradata/tinadb/redo01.log
Archived Log entry 298 added for thread 1 sequence 192 ID 0x637eb2fb dest 1:
2015-12-23 09 purl 20 purl 20.346000 + 08:00
Thread 1 advanced to log sequence 194 (LGWR switch)
Current log# 2 seq# 194 mem# 0: / u01/oradata/tinadb/redo02.log
Archived Log entry 299 added for thread 1 sequence 193 ID 0x637eb2fb dest 1:
3) View control
Adrci > show control
ADR Home = / u01/diag/rdbms/tinadb/tinadb:
*
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
2092229604 720 8760 2015-12-09 17 purl 41Franco 58.349021 + 08:00 2015-12-23 10 purl 05purl 32.222256 + 08:00 1280 1 2015-12-09 171Franco 41lav 58.349021 + 08:00
1 rows fetched
With regard to the setting of control, except for the default SHORTP_POLICY of 720 hours and LONGP_POLICY of 8760 hours, we can modify these two times:
Adrci > set control (SHORTP_POLICY = 360)
Adrci > set control (LONGP_POLICY = 2160)
Adrci > show control
ADR Home = / u01/diag/rdbms/tinadb/tinadb:
*
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
2092229604 360360 2015-12-09 17 purl 41purr 58.349021 + 08:00 2015-12-23 10 purl 05purl 32.222256 + 08:00 12 80 1 2015-12-09 17purl 41purr 58.349021 + 08:00
This changes to tracefiles retention for 360 hours, or 15 days, and incident file retention for 2160 hours, or 90 days.
This is the time limit for oracle to keep the log itself, and we can also clear it manually through the command purge.
4) quickly locate tracefile
(1) list all trace files: show tracefile
(2) Fuzzy query tracking files, such as those of a process, are case-sensitive show tracefile% mmon%.
(3) you can specify a path show tracefile% mmon%-path / home/steve/temp
(4) sort show tracefile-rt by time.
For example:
Adrci > show tracefile mmon%
Diag/rdbms/tinadb/tinadb/trace/tinadb_mmon_7202.trc
Diag/rdbms/tinadb/tinadb/trace/tinadb_mmon_21083.trc
Diag/rdbms/tinadb/tinadb/trace/tinadb_mmon_8320.trc
Diag/rdbms/tinadb/tinadb/trace/tinadb_mmon_4137.trc
Locate incident and problem
Commonly used:
Show incident
Show incident-mode detail-p "incident_id=1"
Show problem
Show problem-p "problem_id=2"
For more information, see help show incident or help show problem.
For example:
Adrci > show incident
ADR Home = / u01/diag/rdbms/tinadb/tinadb:
*
INCIDENT_ID PROBLEM_KEY CREATE_TIME
-
53353 ORA 600 [krbnpdf_wrngdbid_3] 2015-12-17 10 09purl 33.291000 + 08:00
53354 ORA 600 [krbnbeg_norestart] 2015-12-17 10 24purl 52.395000 + 08:00
53355 ORA 600 [krbnpdf_nonid] 2015-12-17 10 28 purl 17.766000 + 08:00
53417 ORA 600 [krbnbeg_norestart] 2015-12-17 10 32 purl 58.256000 + 08:00
53418 ORA 600 [krbnpdf_nonid] 2015-12-17 10 3422.881000 + 08:00
5 rows fetched
Adrci > show problem
ADR Home = / u01/diag/rdbms/tinadb/tinadb:
*
PROBLEM_ID PROBLEM_KEY LAST_INCIDENT LASTINC_TIME
- --
1 ORA 600 [krbnpdf_wrngdbid_3] 53353 2015-12-17 10 purl 09purl 33.291000 + 08:00
2 ORA 600 [krbnbeg_norestart] 53417 2015-12-17 10 purl 32 purl 58.256000 + 08:00
3 ORA 600 [krbnpdf_nonid] 53418 2015-12-17 10 3422.881000 + 08:00
3 rows fetched
We see five incident and three problem
Problem refers to a big problem, called criticial error. A big problem can be caused by many small incidents. So they are in a relationship of 1RV n.
View details:
Adrci > show incident-mode detail-p "incident_id=53353"
ADR Home = / u01/diag/rdbms/tinadb/tinadb:
*
* * *
INCIDENT INFO RECORD 1
* * *
INCIDENT_ID 53353
STATUS ready
CREATE_TIME 2015-12-17 10 09 purl 33.291000 + 08:00
PROBLEM_ID 1
CLOSE_TIME
FLOOD_CONTROLLED none
ERROR_FACILITY ORA
ERROR_NUMBER 600
ERROR_ARG1 krbnpdf_wrngdbid_3
ERROR_ARG2 / u01/oradata/tinadb/system01.dbf
ERROR_ARG3 1669126943
ERROR_ARG4 1668473151
ERROR_ARG5 1669126943
ERROR_ARG6
4. Ips packing
Package the relevant incident files to oracle and upload them to SR. We use an IPS (incident package service) service here.
Let's first create a logical package in the following ways:
1. Do not take any parameters, which means that the default level typical, there is no content.
Adrci > ips create package
Created package 1 without any contents, correlation level typical
two。 Add the incident parameter to indicate an incident. The default level is still typical.
Adrci > ips create package incident 53353
Created package 2 based on incident id 53353, correlation level typical
3. Add the incident parameter, specify an incident, and set level to all.
Adrci > ips create package incident 53354 correlate all
Created package 3 based on incident id 53354, correlation level al
4. Add the problem parameter to specify a problem. The default level is still typical.
Adrci > ips create package problem 2
Created package 4 based on problem id 2, correlation level typical
5. Add the problem parameter, specify a problem, and set level to basic.
Adrci > ips create package problem 1 correlate basic
Created package 5 based on problem id 1, correlation level basic
6. Add the time parameter to set the start time, to end time, followed by + 8:00 indicates the East eighth Zone.
Adrci > ips create package time '2015-12-22 00 to' 2015-12-23 00 to'
Created package 6 based on time range 2015-12-22 0000 to 00.000000 + 08:00 to 2015-12-23 0000 to 00.000000 + 08:00, correlation level typical
You can also append files to PACKAGE 3:
Adrci > ips add new incidents package 3
Added new incidents to package 3
Adrci > ips add problem 12 package 3
Added problem 12 to package 3
Fifth, put the package in the actual physical location
Adrci > ips generate package 3
Generated package 3 in file / u01/diag/rdbms/tinadb/tinadb/trace/ORA600krb_20151223104459_COM_1.zip, mode complete
To customize the path, add the in parameter:
Adrci > ips GENERATE PACKAGE 3 in / tmp
Generated package 3 in file / tmp/ORA600krb_20151223104459_COM_2.zip, mode complete
Note: the call to ips is related to perl. You need to install yum install-y perl in os beforehand, or there will be an error here.
With this zip package, we can send it directly to oracle Technical support.
VI. Decompression
Finally, let's briefly introduce the UNPACK command, which decompresses the resulting zip file to a specified directory:
Adrci > ips get metadata from file / tmp/ORA600krb_20151223104459_COM_2.zip
IPS metadata from file / tmp/ORA600krb_20151223104459_COM_2.zip:
three
ORA600krb_20151223104459
Complete
two
two
2015-12-23 11 Suzhou 33 51.703402 + 08:00
/ u01
/ u01/diag/rdbms/tinadb/tinadb
Rdbms
Tinadb
Tinadb
one
Adrci > ips unpack file / tmp/ORA600krb_20151223104459_COM_2.zip into / tmp
Unpacking file / tmp/ORA600krb_20151223104459_COM_2.zip into target / tmp
7. Clear purge
(1) to clear incident, we can use the purge command:
Adrci > purge-age 2
(2) to clear problem, we can use the delete command:
Adrci > delete from problem where problem_id=1
(3) clear trace
Adrci > purge-age 1440-type trace-you can delete trace before 24 hours
8. Command line executes adrci command
[oracle@oratest ~] $adrci exec= "show homes;echo '20070712 echo'; show base;"
Thank you for reading! This is the end of the article on "how to use the adrci command". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.