In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Introduction to ADR in ORACLE 11G:
View the oracle log of ADRCI
In the 11g version of Oracle, the location of the alert file has changed, while Oracle provides a command-line tool, ADRCI, which makes it easy to view exceptions in the database. Here's how to use ADRCI (ADR Command Interface) to view Oracle's warning log in 11g.
1. Enter adrci command line mode
Ora11g@RHEL53 / home/oracle$ which adrci
/ oracle/u01/app/oracle/product/1101/db/bin/adrci
Ora11g@RHEL53 / home/oracle$ adrci-help
Syntax:
Adrci [- help] [script=script_filename]
[exec = "one_command [; one_command;...]"]
Options Description (Default)
Script script. File name (None)
Help help on the command options (None)
Exec exec a set of commands (None)
Ora11g@RHEL53 / home/oracle$ adrci
ADRCI: Release 11.1.0.6.0-Beta on Fri Feb 27 15:23:52 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
ADR base = "/ oracle/u01/app/oracle"
Adrci >
two。 Use the help show alert command to view help documentation
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 > help show alert
Usage: SHOW ALERT [- p] [- term]
[[- tail [num] [- f]] | [- file]]
Purpose: Show alert messages.
Options:
[- p]: The predicate string must be double quoted.
The fields in the predicate are the fields:
ORIGINATING_TIMESTAMP timestamp
NORMALIZED_TIMESTAMP timestamp
ORGANIZATION_ID text (65)
COMPONENT_ID text (65)
HOST_ID text (65)
HOST_ADDRESS text (17)
MESSAGE_TYPE number
MESSAGE_LEVEL number
MESSAGE_ID text (65)
MESSAGE_GROUP text (65)
CLIENT_ID text (65)
MODULE_ID text (65)
PROCESS_ID text (33)
THREAD_ID text (65)
USER_ID text (65)
INSTANCE_ID text (65)
DETAILED_LOCATION text (161l)
UPSTREAM_COMP_ID text (101)
DOWNSTREAM_COMP_ID text (101)
EXECUTION_CONTEXT_ID text (101)
EXECUTION_CONTEXT_SEQUENCE number
ERROR_INSTANCE_ID number
ERROR_INSTANCE_SEQUENCE number
MESSAGE_TEXT text (2049)
MESSAGE_ARGUMENTS text (129)
SUPPLEMENTAL_ATTRIBUTES text (129)
SUPPLEMENTAL_DETAILS text (129)
PROBLEM_KEY text (65)
[- 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]: Allow users to specify an alert file which
May not be in ADR. 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. Use show alert to list the log directories under each directory, enter the number 4, and the system will automatically call the vi editor to view the alert logs of the database.
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. Another way to view it is to specify a specific homepath and then use "show alert-tail 15" to view the last 15 lines of the corresponding log file
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 2515 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 purl 25 purl 07.246000 + 08:00
Starting background process QMNC
QMNC started with pid=23, OS id=3859
2009-02-27 14 purl 25 purl 17.325000 + 08:00
Db_recovery_file_dest_size of 4096 MB is 0.005% 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 2915. 158000 + 08:00
Starting background process CJQ0
CJQ0 started with pid=25, OS id=3892
Adrci >
The structure and location of ADR:
The initialization parameter diagnostic_dest specifies the root directory of the ADR. Even if you ignore the initialization parameter. Oracle also creates an ADR.
If you set the ORACLE_BASE environment variable, then the default value of diagnostic_dest is this directory. If you do not set the ORACLE_BASE variable, the parameter value is the $ORACLE_HOME/log directory.
ADR stores diagnostic data for all oracle products. ADR assigns a separate home directory to each oracle product and its instance. So an ADR directory contains multiple home directories.
The home directory for each ADR is one that stores its diagnostic files for each database instance or other oracle product or component. The directory structure is as follows:
ADR_base/diag/product_type/product_id/instance_id/
For example, a diagnostic_dest initialization parameter is / u05/app/oracle. Then the home directory in which the sid of an oracle database is prod1 is as follows:
/ u05/app/oracle/diag/rdbms/prod1/prod1/
There are many subdirectories under an ADR's home directory:
Alert: the alarm log file of an instance (in xml format).
Cdump:core file.
Hm: health examination report.
Incident: one subdirectory for each event, which contains all the trace dump files.
Incpkg: the event package you created is used to send it to oracle support.
Ir: contains instance event reports.
Trace: stores the callback trace file.
You can query the directory and its location through the view v$diag_info:
SQL > select name, value from v$diag_info
NAME VALUE
Diag Enabled TRUE
ADR Base / u01/app/oracle
ADR Home / 01/app/oracle/diag/rdbms/prod/prod1
Diag Trace / u01/app/oracle/diag/rdbms/prod/prod1/trace
Diag Alert / u01/app/oracle/diag/rdbms/ prod/prod1/alert
Diag Incident / u01/app/oracle/diag/rdbms/prod/prod1/incident
Diag Cdump / u01/app/oracle/diag/rdbms/ prod/prod1/cdump
Health Monitor / u01/app/oracle/diag/rdbms/ prod/prod1/hm
Default Trace File / u01/app/oracle/diag/rdbms/ prod/prod1/
Trace/eleven_ora_9417.trc
Active Problem Count 3
Active Incident Count 8
As you can see, the view v$diag_info includes the number of problems and events.
For example, use the following command to view all ORA- errors:
Adrci > set homepath diag/rdbms/rac/rac
Adrci > set editor vi
Adrci > show alert-p "message_text like'% ORA-%'"
ADR Home = / home/oracle/diag/rdbms/rac/rac:
*
Output the results to file: / tmp/alert_10191_1638_rac_1.ado
2012-03-29 20 56 12.266000 + 08:00
ORA-1109 signalled during: ALTER DATABASE CLOSE NORMAL...
2012-03-29 20 purl 56 purl 27.810000 + 08:00
Errors in file / home/oracle/diag/rdbms/rac/rac/trace/rac_ora_10453.trc:
ORA-00313:? 1?
ORA-00312: 1: / home/oracle/oradata/rac/redo01.log'
After exiting like the vi editor, you can find the screen output in the file / tmp/alert_10191_1638_rac_1.ado. Easy to analyze
You can see that this feature is very different from the grep | ORA- command in unix, because the latter can only output error lines, but the time of occurrence of the error lines cannot be displayed, while show alert shows both the error and the occurrence time.
5. Summary
Using the ADRCI command can centrally view the log files in each directory, which can effectively improve the work efficiency.
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.