Oracle Performance Analysis 2

Source: Internet
Author: User

Oracle Performance Analysis

Software Environment: Oracle 11g, dual-machine RAC.

Problem:

Large table (Tens) query, slow operation, often timeout terminal (ORA-01013: User request to cancel the current operation)

Analysis:

1) partition Table

2) Historical Data archive

Solve:

Adoption of Scenario 2).

  1. Create history tables,
  2. Create Table  as Select *  from where ...

    Deletes the table data. The amount of data is too large (7444741) can not be deleted directly, need to delete in bulk.

    Declare     cursorMyCursor is SELECTROWID from{TableName}WHERELtl_time<To_date ('2017-08-01','YYYY-MM-DD')Order  byrowID--------The cursor sorted by ROWID, the deletion condition is xxx=xxxx, according to the actual situation. Type Rowid_table_type is  Table   ofrowIDIndex  byPls_integer; V_rowid Rowid_table_type;BEGIN   OpenMyCursor; LoopFetchMyCursorBulkCollect intoV_rowid limit the;--------Each processing 5000 rows, that is, every 5000 lines of one commit     Exit  whenV_rowid.Count=0; ForAll IinchV_rowid.first. V_rowid.lastDelete  from{TableName} nologgingwhererowID=V_rowid (i); Commit; EndLoop; CloseMyCursor;END;

Oracle Performance Analysis 2

Related Article

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.