In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
ADR is a file-based database diagnostic data repository referenced by 11g for storing, for example, traces, dumps, alert logs, health monitor reports, etc. It has a unified catalog structure across multiple instances and multiple products. The initialization parameters BACKGROUND_DUMP_DEST and USER_DUMP_DEST in 10g have been deprecated. The specific location has been set to DIAGNOSTIC_DEST to identify the location of ADR.
diagnostic data
the positions held prior
ADR Location
accident dump
USER|BACKGROUND_DUMP_DEST
$ADR_HOME/incident/incdir_n
core dump
CORE_DUMP_DEST
$ADR_HOME/cdump
Alert log data
BACKGROUND_DUMP_DEST
$ADR_HOME/alert&trace
Background Process Tracking
BACKGROUND_DUMP_DEST
$ADR_HOME/trace
foreground process tracing
USER_DUMP_DEST
$ADR_HOME/trace
If the DIAGNOSTIC_DEST parameter is omitted or left null, the database DIAGNOSTIC_DEST is set at startup as follows:
If ORACLE_BASE has an environment variable set, DIAGNOSTIC_DEST is set to the specified directory ORACLE_BASE.
DIAGNOSTIC_DEST is set to ORACLE_HOME / log if ORACLE_BASE is not set to the environment variable.
ADR subdirectories generate diagnostic logs for different products or components according to different installed products. For example, operating systems with db gi installed usually have the following directory structure:
The ADR directory structure for database instances is as follows:
Contains the following sections:
subdirectory name
content
Alert
Alert logs in XML format
cdump
core document
Incident
Multiple subdirectories, each named for a specific event, each containing dumps related only to that event
trace
Background and server process trace files, SQL trace files and alert logs in text format
(Other)
Other subdirectories of ADR home, used to store event packages, health monitor reports, logs other than alarm logs (such as DDL logs and debug logs), etc.
The ADR directory of the database can be viewed in the view:
SELECT * FROM V$DIAG_INFO; INST_ID NAME VALUE------- --------------------- ------------------------------------------------------------- 1 Diag Enabled TRUE 1 ADR Base /u01/oracle 1 ADR Home /u01/oracle/diag/rdbms/orclbi/orclbi 1 Diag Trace /u01/oracle/diag/rdbms/orclbi/orclbi/trace 1 Diag Alert /u01/oracle/diag/rdbms/orclbi/orclbi/alert 1 Diag Incident /u01/oracle/diag/rdbms/orclbi/orclbi/incident 1 Diag Cdump /u01/oracle/diag/rdbms/orclbi/orclbi/cdump 1 Health Monitor /u01/oracle/diag/rdbms/orclbi/orclbi/hm 1 Default Trace File /u01/oracle/diag/rdbms/orclbi/orclbi/trace/orcl_ora_22769.trc 1 Active Problem Count 8 1 Active Incident Count 20
The V$DIAG_INFO view lists all important ADR locations, including:
ADR Base: Path to ADR Base Directory. ADR Home: Path to the ADR home directory of the current database instance.·Diag Trace: Location of text alert logs and background/foreground process trace files.·Diag Alert: Location of XML version of alert log.·Default Trace File: Path to the trace file for the session. SQL trace files will be written here.
Adrci Command Line Tools
Adrci is a command-line tool used to manage log files in oracle 11g.
[oracle@prodb ~]$ adrci -helpSyntax: adrci [-help] [script=script_filename] [exec = "one_command [;one_command;...] "] [oracle@prodb ~]$ adrci ADRCI: Release 11.2.0.4.0 - Production on Thu May 31 14:32:48 2018 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>
Adrci supports script mode and exec command set mode.
Script mode:
The script keeps the log for 5-7 days for modifying trc\trm. [oracle@prodb ~]$ cat adrci_script.txtshow homes;set home diag/rdbms/prodb/prodb;set control (SHORTP_POLICY = 120);set control (LONGP_POLICY = 168);show control;[oracle@prodb ~]$ adrci script=adrci_script.txt
exec command set mode:
[oracle@prodb ~]$ adrci exec="show homes;set home diag/rdbms/prodb/prodb;set control \(SHORTP_POLICY=120\);set control \(LONGP_POLICY=168\);show control"
Common adrci commands:
1. Show adr_home
adrci> show homesADR Homes:diag/tnslsnr/prodb/listenerdiag/rdbms/prodb/prodbdiag/clients/user_oracle/host_3001804591_80
2. Specify adr_home
adrci> set home diag/rdbms/prodb/prodbadrci> show homesADR Homes:diag/rdbms/prodb/prodb
3. Display alter files
adrci> show alert #press q to exit adrci> show alert -tail 50 #show last 50 lines adrci> show alert -tail 50 #tail -f alert_sid.logadrci> show alert -p "message_text like '%ORA%'"
4. Display alarm event
adrci> show incidentadrci> show incident -mode detailadrci> show incident -mode detail -p "incident_id=123"
4. display problems
adrci> show problem
5. Delete incident 14400=60min*24*10 from 10 days ago
adrci> purge -age 14400 -type incident
Generate diagnostic package
1)An incident package is a logical structure in ADR that describes one or more problems. 2)A package is a zip file that contains dump information about an incident package. 3)By default, an incident package contains only the first three incidents and the last three incidents for each problem. 4)You can generate either a full zip file or an incremental zip file.
1. Create logical package
adrci> ips create package incident 373adrci> ips add incident 168 package 1
2. Output Physical Package
adrci>ips generate package 1 in /home/oracle
Other packing commands:
· IPS CREATE PACKAGE is used to create an empty package.·IPS CREATE PACKAGE PROBLEMKEY is used to create packages based on problem keywords.·IPS CREATE PACKAGE PROBLEM is used to create packages based on the problem ID.·IPS CREATE PACKAGE INCIDENT is used to create packages based on incident IDs.·IPS CREATE PACKAGE SECONDS is used to create a package that contains all unexpected events generated during the time interval from a few seconds ago to the present.·IPS CREATE PACKAGE TIME is used to create packages based on a specified time range. You can also add content to existing packages. For example: · IPS ADD INCIDENT PACKAGE is used to add unexpected events to an existing package.·IPS ADD FILE PACKAGE is used to add files from ADR to an existing package.
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: 263
*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
It has been dragging on for a long time, take the time to make up _ (: "∠") _
© 2024 shulou.com SLNews company. All rights reserved.