Oracle ADRCI (ADR Command Interpreter) - Complete Diagnostic Guide
Oracle ADRCI (ADR Command Interpreter) - Complete Diagnostic Guide
Section titled “Oracle ADRCI (ADR Command Interpreter) - Complete Diagnostic Guide”Oracle Automatic Diagnostic Repository Command Interpreter (ADRCI) is a command-line tool for managing diagnostic data in the Automatic Diagnostic Repository (ADR). Available from Oracle 11g onwards, ADRCI provides powerful capabilities for incident investigation, diagnostic data management, and health monitoring.
🎯 Overview
Section titled “🎯 Overview”What is ADRCI?
Section titled “What is ADRCI?”ADRCI provides:
- Centralized diagnostic data management across Oracle products
- Incident investigation tools for problem analysis
- Health monitoring reports and checks
- Diagnostic data packaging for Oracle Support
- Alert log management and analysis
- Automated diagnostic collection and organization
ADR Architecture
Section titled “ADR Architecture”ADR Structure
Section titled “ADR Structure”# ADR Base directory structure$ORACLE_BASE/diag/├── rdbms/│ └── <db_name>/│ └── <instance_name>/│ ├── alert/ # Alert logs│ ├── incident/ # Incident data│ ├── trace/ # Trace files│ ├── cdump/ # Core dumps│ ├── hm/ # Health Monitor│ └── metadata/ # ADR metadata├── tnslsnr/│ └── <host>/│ └── <listener>/└── clients/🔧 Basic ADRCI Operations
Section titled “🔧 Basic ADRCI Operations”Starting and Basic Commands
Section titled “Starting and Basic Commands”ADRCI Session Management
Section titled “ADRCI Session Management”# Start ADRCIadrci
# Show helpADRCI> help
# Set editor for viewing filesADRCI> set editor vi
# Show current working directoryADRCI> pwd
# Show ADR homesADRCI> show homesBasic Information Commands
Section titled “Basic Information Commands”# Show database informationADRCI> show homesADRCI> set home diag/rdbms/mydb/mydb1
# Show database parametersADRCI> show parameter
# Show alert log locationADRCI> show alert
# Show control informationADRCI> show controlAlert Log Management
Section titled “Alert Log Management”Viewing Alert Logs
Section titled “Viewing Alert Logs”# Show recent alert log entriesADRCI> show alert
# Show alert log with timestampsADRCI> show alert -t
# Show last N linesADRCI> show alert -tail 50
# Show alerts for specific time periodADRCI> show alert -start "2024-01-15 08:00:00" -end "2024-01-15 18:00:00"
# Show alerts containing specific textADRCI> show alert | grep -i "ORA-"
# Show alert in XML formatADRCI> show alert -xmlAlert Log Analysis
Section titled “Alert Log Analysis”# Search for specific errorsADRCI> show alert -message_text "ORA-00600"
# Show critical alertsADRCI> show alert -level "critical"
# Export alert log to fileADRCI> spool /tmp/alert_export.logADRCI> show alert -start "2024-01-15 00:00:00"ADRCI> spool off
# Show alert log statisticsADRCI> show alert -stats🚨 Incident Management
Section titled “🚨 Incident Management”Incident Investigation
Section titled “Incident Investigation”Viewing Incidents
Section titled “Viewing Incidents”# Show all incidentsADRCI> show incident
# Show incident detailsADRCI> show incident -id 12345
# Show incidents by statusADRCI> show incident -status open
# Show incidents for specific problemADRCI> show incident -problem_id 1
# Show recent incidentsADRCI> show incident -last 10Incident Analysis
Section titled “Incident Analysis”# Describe incident structureADRCI> describe incident
# Show incident filesADRCI> show incident -id 12345 -file
# View specific incident fileADRCI> show incident -id 12345 -file alert_mydb1_12345.trc
# Show incident progressionADRCI> show incident -id 12345 -timeline
# Show related incidentsADRCI> show incident -correlate -id 12345Problem Management
Section titled “Problem Management”Problem Investigation
Section titled “Problem Investigation”# Show all problemsADRCI> show problem
# Show problem detailsADRCI> show problem -id 1
# Show problem impactADRCI> show problem -id 1 -impact
# Close resolved problemADRCI> set problem -id 1 -status closed
# Show problem timelineADRCI> show problem -id 1 -detailAdvanced Problem Analysis
Section titled “Advanced Problem Analysis”# Show problem correlationADRCI> show problem -correlate
# Show problem keyADRCI> show problem -key "ORA 600"
# Export problem informationADRCI> show problem -id 1 > /tmp/problem_1.txt
# Show problem statisticsADRCI> show problem -stats -last 30📊 Health Monitoring
Section titled “📊 Health Monitoring”Health Monitor Reports
Section titled “Health Monitor Reports”Running Health Checks
Section titled “Running Health Checks”# Show available health checksADRCI> show hm_check
# Run specific health checkADRCI> run hm_check db_structure_integrity
# Show health check resultsADRCI> show hm_run
# Show specific run detailsADRCI> show hm_run -id 123
# Show health check recommendationsADRCI> show hm_run -id 123 -recommendationCustom Health Monitoring
Section titled “Custom Health Monitoring”# Create custom health checkADRCI> create hm_check -name custom_space_check -check_name tablespace_usage
# Schedule health checkADRCI> run hm_check custom_space_check -interval 3600
# Show scheduled checksADRCI> show hm_check -scheduled
# Cancel scheduled checkADRCI> cancel hm_check -name custom_space_checkSystem Health Analysis
Section titled “System Health Analysis”# Database health summaryADRCI> show hm_info
# Show health metricsADRCI> show hm_metric
# Show health findingsADRCI> show hm_finding
# Export health reportADRCI> show hm_run -id 123 -format html > /tmp/health_report.html
# Show health trendsADRCI> show hm_metric -trend -last 7📦 Diagnostic Data Packaging
Section titled “📦 Diagnostic Data Packaging”Creating Support Packages
Section titled “Creating Support Packages”IPS (Incident Packaging Service)
Section titled “IPS (Incident Packaging Service)”# Create logical packageADRCI> ips create package incident 12345
# Add related incidents to packageADRCI> ips add incident 12346 package 1
# Add time-based dataADRCI> ips add package 1 time -start "2024-01-15 08:00:00" -end "2024-01-15 10:00:00"
# Show package contentsADRCI> ips show package 1
# Generate packageADRCI> ips generate package 1 in /tmp/oracle_support
# Show package statusADRCI> ips show package 1 -detailAdvanced Packaging
Section titled “Advanced Packaging”# Create package with specific correlationADRCI> ips create package problem 1
# Add external filesADRCI> ips add file /u01/oracle/trace/custom.trc package 1
# Add database informationADRCI> ips add database package 1
# Finalize packageADRCI> ips finalize package 1
# Remove sensitive dataADRCI> ips sanitize package 1Package Management
Section titled “Package Management”# List all packagesADRCI> ips show packages
# Show package informationADRCI> ips show package 1 -info
# Delete packageADRCI> ips delete package 1
# Export package metadataADRCI> ips show package 1 -metadata > package_info.xml
# Validate packageADRCI> ips validate package 1🔍 Trace File Management
Section titled “🔍 Trace File Management”Trace File Operations
Section titled “Trace File Operations”Viewing Trace Files
Section titled “Viewing Trace Files”# Show trace filesADRCI> show tracefile
# Show trace files for specific timeADRCI> show tracefile -rt -start "2024-01-15 08:00:00"
# Show large trace filesADRCI> show tracefile -size 100000
# View specific trace fileADRCI> show tracefile alert_mydb1_12345.trc
# Search in trace filesADRCI> show tracefile -grep "ORA-00600"Trace File Analysis
Section titled “Trace File Analysis”# Show trace file detailsADRCI> describe tracefile alert_mydb1_12345.trc
# Extract trace file sectionsADRCI> show tracefile alert_mydb1_12345.trc -section 2
# Show trace file statisticsADRCI> show tracefile -stats
# Purge old trace filesADRCI> purge -age 7 -type trace
# Archive trace filesADRCI> archive tracefile -older_than 30Core Dump Analysis
Section titled “Core Dump Analysis”# Show core dumpsADRCI> show core
# Analyze core dumpADRCI> show core -id 12345 -analysis
# Extract core dump informationADRCI> show core -id 12345 -stack
# Show core dump summaryADRCI> show core -summary
# Package core dump for analysisADRCI> ips create package core 12345📈 ADR Maintenance
Section titled “📈 ADR Maintenance”Space Management
Section titled “Space Management”ADR Purging Policies
Section titled “ADR Purging Policies”# Show purge policyADRCI> show control
# Set purge policyADRCI> set control (SHORTP_POLICY = 168) # 7 daysADRCI> set control (LONGP_POLICY = 8760) # 1 year
# Manual purgingADRCI> purge -age 1440 -type incident # 1 dayADRCI> purge -age 4320 -type trace # 3 daysADRCI> purge -age 10080 -type alert # 1 week
# Show space usageADRCI> show homes -usage
# Purge by sizeADRCI> purge -size 1000000 -type trace # 1MBAutomated Maintenance
Section titled “Automated Maintenance”# Enable automatic purgingADRCI> set control (PURGE_ENABLE = TRUE)
# Set maximum ADR sizeADRCI> set control (MAX_ADR_SIZE = 2048) # 2GB
# Show purge historyADRCI> show purge
# Force immediate purgeADRCI> purge -force
# Show disk usage by typeADRCI> show homes -diskusageConfiguration Management
Section titled “Configuration Management”# Show all control parametersADRCI> show control -all
# Backup ADR configurationADRCI> show control > /tmp/adr_config_backup.txt
# Export ADR structureADRCI> show homes -detail > /tmp/adr_structure.txt
# Reset to defaultsADRCI> set control (DEFAULT_POLICY = TRUE)
# Show configuration changesADRCI> show control -history🔧 Advanced ADRCI Features
Section titled “🔧 Advanced ADRCI Features”Cross-Component Analysis
Section titled “Cross-Component Analysis”Multi-Component Investigation
Section titled “Multi-Component Investigation”# Set multiple homesADRCI> set homes diag/rdbms/mydb/mydb1 diag/tnslsnr/server1/listener
# Show incidents across componentsADRCI> show incident -all_homes
# Correlate incidents across componentsADRCI> show incident -correlate -all_homes
# Generate comprehensive packageADRCI> ips create package comprehensive -all_homesTimeline Analysis
Section titled “Timeline Analysis”# Show system timelineADRCI> show timeline -start "2024-01-15 08:00:00" -end "2024-01-15 10:00:00"
# Show incident timelineADRCI> show incident -timeline -start "2024-01-15 08:00:00"
# Show cross-component timelineADRCI> show timeline -all_homes -start "2024-01-15 08:00:00"
# Export timeline dataADRCI> show timeline -xml > /tmp/timeline.xmlAutomated Diagnostics
Section titled “Automated Diagnostics”Diagnostic Collection
Section titled “Diagnostic Collection”# Collect comprehensive diagnosticsADRCI> collect diagnostics -problem_id 1 -time 1440
# Collect custom diagnostic setADRCI> collect diagnostics -name "performance_issue" -components db,listener
# Schedule diagnostic collectionADRCI> schedule collect -name daily_health -interval 86400
# Show collection statusADRCI> show collect -status
# Export collected dataADRCI> export collect -name performance_issue -format tgz🛡️ Security and Best Practices
Section titled “🛡️ Security and Best Practices”Access Control
Section titled “Access Control”ADRCI Security
Section titled “ADRCI Security”# Check ADR permissionsls -la $ORACLE_BASE/diag/
# Secure ADR directorychmod 750 $ORACLE_BASE/diag/
# Audit ADRCI usageADRCI> set logging onADRCI> show logging
# Show access historyADRCI> show access -history
# Configure access restrictionsADRCI> set access -restrict -users dba_groupData Protection
Section titled “Data Protection”# Sanitize sensitive dataADRCI> sanitize package 1 -remove_sql -remove_binds
# Mask sensitive informationADRCI> set control (SANITIZE_AUTO = TRUE)
# Show data classificationADRCI> show classification
# Export sanitized dataADRCI> export package 1 -sanitizedBest Practices
Section titled “Best Practices”Regular Maintenance
Section titled “Regular Maintenance”-- Create ADRCI maintenance script#!/bin/bash
# Set environmentexport ORACLE_HOME=/u01/oracle/product/19cexport PATH=$ORACLE_HOME/bin:$PATH
# ADRCI maintenance commandsadrci exec="set home diag/rdbms/mydb/mydb1;purge -age 1440 -type incident;purge -age 4320 -type trace;show homes -usage;exit"
# Log resultsecho "ADR maintenance completed at $(date)" >> /var/log/adr_maintenance.logMonitoring Integration
Section titled “Monitoring Integration”# Health check automationADRCI> run hm_check db_structure_integrity -autoADRCI> run hm_check undo_integrity -autoADRCI> run hm_check txn_integrity -auto
# Alert integrationADRCI> set alert_notification on
# Performance monitoringADRCI> show hm_metric -trend -component database🚨 Troubleshooting Common Issues
Section titled “🚨 Troubleshooting Common Issues”ADRCI Problems
Section titled “ADRCI Problems”Access Issues
Section titled “Access Issues”# ADRCI permission errorschown -R oracle:dba $ORACLE_BASE/diag/chmod -R 750 $ORACLE_BASE/diag/
# ADR corruption issuesADRCI> validate repositoryADRCI> repair repository
# Missing ADR basemkdir -p $ORACLE_BASE/diagADRCI> create home diag/rdbms/mydb/mydb1Performance Issues
Section titled “Performance Issues”# Large ADR sizeADRCI> show homes -diskusageADRCI> purge -age 720 -type all # Purge 30 daysADRCI> set control (MAX_ADR_SIZE = 1024)
# Slow ADRCI operationsADRCI> rebuild indexADRCI> optimize repository
# ADR fragmentationADRCI> compress repositoryError Resolution
Section titled “Error Resolution”Common Error Codes
Section titled “Common Error Codes”# ADR-00101: ADR base not setexport ORACLE_BASE=/u01/oracleadrci
# ADR-00102: ADR home does not existADRCI> create home diag/rdbms/mydb/mydb1
# ADR-00110: Repository corruptionADRCI> validate repositoryADRCI> repair repository -force
# ADR-00115: Insufficient spaceADRCI> purge -forceADRCI> set control (MAX_ADR_SIZE = 2048)📊 Reporting and Analysis
Section titled “📊 Reporting and Analysis”Custom Reports
Section titled “Custom Reports”Diagnostic Reports
Section titled “Diagnostic Reports”# Generate comprehensive health reportADRCI> set home diag/rdbms/mydb/mydb1ADRCI> show hm_run -last 10 -format html > /tmp/health_summary.html
# Create incident summary reportADRCI> show incident -last 30 -detail > /tmp/incident_summary.txt
# Generate alert analysisADRCI> show alert -stats -last 7 > /tmp/alert_analysis.txt
# Export problem trendsADRCI> show problem -trend -last 30 -format xml > /tmp/problem_trends.xmlPerformance Analysis
Section titled “Performance Analysis”# Database performance reportADRCI> show hm_metric -component database -last 24
# System resource analysisADRCI> show hm_metric -component system -trend
# Application performanceADRCI> show hm_metric -component application -summary
# Export performance dataADRCI> export metrics -component all -format csv > /tmp/performance_data.csvOracle ADRCI provides comprehensive diagnostic capabilities that are essential for proactive database management and effective problem resolution. Regular use of ADRCI helps maintain database health and enables rapid incident response.
📖 Related Topics
Section titled “📖 Related Topics”- Oracle Alert Log Analysis - Alert log monitoring scripts
- AWR Performance Monitoring - Performance data analysis
- RMAN Backup and Recovery - Database backup strategies
- Oracle Architecture - Understanding Oracle components