Home Database Mysql Tutorial 通过定制Orabbix监控分析潜在的Oracle问题

通过定制Orabbix监控分析潜在的Oracle问题

Jun 07, 2016 pm 03:10 PM

定制的功能在Orabbix中实现非常灵活而且轻巧,还是能够感受到一种开源风的清爽。在orabbix原有模板的基础上添加了几个监控项,一

在之前的文章中分享过 简单定制Orabbix监控项 

定制的功能在Orabbix中实现非常灵活而且轻巧,还是能够感受到一种开源风的清爽。
我在orabbix原有模板的基础上添加了几个监控项,一个是监控闪回区的使用率,,还有一个是监控归档的切换频率,这两个功能看似微不足道,但是会在细节中反应出数据库中是否有明显的异常行为。
中午的时候注意到有一个库的闪回区使用率和归档频率比较高。还是有一些反常,而从我这边的信息来看,没有得到开发人员的反馈说需要做什么数据变更。
得到的orabbix监控图如下:
闪回区的使用情况如下:

通过定制Orabbix监控分析潜在的Oracle问题


归档频率如下:

通过定制Orabbix监控分析潜在的Oracle问题



通过这个图可以看到还是有一些异常情况的。这个库是一个统计库,案例来说并发访问量应该不高,但是现在从早上的某个时间点开始,归档量急剧提升,已经快触及警报线。
在这个时候也是带着疑问去检查了一下这个库,结果通过ash视图去看,是否正在进行大量的并发操作,结果没有任何的active session,然后查看数据库负载,又很高。
抓取了一个awr报告来看。赫然发现top1的sql竟然是一个update语句。
 

        Elapsed                  Elapsed Time                                                                                                         

        Time (s)    Executions  per Exec (s)  %Total  %CPU    %IO    SQL Id                                                                         

---------------- -------------- ------------- ------ ------ ------ -------------                                                                     

        3,604.9              0          N/A  26.9  32.5  68.2 3jggcpxmv6w8g                                                                     

Module: sqlplus@stat.xxxxx.com (TNS V1-V3)                                                                                                       

update "xxxx"."TEST_BILLING" set "ID" = 'xxxxxxxxxx'
这个语句可以明显看出来存在一定的问题,因为这是一个大表,数据量在亿级,进行这样一个dml操作,代价还是相当大的。
为了一探究竟我们来看看到底是谁在执行这样一个dml。
结果一看还是让人大吃一惊,竟然是在本地的sys的操作,问题又指向了自己,因为这个库开发人员是没有任何权限直接访问的。
USERNAME    SID    SERIAL# PROGRAM                                          MACHINE
--------------- ---------- ------------------------------------------------ --------------------
SYS          22      50043 sqlplus@stat.xxxxxxxxxx,com (TNS V1-V3)            xxxxxxxx.cyou.com
SYS        3560      63187 sqlplus@stat.xxxxxxxxxx,com (TNS V1-V3)            xxxxxxxx.cyou.com
但是我确实也没有做任何的操作,不至于说哪个脚本很神奇的执行了?
带着疑问和同事进行排查,最后发现,这个dml语句是在做log miner解析的时候出了点问题。
因为一些数据同步的考虑,需要从另外一个核心库中同步一部分的数据到这个统计库中,但是又不想直接在主库中进行任何的额外配置,这个时候就使用了log miner来定制抽取归档中的sql语句,然后部署在这个统计库中。这个过程是通过crontab来触发的。
但是在log miner解析的过程中还是出了一点解析的问题,有一条update语句没有where字句结果就直接应用到这个统计库中了,结果生成了大量的redo,归档切换也很频繁。
比如说解析log miner的视图的时候,默认是使用下面的方式。
SELECT sql_redo FROM v$logmnr_contents WHERE seg_owner='XXXX' AND TABLE_NAME IN ('XXXX','XXXXXX') AND OPERATION in ('INSERT','UPDATE','DELETE')
结果某一条语句在解析的过程中出了问题,结果导致对于这类不规范的update语句,应用到统计库的时候把影响放大了。
可以通过交半年进行过滤,也可以直接在sql中进行过滤。比如修改为下面的形式。
SELECT sql_redo FROM v$logmnr_contents WHERE seg_owner='XXXXX' AND TABLE_NAME IN ('XXXX','XXXX') AND OPERATION in ('INSERT') or (operation in ('DELETE','UPDATE') and upper(sql_redo)  like '%WHERE %')
这样对于update和delete操作都hi进行必要的过滤,那些不指定条件的delete,update操作都可以直接屏蔽。

当然对这个问题的紧急修复也很明确,就是kill那个运行很长时间的session.
Kill session之后的效果如下,可以看到闪回区的使用率一下子降下来了。归档频率也降下来了。

通过定制Orabbix监控分析潜在的Oracle问题

通过定制Orabbix监控分析潜在的Oracle问题



通过这个问题可以看出,定制适合自己的监控项在某种程度上还是能够起到很好的监控作用。对于某些异常情况还是不要掉以轻心。

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1261
29
C# Tutorial
1234
24
When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Can mysql and mariadb coexist Can mysql and mariadb coexist Apr 08, 2025 pm 02:27 PM

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

Laravel Eloquent ORM in Bangla partial model search) Laravel Eloquent ORM in Bangla partial model search) Apr 08, 2025 pm 02:06 PM

LaravelEloquent Model Retrieval: Easily obtaining database data EloquentORM provides a concise and easy-to-understand way to operate the database. This article will introduce various Eloquent model search techniques in detail to help you obtain data from the database efficiently. 1. Get all records. Use the all() method to get all records in the database table: useApp\Models\Post;$posts=Post::all(); This will return a collection. You can access data using foreach loop or other collection methods: foreach($postsas$post){echo$post->

RDS MySQL integration with Redshift zero ETL RDS MySQL integration with Redshift zero ETL Apr 08, 2025 pm 07:06 PM

Data Integration Simplification: AmazonRDSMySQL and Redshift's zero ETL integration Efficient data integration is at the heart of a data-driven organization. Traditional ETL (extract, convert, load) processes are complex and time-consuming, especially when integrating databases (such as AmazonRDSMySQL) with data warehouses (such as Redshift). However, AWS provides zero ETL integration solutions that have completely changed this situation, providing a simplified, near-real-time solution for data migration from RDSMySQL to Redshift. This article will dive into RDSMySQL zero ETL integration with Redshift, explaining how it works and the advantages it brings to data engineers and developers.

The relationship between mysql user and database The relationship between mysql user and database Apr 08, 2025 pm 07:15 PM

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

MySQL: The Ease of Data Management for Beginners MySQL: The Ease of Data Management for Beginners Apr 09, 2025 am 12:07 AM

MySQL is suitable for beginners because it is simple to install, powerful and easy to manage data. 1. Simple installation and configuration, suitable for a variety of operating systems. 2. Support basic operations such as creating databases and tables, inserting, querying, updating and deleting data. 3. Provide advanced functions such as JOIN operations and subqueries. 4. Performance can be improved through indexing, query optimization and table partitioning. 5. Support backup, recovery and security measures to ensure data security and consistency.

See all articles