Test cache buffers chains in read-only mode of Oracle databases

Source: Internet
Author: User

OracleDatabase read-only modeCACHE BUFFERS CHAINSTesting is what we will introduce in this article. Although the read-only mode cache buffers chains is introduced from Oracle 9i, the cache buffers chains will still be requested when obtaining the buffer lock, but the situation is not as serious as 8i. Next we will test it.

The test procedure is as follows:

1. Create a table first.

 
 
  1. create table test (a int,b varchar2(20)); 

2. INSERT 50000 rows of data into the table;

 
 
  1. declare  
  2. i int;  
  3. begin  
  4. for i in 1..50000  
  5. loop  
  6. insert into test values(i,'adsfsafsa');  
  7. end loop;  
  8. end; 

3. Create an INDEX in the column;

 
 
  1. create index test_i on test(i); 

4. Compile a stored procedure and perform a large number of index scanning operations.

 
 
  1. create or replace procedure test_k is  
  2. begin  
  3. for i in (select /*+ INDEX(TEST TEST_I) */ * from test where a>20000)  
  4. loop  
  5. null;  
  6. end loop;  
  7. end; 

5. Open 2000 sessions to execute the stored procedure;

 
 
  1. var i number;  
  2. begin  
  3. for j in 1..2000  
  4. loop  
  5. dbms_job.submit(:i,'TEST_K;');  
  6. commit;  
  7. end loop;  
  8. end; 

6. the query waits for the event to find latch: cache buffers chains is very serious, and the CPU is running most of the time in SYS mode.

 
 
  1. Cpu(s): 16.3%us, 83.7%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st 

Conclusion:Even if the cache buffers chains LATCH obtained in read-only mode cannot completely solve the LATCH contention problem, the competition is not so serious.

This article introduces the knowledge about the cache buffers chains test in the read-only mode of Oracle databases. I hope this introduction will help you gain some benefits!

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.