SAP HANA TRC Analyzer
Overview
SAP HANA TRC Analyzer is a Visual Studio Code extension that analyzes SAP HANA trace files (.trc). It automatically analyzes monitoring view data, thread information, and call stacks based on Connection ID, presenting the information in an easy-to-read format.
Key Features
- Connection ID Analysis:
- Automatically detects and analyzes CID/LCID
- Smart handling of system Connection IDs
- Comprehensive connection context analysis
- Monitoring View Data:
- Automatic extraction of Connection ID related monitoring view data
- Support for both semicolon and dash-separated table formats
- Clear messaging for views with no matching data
- Thread Analysis:
- Extracts relevant thread information from [THREADS] section
- Includes SQL statements and transaction details
- Groups multi-line thread information into coherent blocks
- Call Stack Analysis:
- Extracts call stacks from [STACK_SHORT] section for related threads
- Well-formatted stack trace information
- Deep insight into thread execution context
- Smart Connection ID Handling:
- Automatic Connection ID detection and validation
- Special handling for system Connection IDs (0, -1)
- Prevention of unnecessary analysis
Usage
Connection ID Analysis
- Open a TRC file in VS Code
- Place your cursor on a line containing a Connection ID (CID or LCID)
- Start analysis using either:
- Keyboard shortcut: Ctrl+Shift+A
- Command Palette (F1): "Analyze SAP HANA Connection ID"
- View the analysis report in a new tab
Automatic Format Detection:
- The extension automatically detects the format (semicolon or dash-separated)
- No manual configuration needed for standard formats
Format Conversion:
- To convert any table format to a well-aligned format, you must press Ctrl+Tab
- Alternatively, use Command Palette (F1): "Format TRC File"
- This formatting step is required to properly align and structure the tables
- The extension will reformat all tables in the file to a clean, aligned format
Custom Formatting:
- For monitoring view sections:
- Tables are automatically aligned after pressing Ctrl+Tab
- Column widths are optimized for content
- Empty cells are filled with "N/A"
Working with Large Files:
- Open the TRC file in VS Code
- Press Ctrl+Tab to start the formatting process
- The extension processes sections incrementally
- Performance optimization for large trace files
The analysis report includes the following sections:
- 📊 Monitoring View Data: Formatted tables from relevant monitoring views
- 🔄 Running Threads: Thread context and SQL statements
- 📚 Call Stacks: Detailed call stack information for related threads
- 🔎 Additional Insights: Summary of findings
- ➡️ Recommended Actions: Suggestions for further investigation
The extension supports two types of table formats commonly found in SAP HANA trace files:
- Semicolon-Separated Format:
COLUMN1;COLUMN2;COLUMN3
value1;value2;value3
- Dash-Separated Format:
| COLUMN1 | COLUMN2 | COLUMN3 |
|---------|---------|---------|
| value1 | value2 | value3 |
Data Processing Features
- Smart Quote Handling: Properly processes quoted values containing semicolons or special characters
- Parentheses-Aware Parsing: Correctly handles values containing parentheses (e.g., "4.1 (6, 8)")
- Column Width Optimization: Automatically adjusts column widths based on content
- Empty Value Handling: Displays "N/A" for empty or null values
- Unicode Support: Properly handles international characters and special symbols
Monitoring View Processing
View Detection:
- Automatically identifies monitoring view sections
- Supports multiple view formats and headers
- Handles both standard and custom view layouts
Connection ID Matching:
- Identifies connection-related columns (CONNECTION, CONN_ID, CID)
- Supports various connection ID formats
- Handles both exact and numeric matches
Data Formatting:
- Aligns columns for better readability
- Adds separators between columns
- Maintains data relationships in multi-line entries
Example Output
📊 M_CONNECTIONS
CONNECTION_ID | USER_NAME | STATUS | CONNECT_TIME
-------------|-----------|-----------|---------------
200170 | SYSTEM | RUNNING | 2024-02-12 10:15:30
Installation Requirements
- Visual Studio Code 1.60.0 or higher
- SAP HANA trace files (.trc)
Known Issues
There are currently no known issues. If you encounter any problems, please report them in our GitHub repository.
Contributing
We welcome bug reports, feature suggestions, and pull requests. Please refer to our GitHub repository for more details.
License
This extension is distributed under the MIT License.
Release Notes
1.0.0
- Initial release
- Connection ID based analysis
- Monitoring view, thread, and call stack analysis
- Comprehensive analysis report generation
Support
For support, please:
- Check the documentation
- Search existing issues in the GitHub repository
- Create a new issue if your problem hasn't been reported
Privacy
This extension does not collect or transmit any data. All analysis is performed locally on your machine.