Reproduce the library cache lock wait event under Oracle 11g

Source: Internet
Author: User

As you can see from the following example, the recompilation of objects in the production database causes the library cache lock, so you should try to avoid compiling objects during peak business hours. If there is a complex dependency in the package or process, it is very easy to cause the library cache lock to appear, so in the process of application development, should also pay attention to this aspect of the problem.

Session1:

Sql> select * from V$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
PL/SQL Release 11.2.0.1.0-production
CORE 11.2.0.1.0 Production
TNS for Linux:version 11.2.0.1.0-production
Nlsrtl Version 11.2.0.1.0-production

sql> Create or replace procedure pining

Is
Begin
Null
End
/
sql> Create or replace procedure calling
Is
Begin
pining;
Dbms_lock.sleep (200);
End

/

Session2:

Alter procedure pining compile;

Session3:

drop procedure pining;

Session4:

sql> Select Sid, Event,wait_class, seconds_in_wait
2 from V$session_wait W
3 where W.wait_class <> ' Idle ';
SID EVENT Wait_class
---------- ---------------------------------------------------------------- ----------------
6 Library Cache Lock Concurrency
Library Cache Pin Concurrency
191 sql*net message to client Network

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.