ORA-01555 Problem Analysis and Solution

Source: Internet
Author: User
Today, my colleague sent me a problem, throwing a ORA-01555 error when running a Job, hope we can see what can be found from the database layer. Error Log

Today, my colleague sent me a problem, throwing a ORA-01555 error when running a Job, hope we can see what can be found from the database layer. Error Log

Today, my colleague sent me a problem, throwing a ORA-01555 error when running a Job, hope we can see what can be found from the database layer.

The error log is as follows:

Function: EntitySQLCursor: query

Line number: 113

Time: Thu Jul 2 22:52:46 2015

Message text: (PE1-000143) Internal IO Framework Database Error, message ORA-01555: snapshot too old: rollback segment number 22 with name "_ SYSSMU22_234950861 $" too small, code 1555.

It seems that the rollback segment allocated by Oracle is too small. For this problem, because it has been a while, one way to analyze it properly is to use ash.

Based on the timestamp in the error message, it is found ~ Captured an ash report within one minute.

Because the information is more targeted, we can clearly see that some queries and dml statements are running at the database level within that minute, some are scanned by the full table, and some are scanned by the index.

Top SQL with Top Events

SQL IDPlanhashSampled # of Executions % ActivityEvent % EventTop Row Source % RwSrcSQL Text

Fzn01wc5pg2dg1199754052215.67CPU + Wait for CPU11.75TABLE ACCESS-FULL11.75SELECT/* + ALL_ROWS USE_NL ("...

Db file sequential read2.61TABLE ACCESS-FULL2.61

Direct path read1.31TABLE ACCESS-FULL1.31

5q2mguqdcrq4a421773076112. 01db file sequential read12.01INDEX-RANGE SCAN7.05SELECT RE. L3_NET_START_TIME, R...

A793wrq0q27c5201265388110.70db file sequential read8.09DELETE8.09delete from RATED_EVENT WHERE...

CPU + Wait for CPU1.57DELETE1.57

Direct path read temp1.04DELETE1.04

496x3fkydc1xj8430599019. 92db file sequential read8.62INDEX-RANGE SCAN8.62 ** SQL Text Not Available **

CPU + Wait for CPU1.31INDEX-RANGE SCAN1.31

Dm1d93bw2jdzc2844259790278.09db file sequential read4.70INDEX-RANGE SCAN2.09select sk. rowid, sk. subscribe...

CPU + Wait for CPU3.39SELECT STATEMENT2.35

The statements for full table scan and DML statements are important.

Let's take a look at the statements for full table scan.

SELECT/* + ALL_ROWS USE_NL ("acw.control_hist") FULL ("acw.control_hist ")*/.... from "acw.control_hist" WHERE "CUR_PGM_NAME" = 'rgd 'AND "IDENTIFIER" =: 1

The statement outputs many fields, but there is only one related table. This table can be seen from the table name as a historical table, and the data volume is relatively large. view the statistics, the data volume is hundreds of millions of data records.

For such a large table, hint is used to specify full table scan, which is required in some places. You can check the index information with questions, and the primary key index starts with the IDENTIFIER Field.

From this point of view, this problem is a very obvious problem, because the use of Hint is improper, the query results of the index scan should have gone through the full table scan that consumes a lot of resources.

Of course, there is a saying in philosophy that it is reasonable to exist. In the early days, the data volume was not large, and it was necessary to scan the entire table, or this part of the logic is directly referenced from somewhere, and the hint has forgotten to change, resulting in such a problem.

When a problem occurs, there are also a variety of reasons to find the problem. Of course, this problem still happened in the end. It is more important to detect and fix it in time.

The analysis of this problem has come to an end, but the impact of dml on undo cannot be underestimated. for reference, the delete statement in the preceding table is used.

For this statement, delete involves a large partition table with more than million data records. On the premise of index-based scanning, data is cleaned up based on the timestamp. For this operation, we can consider that the current delete logic is correct. The delete operation will consume a large amount of undo resources without the impact of acw.control_hist full table scan. At this time, you also need to consider whether the current undo size fully meets the requirements of the system. Currently, the size of the undo in the database is about 17 GB, and several large partition tables are all over GB. If the time stamp specified for deletion is larger, the consumption of undo will be larger, therefore, you also need to consider the size of the undo. Based on the current situation, you can consider increasing the space of the undo.

Therefore, the analysis result of this problem is two suggestions. The first one is to improve the full table scan for the statements that should have been indexed, and standardize the use of hint. On the other hand, we recommend that you increase the size of the undo to meet the requirements of the system and increase the load of the system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.