Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

351

积分

0

好友

8

主题
1#
发表于 2012-5-19 15:06:01 | 查看: 3853| 回复: 1
“MUTEX替代LIBRARY CACHE的另外一个好处是MUTEX的实用方法和LATCH是不同的,MUTEX可以嵌入在一些其他的结构中使用,比如说嵌入在KGH结构中。比如说CURSOR STAT,以往在使用LIBRARY CACHE PIN的时候,一个闩锁要维护一组对象(比如一组HASH BUCKET),而MUTEX是嵌入到对象内部的,因此一个MUTEX仅仅保护一个特定的对象,这也大大提高了MUTEX并发使用的效率。”


这段文字是在老白的网站上看到的,意思是说mutex存在于library cache handle、library cache object、heap0、heap6等内存结构中吗?
2#
发表于 2012-6-4 23:47:31
ODM TEST:

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

SQL>
SQL> oradebug setmypid;
Statement processed.
SQL> oradebug dump systemstate 266;
Statement processed.
SQL> oradebug dump library_cache 10;
Statement processed.
SQL> oradebug tracefile_name
/s01/orabase/diag/rdbms/vprod/VPROD1/trace/VPROD1_ora_6251.trc



      SO: 0xb48b2d88, type: 78, owner: 0xbd881fe8, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
       proc=0xbd509290, name=LIBRARY OBJECT LOCK, file=kgl.h LINE:8547, pg=0

      LibraryObjectLock:  Address=0xb48b2d88 Handle=0xb46bdbe0 Mode=N CanBeBrokenCount=1 Incarnation=1 ExecutionCount=6

        User=0xbd881fe8 Session=0xbd83a828 ReferenceCount=1 Flags=CNB/[0001] SavepointNum=4fccd55d
      LibraryHandle:  Address=0xb46bdbe0 Hash=535d1a6c LockMode=N PinMode=0 LoadLockMode=0 Status=VALD
        ObjectName:  Name=select text from view$ where rowid=:1
          FullHashValue=f0cfa2e63e1fda46fbf3cdf9535d1a6c Namespace=SQL AREA(00) Type=CURSOR(00) Identifier=1398610540 OwnerIdn=0
        Statistics:  InvalidationCount=1 ExecutionCount=31 LoadCount=3 ActiveLocks=2 TotalLockCount=9 TotalPinCount=1
        Counters:  BrokenCount=1 RevocablePointer=1 KeepDependency=1 BucketInUse=8 HandleInUse=8 HandleReferenceCount=0
        Concurrency:  DependencyMutex=0xb46bdc90(0, 1, 0, 0) Mutex=0xb46bdd10(0, 71, 0, 0)
        Flags=RON/PIN/TIM/PN0/DBN/[10012841]
        WaitersLists:
          Lock=0xb46bdc70[0xb46bdc70,0xb46bdc70]
          Pin=0xb46bdc50[0xb46bdc50,0xb46bdc50]
          LoadLock=0xb46bdcc8[0xb46bdcc8,0xb46bdcc8]
        Timestamp:  Current=06-04-2012 11:33:17
        HandleReference:  Address=0xb46bdda0 Handle=(nil) Flags=[00]
        LibraryObject:  Address=0xb46b9680 HeapMask=0000-0001-0001-0000 Flags=EXS[0000] Flags2=[0000] PublicFlags=[0000]
          ChildTable:  size='16'
            Child:  id='0' Table=0xb46ba530 Reference=0xb46b9f68 Handle=0xb46b9290
        NamespaceDump:
          Parent Cursor:  sql_id=grwydz59pu6mc parent=0xb46b9720 maxchild=1 plk=y ppn=n




Bucket: #=72300 Mutex=0xb8d61858(0, 14, 0, 6)
  LibraryHandle:  Address=0xb46bdbe0 Hash=535d1a6c LockMode=N PinMode=0 LoadLockMode=0 Status=VALD
    ObjectName:  Name=select text from view$ where rowid=:1
      FullHashValue=f0cfa2e63e1fda46fbf3cdf9535d1a6c Namespace=SQL AREA(00) Type=CURSOR(00) Identifier=1398610540 OwnerIdn=0
    Statistics:  InvalidationCount=1 ExecutionCount=31 LoadCount=3 ActiveLocks=2 TotalLockCount=9 TotalPinCount=1
    Counters:  BrokenCount=1 RevocablePointer=1 KeepDependency=1 BucketInUse=8 HandleInUse=8 HandleReferenceCount=0
    Concurrency:  DependencyMutex=0xb46bdc90(0, 1, 0, 0) Mutex=0xb46bdd10(29, 72, 0, 6)
    Flags=RON/PIN/TIM/PN0/DBN/[10012841]
    WaitersLists:
      Lock=0xb46bdc70[0xb46bdc70,0xb46bdc70]
      Pin=0xb46bdc50[0xb46bdc50,0xb46bdc50]
      LoadLock=0xb46bdcc8[0xb46bdcc8,0xb46bdcc8]
    Timestamp:  Current=06-04-2012 11:33:17
    HandleReference:  Address=0xb46bdda0 Handle=(nil) Flags=[00]
    ReferenceList:
      Reference:  Address=0xb46b7250 Handle=0xb46b7fb0 Flags=ROD[21]
    LibraryObject:  Address=0xb46b9680 HeapMask=0000-0001-0001-0000 Flags=EXS[0000] Flags2=[0000] PublicFlags=[0000]
      DataBlocks:
        Block:  #='0' name=KGLH0^535d1a6c pins=0 Change=NONE
          Heap=0xb46ba638 Pointer=0xb46b9720 Extent=0xb46b9600 Flags=I/-/P/A/-/-
          FreedLocation=0 Alloc=2.460938 Size=3.976562 LoadTime=4295548730
      ChildTable:  size='16'
        Child:  id='0' Table=0xb46ba530 Reference=0xb46b9f68 Handle=0xb46b9290
    NamespaceDump:
      Parent Cursor:  sql_id=grwydz59pu6mc parent=0xb46b9720 maxchild=1 plk=y ppn=n


MUTEX 可以被嵌入到多种其他结构中 ,以上我们看到多个 mutex

其中 DependencyMutex=0xb46bdc90(0, 1, 0, 0)  被嵌入在 LibraryHandle中
Mutex=0xb8d61858(0, 14, 0, 6) 被嵌入在 library cache hash bucket中

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-26 00:52 , Processed in 0.046540 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569