最近在生成一套系统的AWR报告时出现了如下报错:ORA-06502: PL/SQL: numeric or value error: character string buffer too smal
最近在生成一套系统的AWR报告时出现了如下报错:ORA-06502: PL/SQL: numeric or value error: character string buffer too small,然后生成AWR报告的过程就终止了,查看生成的AWR报告,发现报告时不完整的,AWR报告到Complete List of SQL Text部分就结束了,且最后是以一个非常长的sql语句结束的,且这个sql语句还没有显示完整。查看MOS后发现,这是Bug 7833620导致的(参考MOS文章Doc ID 1303342.1),但就为了生成AWR报告去打patch,有点兴师动众了,于是决定想办法绕过这个BUG。
根据上面的分析已经基本清楚,导致AWR报告生成失败的原因就是系统中存在一个特别长的sql。明确了这点,接下来就好办了,生成AWR报告的的sql文本是来自WRH$_SQLTEXT,那只要将这个基表中的sql文本进行截断,应该就能正确的生成AWR报告了。这里说明下,WRH$_SQLTEXT基表保存的是快照期间的sql文本信息,对该表的操作不会影响系统的sql语句运行,但是对基表的操作始终是非常危险的,建议不要直接在生成系统上进行操作,可以将生产的AWR数据导入到测试环境上生成AWR报告。AWR导入/导出具体操作,参看。
WRH$_SQLTEXT基表的结构如下:
保存sql文本的字段为CLOB字段,所以可以采用下面的方法对WRH$_SQLTEXT.SQL_TEXT字段进行截断:
update WRH$_SQLTEXT set sql_text = dbms_lob.substr(sql_text,3000);
commit;
执行完上述操作后,成功生成了AWR报告,但是,过长的sql是被截断的,如果要获得完整的sql,,可以根据AWR报告中的sqlid到系统中进行查找。
更多相关教程请访问 MySQL视频教程

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
