Database buffer cache and library cache (order)

hi
after I issue:
select * from employees where employee_id=98
which one is performed by oracle first?
Oracle looks database buffer cache for any block it needs.
If block not found in database buffer cache ;server reads block from datafile and places copy in database buffer cache
OR
parse the sql and look in library cache for same execution plan ,.....

Hi Ricardinho
How does Oracle know which blocks it might need ? Does it need blocks from any indexes or does it only need blocks from a table ?
Do you think it even remotely likely that Oracle will somehow get all the blocks it needs first and then worry about determining an execution plan at some later point in time ?
Cheers
Richard Foote
http://richardfoote.wordpress.com/

Similar Messages

  • Database Change Notification and TopLink Cache Invalidation

    Has someone succeeed in implementing the How-to Database Change Notification and TopLink Cache Invalidation.
    I have corrected some document errata about the pl/sql content and I manage to have messages in the 'notify_queue'.
    I obtain the Topic in Java from this queue.
    But the TopicSuscriber instances do not receive any message. Is there something to have in mind to make it work ?
    Regards.

    Reviving this thread again...
    I am using DCN feature to build a middle-tier cache. I know oracle has problem sending physical rowid in case of 'Index Organized Table', however, in normal table also its not able to send proper rowid.
    e.g, I have 2 records in Table A with rowid AAARIUAAGAAAV/uABw and AAARIUAAGAAAV/pAAX.
    I have updated both the records. Strangely for the first record, oracle is sending INVALID rowid, although for the second record its sending the valid one.
    Following is the output:
    Row 1:  (Wrong rowid being sent, AAARIUAAGAAAV/uABw is replaced with AAARIUAAGAAAXDCAAr)
    Connection information  : local=localhost.localdomain/127.0.0.1:47633, remote=localhost.localdomain/127.0.0.1:2278
    Registration ID         : 2102
    Notification version    : 1
    Event type              : OBJCHANGE
    Database name           : <sid>
    Table Change Description (length=1)
        operation=[UPDATE], tableName=<table_name>, objectNumber=70164
        Row Change Description (length=1):
          ROW:  operation=UPDATE, ROWID=AAARIUAAGAAAXDCAAr
    Row 2:  (Right rowid being sent, AAARIUAAGAAAV/pAAX)
    Connection information  : local=localhost.localdomain/127.0.0.1:47633, remote=localhost.localdomain/127.0.0.1:2278
    Registration ID         : 2102
    Notification version    : 1
    Event type              : OBJCHANGE
    Database name           : <sid>
    Table Change Description (length=1)
        operation=[UPDATE], tableName=<table_name>, objectNumber=70164
        Row Change Description (length=1):
          ROW:  operation=UPDATE, ROWID=AAARIUAAGAAAV/pAAX
    Any idea ?

  • KM Cache and iView Cache - Pros and Cons

    Hi All,
    Can anyone tell me which Caching mechanism is better - KM Caching or iView Caching ?
    What are the Pros and Cons of KM Caching and iView Caching ? Which type of caching is recommended ?
    Any kind of help is appreciated.
    Regards,
    Adren

    Hi Adren,
    As to my understanding, with Portal Cache, we can achieve the following:
    1. Significant improvement in the interface response time
    2. Unnecessary, additional page generation (re-rendering) is avoided when you call a portal page
    3. Web browser-like caching for server-based, dynamic pages in the Web (such as the BW Application Web)
    Cache monitor to monitor the current status of all active caches in your system landscape. The data displayed in the cache monitor can be used for evaluations
    KM cache might eb better than Iview cache.
    Please check the below links we might get soem info about the type of cache which is preferable.
    http://help.sap.com/saphelp_nw04s/helpdata/en/1d/33863c68bebc2ce10000000a114027/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/57/29e334d0049967e10000009b38f83b/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b52de690-0201-0010-c5a6-b4bde0a12e44
    Hope this helps you.
    Good Luck!
    Regards,
    Shaila...

  • 先library cache pin还是先library cache lock??

    Question from Oracler:
    session1 给test 建主键
    session2 select test 出现library cache lock
    session3 select test 出现library cache pin
    不是说先获得library cache lock再library cache pin吗
    session1以exclusive模式获得 library cache lock
    session2 以shared模式请求 library cache lock ,session1未释放,所以session2 wait
    那session3 什么解释呢????

    as maclean answer:
    SQL> select * from V$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    session A  SQL> alter table maclean add a10 char(2000) default 'maclean';
    session B:  select 1 from maclean where rownum=1;      ==> hang here !
    session C:  select 1 from maclean where rownum=1;   ==> SAME SQL, hang here !
    SQL> select event from v$session where event like 'library%';
    EVENT
    library cache lock
    library cache pin
    session 4:
    SQL> oradebug setmypid;
    Statement processed.
    SQL> oradebug dump systemstate 266;
    Statement processed.
    SQL> oradebug tracefile_name;
    /s01/admin/G10R21/udump/g10r21_ora_6208.trc
        SO: 0x84f5b4a8, type: 4, owner: 0x84e5d4f8, flag: INIT/-/-/0x00
        (session) sid: 142 trans: (nil), creator: 0x84e5d4f8, flag: (41) USR/- BSY/-/-/-/-/-
                  DID: 0001-0010-00000027, short-term DID: 0000-0000-00000000
                  txn branch: (nil)
                  oct: 3, prv: 0, sql: 0x7bf10088, psql: 0x7bf582f0, user: 0/SYS
        O/S info: user: oracle, term: pts/1, ospid: 6159, machine: vrh8.oracle.com
                  program: [email protected] (TNS V1-V3)
        application name: [email protected] (TNS V1-V3), hash value=0
        waiting for 'library cache lock' blocking sess=0x(nil) seq=23 wait_time=0 seconds since wait started=17
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
        Dumping Session Wait History
         for 'library cache lock' count=1 wait_time=2149666
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930643
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930300
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930715
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930545
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2929985
    session 142 is  B  waiting for library cache lock
    the lock handle address is 7c3a5560
            SO: 0x8003b350, type: 53, owner: 0x84f98ba0, flag: INIT/-/-/0x00
            LIBRARY OBJECT LOCK: lock=8003b350 handle=7c3a5560 request=S
            call pin=(nil) session pin=(nil) hpc=0005 hlc=0000
            htl=0x8003b3d0[0x7d034330,0x7d034330] htb=0x7d034330 ssga=0x7e9f2168
            user=84f5b4a8 session=84f5b4a8 count=0 flags=RES/[0010] savepoint=0x1f9
            LIBRARY OBJECT HANDLE: handle=7c3a5560 mutex=0x7c3a5690(0)
            name=SYS.MACLEAN
            hash=458787ae49fd6f284ccb04a892b38231 timestamp=02-09-2012 21:32:36
            namespace=TABL flags=KGHP/TIM/SML/[02000000]
            kkkk-dddd-llll=0000-0701-0701 lock=X pin=X latch#=3 hpc=0006 hlc=0004
            lwt=0x7c3a5608[0x8003b380,0x8003b380] ltm=0x7c3a5618[0x7c3a5618,0x7c3a5618]
            pwt=0x7c3a55d0[0x7c3a55d0,0x7c3a55d0] ptm=0x7c3a55e0[0x7c3a55e0,0x7c3a55e0]
            ref=0x7c3a5638[0x7c3a5638,0x7c3a5638] lnd=0x7c3a5650[0x7bf75a18,0x7bf90650]
              LIBRARY OBJECT: object=7c1dec60
              type=TABL flags=EXS/LOC/UPD[0905] pflags=[0000] status=VALD load=0
              DATA BLOCKS:
              data#     heap  pointer    status pins change whr
                  0 7c3a54a0 7c1ded78 I/P/A/-/-    0 NONE   00
                  8 7c1de7f0 7e33ed48 I/P/A/-/-    1 UPDATE 00
                  9 7c1de8c0 7bf109e8 I/P/A/-/-    1 NONE   00
                 10 7c1de948 7bf10600 I/P/A/-/-    1 NONE   00
    关于session B的 library cache lock , 其原因是 add column 的session A 以 X mode lock SYS.MACLEAN, X mode pin  SYS.MACLEAN 且不释放, 所以session B的 library cache lock不用多解释
    session C:
        SO: 0x84f5dd18, type: 4, owner: 0x84e5dce0, flag: INIT/-/-/0x00
        (session) sid: 144 trans: (nil), creator: 0x84e5dce0, flag: (41) USR/- BSY/-/-/-/-/-
                  DID: 0001-0011-0000000A, short-term DID: 0000-0000-00000000
                  txn branch: (nil)
                  oct: 3, prv: 0, sql: 0x7bf10088, psql: 0x7bf582f0, user: 0/SYS
        O/S info: user: oracle, term: pts/2, ospid: 6183, machine: vrh8.oracle.com
                  program: [email protected] (TNS V1-V3)
        application name: [email protected] (TNS V1-V3), hash value=0
        waiting for 'library cache pin' blocking sess=0x(nil) seq=19 wait_time=0 seconds since wait started=17
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
        Dumping Session Wait History
         for 'library cache pin' count=1 wait_time=2568684
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2930677
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2929805
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2931420
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2930258
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
    session 144 is session C , waiting for library cache pin
    handle address 7bf46e40=>  指向 一个 child cursor namespace=CRSR, 而这个child cursor已经被 session B pin住了:
          SO: 0x7f03f890, type: 54, owner: 0x84f5dd18, flag: INIT/-/-/0x00
          LIBRARY OBJECT PIN: pin=7f03f890 handle=7bf46e40 request=S lock=0
          user=84f5dd18 session=84f5dd18 count=0 mask=0000 savepoint=0x3f flags=[00]
          SO: 0x7ec4cc80, type: 53, owner: 0x84f5dd18, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=7ec4cc80 handle=7bf46e40 mode=N
          call pin=(nil) session pin=(nil) hpc=0000 hlc=0000
          htl=0x7ec4cd00[0x7e449348,0x80c35108] htb=0x80c35108 ssga=0x80c34ff0
          user=84f5dd18 session=84f5dd18 count=1 flags=[0000] savepoint=0x0
          LIBRARY OBJECT HANDLE: handle=7bf46e40 mutex=0x7bf46f70(0)
          namespace=CRSR flags=RON/KGHP/PN0/[10010000]
          kkkk-dddd-llll=0000-0001-0000 lock=N pin=X latch#=3 hpc=0004 hlc=0004
          lwt=0x7bf46ee8[0x7bf46ee8,0x7bf46ee8] ltm=0x7bf46ef8[0x7bf46ef8,0x7bf46ef8]
          pwt=0x7bf46eb0[0x7f03f8c0,0x7f03f8c0] ptm=0x7bf46ec0[0x7bf46ec0,0x7bf46ec0]
          ref=0x7bf46f18[0x7bf7bfe0,0x7bf7bfe0] lnd=0x7bf46f30[0x7bf46f30,0x7bf46f30]
            LIBRARY OBJECT: object=7bf29018
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            READ ONLY DEPENDENCIES: count=1 size=16
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 7bf20060 7bf28ba8 I/P/A/-/-    0 NONE   00
                6 7bf77a20 7bf776f8 I/P/A/-/-    1 NONE   00
    我们可以找到 上面这个child cursor 的 parent cursor :
          SO: 0x7d03b620, type: 53, owner: 0x84f5b4a8, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=7d03b620 handle=7bf10088 mode=N
          call pin=(nil) session pin=(nil) hpc=0000 hlc=0000
          htl=0x7d03b6a0[0x7d034030,0x7c03c9f8] htb=0x7d034030 ssga=0x7e9f2168
          user=84f5b4a8 session=84f5b4a8 count=1 flags=[0000] savepoint=0x1f7
          LIBRARY OBJECT HANDLE: handle=7bf10088 mutex=0x7bf101b8(0)
          name=select 1 from maclean where rownum=1
          hash=324793c639b13d0954bd5421eaed6701 timestamp=03-08-2012 02:29:24
          namespace=CRSR flags=RON/KGHP/TIM/KEP/PN0/SML/DBN/[12010044]
          kkkk-dddd-llll=0001-0001-0001 lock=N pin=0 latch#=3 hpc=0004 hlc=0004
          lwt=0x7bf10130[0x7bf10130,0x7bf10130] ltm=0x7bf10140[0x7bf10140,0x7bf10140]
          pwt=0x7bf100f8[0x7bf100f8,0x7bf100f8] ptm=0x7bf10108[0x7bf10108,0x7bf10108]
          ref=0x7bf10160[0x7bf10160,0x7bf10160] lnd=0x7bf10178[0x82f4f2f8,0x7bf4d608]
            LIBRARY OBJECT: object=7bf7c8a8
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            CHILDREN: size=16
            child#    table reference   handle
                 0 7bf7c370  7bf7bfe0 7bf46e40                           => 只有一个child  handle 7bf46e40                          
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 7bf2a428 7bf7c9c0 I/P/A/-/-    0 NONE   00即在session B parse SQL "select 1 from maclean where rownum=1" 的时候, 会生成一个child cursor 并 X mode pin住这个child cursor , 而session C 同时发起 一样的SQL语句 "select 1 from maclean where rownum=1" 时 需要 share 这个child cursor , 即以 S mode pin 这个child cursor , 但是session B 还没有完成 optimize 没有生成完整的child cursor , 需要等待 session A 释放 library cache lock才能 完成, 所以 session C 要等 session B build child cursor , 此时session C等" library cache pin" ;
    如果 session C 执行的是不一样的SQL,那么 session C 不share 同一个child cursor , session C 会wait for library cache lock.
    since 10.2.0.3 "_kks_use_mutex_pin"=TRUE or 11g 开始 使用mutex 保护cursor pin ,所以 session C 若执行 与session B 一样的SQL,那么 wiat for cursor pin S on X
    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
    session A:
    SQL> alter table test add t11 char(2000) default 'maclean';
    session B:
    SQL> select * from test where rownum=1;
    session C:
    SQL> select * from test where rownum=1;
    SQL> select event from v$session where wait_class='Concurrency';
    EVENT
    cursor: pin S wait on X
    library cache lock
    SQL> oradebug setmypid;
    Statement processed.
    SQL> oradebug dump systemstate 266;
    Statement processed.
    session C:
    SO: 0x9e2256b8, type: 4, owner: 0x9e59a1c0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
    proc=0x9e59a1c0, name=session, file=ksu.h LINE:12624, pg=0
    (session) sid: 179 ser: 41307 trans: (nil), creator: 0x9e59a1c0
    flags: (0x41) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
    flags2: (0x40009) -/-/INC
    DID: , short-term DID:
    txn branch: (nil)
    oct: 3, prv: 0, sql: 0x956e18b8, psql: 0x956e18b8, user: 0/SYS
    ksuxds FALSE at location: 0
    service name: SYS$USERS
    client details:
    O/S info: user: oracle, term: pts/3, ospid: 26823
    machine: vrh1.oracle.com program: [email protected] (TNS V1-V3)
    application name: [email protected] (TNS V1-V3), hash value=1481565533
    Current Wait Stack:
    0: waiting for 'cursor: pin S wait on X'
    idn=0xe76d0d8c, value=0xca00000000, where=0x500000000
    wait_id=17 seq_num=18 snap_id=1
    wait times: snap=12.671273 sec, exc=12.671273 sec, total=12.671273 sec
    wait times: max=infinite, heur=12.671273 sec
    wait counts: calls=1148 os=1148
    in_wait=1 iflags=0x15b2
    There is at least one session blocking this session.
    Dumping 1 direct blocker(s):
    inst: 1, sid: 202, ser: 15511
    Dumping final blocker:
    inst: 1, sid: 9, ser: 1
    Wait State:
    fixed_waits=0 flags=0x22 boundary=(nil)/-1
    idn=0xe76d0d8c=> 这个是mutex的标示
    KGX Atomic Operation Log 0x94aa8ca8
    Mutex 0x8a328978(202, 0) idn e76d0d8c oper GET_SHRD
    Cursor Pin uid 179 efd 0 whr 5 slp 1148
    opr=2 pso=0x8b5a8c48 flg=0
    pcs=0x8a3288e0 nxt=(nil) flg=35 cld=1 hd=0x93d4bbb8 par=0x8a328048
    ct=1 hsh=0 unp=(nil) unn=0 hvl=8a328ef0 nhv=1 ses=0x9e1e0ea0
    hep=0x8a328978 flg=80 ld=1 ob=0x939a30b0 ptr=0x935e0348 fex=0x935df6f0
    这个mutex的 oper是 GET_SHRD 即 pin S 它指向 0x93d4bbb8 是一个child cursor
    以下是parent cursor:
    SO: 0x957fa9d8, type: 78, owner: 0x9e1e0ea0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
    proc=0x9e593da0, name=LIBRARY OBJECT LOCK, file=kgl.h LINE:8547, pg=0
    LibraryObjectLock: Address=0x957fa9d8 Handle=0x956e18b8 Mode=N CanBeBrokenCount=1 Incarnation=1 ExecutionCount=0
    User=0x9e1e0ea0 Session=0x9e1e0ea0 ReferenceCount=1 Flags=CNB/[0001] SavepointNum=4f5864b8
    LibraryHandle: Address=0x956e18b8 Hash=e76d0d8c LockMode=N PinMode=0 LoadLockMode=0 Status=VALD
    ObjectName: Name=select * from test where rownum=1
    FullHashValue=7e277fabf95d7c80e8924ed6e76d0d8c Namespace=SQL AREA(00) Type=CURSOR(00) Identifier=3882683788 OwnerIdn=0
    Statistics: InvalidationCount=1 ExecutionCount=2 LoadCount=3 ActiveLocks=2 TotalLockCount=4 TotalPinCount=1
    Counters: BrokenCount=1 RevocablePointer=1 KeepDependency=1 BucketInUse=3 HandleInUse=3 HandleReferenceCount=0
    Concurrency: DependencyMutex=0x956e1968(0, 2, 0, 0) Mutex=0x956e19e8(0, 45, 0, 0)
    Flags=RON/PIN/TIM/PN0/DBN/[10012841]
    WaitersLists:
    Lock=0x956e1948[0x956e1948,0x956e1948]
    Pin=0x956e1928[0x956e1928,0x956e1928]
    LoadLock=0x956e19a0[0x956e19a0,0x956e19a0]
    Timestamp: Current=03-08-2012 02:45:45
    HandleReference: Address=0x956e1a78 Handle=(nil) Flags=[00]
    LibraryObject: Address=0x8a327fa8 HeapMask=0000-0001-0001-0000 Flags=EXS[0000] Flags2=[0000] PublicFlags=[0000]
    ChildTable: size='16'
    Child: id='0' Table=0x8a328e58 Reference=0x8a3288b8 Handle=0x956db988
    Child: id='1' Table=0x8a328e58 Reference=0x8a328b80 Handle=0x93d4bbb8
    NamespaceDump:
    Parent Cursor: sql_id=fj4kfuvmqu3cc parent=0x8a328048 maxchild=2 plk=y ppn=n
    但是很可惜 0x93d4bbb8 这个 child cursor 被 session B pin住了:
    SO: 0x957fa8d8, type: 78, owner: 0x9e1e0ea0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
    proc=0x9e593da0, name=LIBRARY OBJECT LOCK, file=kgl.h LINE:8547, pg=0
    LibraryObjectLock: Address=0x957fa8d8 Handle=0x93d4bbb8 Mode=N CanBeBrokenCount=1 Incarnation=1 ExecutionCount=0
    ClusterLock=0x8f1945f8 Context=0x7fd379518308 User=0x9e1e0ea0 Session=0x9e1e0ea0 ReferenceCount=1
    Flags=CBK/[0020] SavepointNum=0
    LibraryHandle: Address=0x93d4bbb8 Hash=0 LockMode=N PinMode=X LoadLockMode=0 Status=VALD
    Name: Namespace=SQL AREA(00) Type=CURSOR(00)
    Statistics: InvalidationCount=0 ExecutionCount=0 LoadCount=1 ActiveLocks=2 TotalLockCount=2 TotalPinCount=3
    Counters: BrokenCount=1 RevocablePointer=1 KeepDependency=0 BucketInUse=0 HandleInUse=0 HandleReferenceCount=0
    Concurrency: DependencyMutex=0x93d4bc68(0, 0, 0, 0) Mutex=0x956e19e8(0, 45, 0, 0)
    Flags=RON/PIN/PN0/EXP/CHD/[10012111]
    WaitersLists:
    Lock=0x93d4bc48[0x93d4bc48,0x93d4bc48]
    Pin=0x93d4bc28[0x93d4bc28,0x93d4bc28]
    LoadLock=0x93d4bca0[0x93d4bca0,0x93d4bca0]
    LibraryObject: Address=0x939a30b0 HeapMask=0000-0001-0001-0000 Flags=EXS[0000] Flags2=[0000] PublicFlags=[0000]
    DataBlocks:
    Block: #='0' name=KGLH0^e76d0d8c pins=0 Change=NONE
    Heap=0x93d1a808 Pointer=0x939a3150 Extent=0x939a3030 Flags=I/-/P/A/-/-
    FreedLocation=0 Alloc=1.546875 Size=4.000000 LoadTime=4385736620
    Block: #='6' name=SQLA^e76d0d8c pins=0 Change=NONE
    Heap=0x8a328a20 Pointer=0x935e0348 Extent=0x935df6f0 Flags=I/-/P/A/-/E
    FreedLocation=0 Alloc=0.000000 Size=0.000000 LoadTime=0
    NamespaceDump:
    Child Cursor: Heap0=0x939a3150 Heap6=0x935e0348 Heap0 Load Time=03-08-2012 02:50:16 Heap6 Load
    PinMode=X
    保持这个 X mode pin的是另外一个 mutex , 这个mutex的 oper是 LONG_EXCL
    Time=03-08-2012 02:50:16 ----------------------------------------
    KGX Atomic Operation Log 0x8f1945f8
    Mutex 0x8a328978(202, 0) idn e76d0d8c oper LONG_EXCL
    Cursor Pin uid 202 efd 0 whr 1 slp 0
    opr=3 pso=0x957fa8d8 flg=0
    pcs=0x8a3288e0 nxt=(nil) flg=35 cld=1 hd=0x93d4bbb8 par=0x8a328048
    ct=1 hsh=0 unp=(nil) unn=0 hvl=8a328ef0 nhv=1 ses=0x9e1e0ea0
    hep=0x8a328978 flg=80 ld=1 ob=0x939a30b0 ptr=0x935e0348 fex=0x935df6f0

  • Data Cache and Generic Cache

    Hello,
    According to this document,
    http://download.oracle.com/docs/cd/B16240_01/doc/apirefs.102/e12639/chapter1.htm#CIAEFHFB
    I see there are two cache system in Oracle BI Server, "Data Cache" and "Generic Cache".
    What is the difference between these two kinds of cache ?
    Thanks.

    Hi user611881,
    I'll try to explain the two cache types here, but if someone can better phrase it than myself, by all means, step up.
    Data Cache:
    The OBIEE BI Server will cache the result set of SQL that is executed. These cached results are records and if OBIEE sees another report requesting the same record set that it already has in cache, it will go straight to the cache version instead of re-issuing the SQL
    Generic Cache:
    The generic cache is the presentation server cache. This has to do with the caching of particular request. If the BI Server detects a cached version of a request, it will get the request directly from the cache and not even go down to check for the cached record set.
    This is how they function. Assume you have report A with record set 1 and there's no data in either cache.
    You run Report A
    1) Presentation Service checks if the Request is in the generic cache.
    2) This check fails.
    3) Presentation service issues logical SQL query to BI Server
    4) BI Server checks if there is any record set matching the logical query in the cache
    5) This check fails.
    6) BI Server issues the physical SQL
    7) BI Server caches the result set
    8) Presentation service gets result set and formats the data
    9) Presentation service caches presentation results
    10) Report A is displayed
    That is my understanding of the Data and Generic Caches.
    Good luck and if you found this post useful, please award points!
    Best regards,
    -Joe

  • Unknown SQL eating CPU time and library cache locks

    Hello everyone,
    we are seeing a lot of activity when opening new connections to the database from PHP web server and the time is being spent on a SQL which in Enterprise manager is reported as UNKNOWN and selecting the GV$SQL view for this sql_id yields nothing, the SQL is not there. We do not have any logon triggers.
    I was wondering, if I know this SQL_ID (it's "c5brdpybgqss6"), can I see what it actually does? Can I trace it somehow?
    Our environment is:
    Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
    With the Real Application Clusters option
    Two RAC instances, running RedHat ES 5 64bit
    Clients are PHP, using oci8, using Instant Client 11.1.0.7
    Thanks for any ideas how to further analyze this,
    Michal.

    Unfortunately no, it is NULL (see below). I tried metalink, but I don't know what to search for. I'll probably have to file a ticket with the support.
    select username, sid, serial#, status, sql_id, prev_sql_id, event, seconds_in_wait
    from gv$session
    where sql_id='c5brdpybgqss6'
    order by username, sid, serial#;
    USERNAME SID SERIAL# STATUS SQL_ID PREV_SQL_ID EVENT SECONDS_IN_WAIT
    IMWC2 945 64434 ACTIVE c5brdpybgqss6 latch: shared pool 5
    IMWC2 1020 38821 ACTIVE c5brdpybgqss6 library cache lock 2
    973 7519 ACTIVE c5brdpybgqss6 class slave wait 0
    992 20 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1004 5 ACTIVE c5brdpybgqss6 EMON slave idle wait 5
    1006 1195 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1014 2635 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1020 2755 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1026 3967 ACTIVE c5brdpybgqss6 EMON slave idle wait 2
    1027 3039 ACTIVE c5brdpybgqss6 EMON slave idle wait 2
    1042 805 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1044 481 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1046 300 ACTIVE c5brdpybgqss6 EMON slave idle wait 1
    1053 2 ACTIVE c5brdpybgqss6 Streams AQ: waiting for time management or cleanup tasks 209637
    1055 8 ACTIVE c5brdpybgqss6 Streams AQ: emn coordinator idle wait 4
    1056 10 ACTIVE c5brdpybgqss6 Streams AQ: emn coordinator idle wait 0
    1059 6 ACTIVE c5brdpybgqss6 Streams AQ: waiting for time management or cleanup tasks 0

  • Forms/Reports: Role of the Database cache and Web cache

    Hello oracle experts,
    I am running a purely Forms and Reports based environment (9iAS).
    My question are:
    a. Is it possible to use features from the Web Cache and
    Database Cache to boost the performance of my applications?
    b. Are all components monitorable from the OEM?
    Please guide me so that i can configure my OEM to monitor my
    forms and reports services.
    thanks in advance for your reply
    Kind regards
    Yogeeraj

    Hi BradW,
    The way this is supposed to be done in Web Cache is by keeping separate copies of a cached page for different types of browsers distinguished by User-Agent header.
    In case of cache miss, Web Cache expects origin servers to return appropriate version of the page based on browser type, and the page from the origin server is just forwarded back to browser.
    Here, if the page is cacheable, Web Cache retains a separate copy for each type of User-Agent header value.
    And when there is a hit on this cached page, Web Cache returns the version of page with the User-Agent header that matches the request.
    Check out the config screen titled "Header Association" for this feature.
    About forwarding requests to different origin servers based on User-Agent header value, Web Cache does not have such capability.

  • Database buffer cashe and process

    Hi, gurus. Can't you help me to understand how buffer cashe works.
    Oracle 11g Concepts 8-3
    Before reading a data block into the cache, the process must first find a free buffer. The process searches the LRU list, starting at the least recently used end of the list. The process searches either until it finds a free buffer or until it has searched the threshold limit of buffers. If the user process finds a dirty buffer as it searches the LRU list, it moves that buffer to the write list and continues to search.
    When the process finds a free buffer, it reads the data block from disk into the buffer and moves the buffer to the MRU end of the LRU list.If an Oracle Database user process searches the threshold limit of buffers without finding a free buffer, the process stops searching the LRU list and signals the DBW0 background process to write some of the dirty buffers to disk.
    How is it posible to have a free buffer in LRU? Why a process searches the LRU? Can't it just point to the last buffer of the LRU? Suppose we have 100 buffers in buffer cashe, we loaded 100 before, than we need to load 101st one... we will take least recently used buffer and change it with the new one. Am I right?

    User644870 can certainly speak for him or herself, but his or her description of where new buffers get added to the LRU list is correct.
    Indeed, since I am laid up in bed with the 'flu, I have some leisure to consult old Oracle University course notes, and here's what the 9i Performance Tuning course notes (Chapter 5, page 3) have to say on the subject:
    The Least Recently Used list monitors the usage of buffers... Incoming blocks arecopied to a buffer from the least recently used end, which is then moved to the middle of the list. From here the buffer will works its way up or down the list depending on usage.
    I'd say from that that user 644870 has it just about right, and your assertion to the contrary is therefore wrong.
    Your description about 'as for the example of the link list of the blocks from 100 onwards' -well, your reply is not very coherent, so it's difficult to be sure, but items on the LRU list are not "immediately moved to one another list". There is a checkpoint queue which is indeed another linked list of buffer addresses, and for that queue, all those addresses are dirty. But things aren't "moved", physically, from the LRU list to the checkpoint queue. If your server process discovers buffer 100 is dirty when searching for a free buffer, it adds the address of buffer 100 to the checkpoint queue. It doesn't somehow 'remove' it from the LRU list at the same time.
    No-one said anything about "it is marked for being written in that list too", whatever that is supposed to mean. The example he or she gave was simply demonstrating that the last buffer on the LRU list is certainly the least recently used, but you can't know ahead of time whether that means it's available for re-use or not. Therefore, you have to search the LRU list until you find a free buffer, and hence there is a need to 'search the LRU list' which so perplexed the original poster.
    No-one, either, said anything about "the search in the LRU list is not completely done", so I don't know why you'd even mention it as if it were some sort of deficiency in the previous answer.
    Certainly, if you know the rules as to when DBWR flushes, you'll know that one of them is usually listed as 'when there are insufficient free buffers' -and the determinant of 'insufficient' is actually 'when you've been searching too long for one when inspecting the LRU list'.
    But the relevance of any of that to the question actually asked and the response actually given by user644870 is questionable, to say the least -and it merely confuses the issue to raise as 'deficiencies' thngs which are not actually relevant and which were not therefore mentioned originally.
    I find nothing wrong with the answer you felt the need to 'correct' or 'enhance', therefore.

  • How to - move ACR cache and LR cache and catalog

    Hi all,
    in the try of speeding things up a bit with my LR (v. 2.4 64 bit on Vista 64 SP2, E8650 proc and 8 GB RAM) I got an 2nd hand WD Raptor 150 GB 10K rpm, and I'd like to move there the ACR cache (around 60GB now) and the LR previews and catalogs (around 20 GB) . Which is the right and safer procedure to do that!? :-)
    Another question: my setting about File Handling are the following:
    1680 pixels as standards preview file size
    Preview quality Medium
    Never discard 1:1 preview size
    and in the grid mode (library) when I page down or up ... I always have the 3 white dots (of waiting) the pictures taken 3-4 secs go from fuzzy to sharp. How can I improve that time?
    Thanks to all who will answer :-)
    Have a nice day,
    gianluca

    There is nothing you can do to change the time that thumbnails to refresh. The fuzziness is normal while the three dots are visible and indicates that Lr is scanning the files within the Grid for external metadata or develop changes.
    To move the catalog and preview folder you simply drag (copy) it to the new drive, open the relocated folder and double click on the .lrcat (catalog) file. The double click operation will open Lightroom with the relocated catalog active.
    You can drag the ACR cache file to the new drive. However, to ensure Lightroom/Camera Raw use the correct ACR cache you will need to open Preferences>File Handling and point to the location that you want the cache files to be saved.
    Be aware that moving above folder is going to take a fair amount of time, albeit significantly less than rebuilding the cache and previews from scratch.

  • Load Cache and UnLoad Cache Problem

    Hi,
    I have inserted 150k Rows from TimesTen and it is been replicated successfully from TimesTen to my Oracle DB.I checked no of rows in TimesTen and Oracle ,showing same rows as 150K rows.
    AT Oracle End
    Count starts for me is from 2 so 153599 rows i will be getting 2 to 153600 rows
    SQL> Select Count(*) from oratt.test_rep;
    COUNT(*)
    153599
    SQL> Select Col108 from oratt.test_rep where Col108=153600;
    COL108
    153600
    SQL> Update oratt.test_rep set Col108=Col108+1 where Col108=153600;
    1 row updated.
    SQL> Select Col108 from oratt.test_rep where Col108=153600;
    no rows selected
    SQL> Select Col108 from oratt.test_rep where Col108=153601;
    COL108
    153601
    AT TimesTen End
    Command> UNLOAD CACHE GROUP CACHEADMIN.TESTCACHE;
    Command> LOAD CACHE GROUP CACHEADMIN.TESTCACHE COMMIT every 1000 Rows;
    153599 cache instances affected.
    Command> Select Col108 from oratt.test_rep where Col108=153600;
    < 153600 >
    1 row found.
    Command> Select Col108 from oratt.test_rep where Col108=153601;
    5213: Bad Oracle login error in OCISessionBegin(): ORA-01017: invalid username/password; logon denied rc = -1
    5131: Cannot connect to backend database: OracleNetServiceName = "MYDB", uid = "Userid", pwd is hidden, TNS_ADMIN = "", ORACLE_HOME= ""
    5109: Cache Connect general error: BDB connection not open.
    0 rows found.
    The command failed.
    Command> cachegroups;
    Cache Group CACHEADMIN.TESTCACHE:
    Cache Group Type: Asynchronous Writethrough (Dynamic)
    Autorefresh: No
    Aging: LRU on
    Root Table: ORATT.TEST_REP
    Table Type: Propagate
    Why i am getting this error i have update my row in Oracle but it is not LOADED in TimesTen, the old value is there in TimesTen .
    Thanks!

    This is a dynamic cache group so when you run a dynamic load capable statement such as this Select Col108 from oratt.test_rep where Col108=*153600;* (presumably Col108 is a key? column) then if there are no matching rows in TiemsTen, TimesTen will attempt to go to oracle to fetch the row(s). These rows will then be inserted into the Tt cache (for future access) as well as being returned to the application. The error occurs because your ttIsql session does not have correct credentials for Orcle (maybe you omitted the OraclePWD= attribute when you connected to ttIsql?).
    If you do not want/need this dynamic load behaviour then you should create the cache group as a non-dynamic cache group.
    With regard to your question about bi-directional cache groups, no we do not support those. If you do change data in the Oracle table which is cached by executing DML against it directly in Oracle then those changes may get overwritten by later changes propagated from TimesTen. If your workload is partitioned so that different sets of rows are updated in Oracle versus TimesTen then that is okay of course. Any updates made in Oracle will not automatically be propagated to TimesTen. You can manually refresh the cache group to pick up any new data if you want to.
    Chris

  • How can we change the state of records in view cache and entity cache

    Hi everybody,
    I am trying to achieve selective rollback, or selective commit. By this I mean that I am looking for a way to change the state of rows in view cache, so that the selective changed rows can be rolled back during comit.
    if anyone has tried anything in this please help me.

    I agree!
    I can't top this approach.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Sessions hangs with library cache lock

    Der all,
    11.1.0.7 rac on solaris 10
    Our workflow session yesterday hanged on a particular step the session was waiting on a library cache lock (by using query select event,p1,p2 from v$session where sid=<my_sid>;)
    when I checked the blocking session , using the note 122793.1 and http://oracle-study-notes.blogspot.com/2009/05/resolving-library-cache-lock-issue.html and http://oracle-study-notes.blogspot.com/2009/05/find-session-holding-library-cache-lock.html .
    I found that
    SQL> SELECT SID,USERNAME,TERMINAL,PROGRAM FROM V$SESSION
      2   WHERE SADDR in
      3    (SELECT KGLLKSES FROM X$KGLLK LOCK_A
      4     WHERE KGLLKREQ > 0
      5       AND EXISTS (SELECT LOCK_B.KGLLKHDL FROM X$KGLLK LOCK_B
                     WHERE KGLLKSES = '&SADDR_OF_BLKING_SESS'
      6    7                   AND LOCK_A.KGLLKHDL = LOCK_B.KGLLKHDL
      8                   AND KGLLKREQ = 0)
      9    );
    Enter value for saddr_of_blking_sess: 0000000770E494E0
    old   6:                  WHERE KGLLKSES = '&SADDR_OF_BLKING_SESS'
    new   6:                  WHERE KGLLKSES = '0000000770E494E0'
      SID USERNAME        TERMINAL   PROGRAM
      817 SYS             UNKNOWN    oracle@tabsdb07
                                      (J002)
      828 SYS             UNKNOWN    oracle@tabsdb07
                                      (J001)after killing the session, the library cache locks still remained.when I ran trace on the session
    select /*+ all_rows ordered */ A.rowid, :1, :2, :3
    from
    "DBMRPT"."DBM_BIAUTO_SUSP" A , "DBMRPT"."DBM_CDR_FILE_HEAD" B where(
      "A"."CDR_TYPE" is not null and "A"."FILE_ID" is not null) and(
      "B"."CDR_TYPE" (+)= "A"."CDR_TYPE" and "B"."FILE_ID" (+)= "A"."FILE_ID")
      and( "B"."CDR_TYPE" is null or "B"."FILE_ID" is null)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.01          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.01       0.01          0          0          0           0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: SYS   (recursive depth: 3)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      row cache lock                                  5        0.00          0.00
      db file sequential read                   295932636        0.07       5066.63
      gc cr grant 2-way                          727813        0.02        233.95
      latch: gc element                              80        0.00          0.00
      latch: gcs resource hash                      870        0.00          0.00
      latch free                                      2        0.00          0.00
      gc remaster                                     9        2.00         12.91
      gcs drm freeze in enter server mode             9        0.54          2.08
      latch: object queue header operation           66        0.00          0.05
      latch: cache buffers chains                    15        0.03          0.20
      resmgr:internal state change                   63        0.10          5.30
      latch: cache buffers lru chain               1260        0.00          0.01
    ********************************************************************************Please guide
    Kai
    all this time sql_id for the session remanined in the sql :
    ALTER TABLE DBMRPT.DBM_BIAUTO_SUSP ENABLE CONSTRAINT DBS1_DCFH_FK ..

    hi..
    Go through [http://orainternals.wordpress.com/2009/06/02/library-cache-lock-and-library-cache-pin-waits/]
    Anand

  • High CPU load with Library Cache Pin wit event.

    Oracle8i Enterprise Edition Release 8.1.6.0.0, 64 bit - Production
    HP-UX B.11.00 U 9000/800 605309363 unlimited-user license
    Currently CPU load is 100% with very less sessions in the database.
    But i am finding Library Cache Pin wait event in top.
    If i query v$latchholder i am not getting any rows..and in v$lacth_children
    SQL> select SID,EVENT,WAIT_TIME,SECONDS_IN_WAIT,STATE from v$session_wait where EVENT='library cache pin';
           SID EVENT                                     WAIT_TIME SECONDS_IN_WAIT STATE
             8 library cache pin                                 0             863 WAITING
            90 library cache pin                                 0            3093 WAITING
            89 library cache pin                                 0            2566 WAITING
            57 library cache pin                                 0           27384 WAITING
            54 library cache pin                                 0           21029 WAITING
            53 library cache pin                                 0            7840 WAITING
            50 library cache pin                                 0            2620 WAITING
            47 library cache pin                                 0            6031 WAITING
            46 library cache pin                                 0            1241 WAITING
            41 library cache pin                                 0           15637 WAITING
           145 library cache pin                                 0             910 WAITING
           133 library cache pin                                 0            5124 WAITING
           111 library cache pin                                 0           15077 WAITING
            98 library cache pin                                 0            6563 WAITING
            94 library cache pin                                 0            2088 WAITING
            93 library cache pin                                 0            4592 WAITING
            92 library cache pin                                 0           14705 WAITING
            91 library cache pin                                 0           14798 WAITING
            36 library cache pin                                 0            1533 WAITING
            33 library cache pin                                 0            1491 WAITING
            28 library cache pin                                 0           13970 WAITING
            25 library cache pin                                 0            7630 WAITING
            11 library cache pin                                 0           12169 WAITING
            12 library cache pin                                 0            2352 WAITING
            14 library cache pin                                 0           19748 WAITING
    SQL> select addr,name from v$latch where name='library cache';
    ADDR             NAME
    C00000006971D460 library cache
    SQL> select latch#,name from v$latch_children where name='library cache';
        LATCH# NAME
           105 library cache
           105 library cache
           105 library cache
           105 library cache
           105 library cachePlease help me out to find actual cause of these latches and fix ?
    -Yasser

    bump
    No-one?
    The problem seems to have 'resolved itself' over the weekend incidentally (although I don't believe anything truly resolves itself in this manner - something must have changed).

  • Delta refresh and complete cache refresh

    Hi,
    iam doing the complete cache refresh and delta cache refresh in my scenario. after doing that the data's are reflecting very slowly in the RWB valuemapping cache.
    sometimes it is not reflecting in the RWB valuemapping cache.
    i refreshed the CPI cache and SLD cache, still it is not reflecting in the RWB.
    could anyone tell me the solution for this to reflect in the RWB valuemapping cache????
    Regards
    sasi

    Hi,
    In the component monitoring check the RWB component and check the performance monitoring, may be some times performance monitoring is low because of the payload or some other conditions.
    Delta Cache Refresh: Any new objects that have been created/modified during the design/configuration
                          activities are inserted into the temporary database tables when we use delta
                          cache refresh option.(Partial process refresh)
    Complete Cache Refresh: All entries in temporary cache tables are deleted and a background program
                              for inserting the complete information about all the design/configuration
                              objects.(whole process refresh)

  • Premiere Pro CC and Media Cache

    Hello!
    I've read the documentation on Media Cache (http://help.adobe.com/en_US/premierepro/cs/using/WSF08BCDDB-FCD7-40a2-8290-8872EE725E6B.ht ml#WSa41b87baf39dd9b0-4a7aee25125bce32690-8000) but I didn't understandt what are exactly the formats/containers that Premiere Pro creates cache for?
    Also, am I remembering wrong, but was in Premiere Pro CS 5.5 and CS 6 the cache for the project was kept in the same folder as the project?
    Does Premiere clean the Media Cache regularly or I have to remember to do it from time to time?

    I don't think that much has changed regarding the treatment of cache files from CS5 to CS6 to CC.
    Here's how I manage the cache files:
    1) Set Premiere to store media cache and media cache database in a drive folder separate from your project files (use menu: Edit / Preferences / Media and then browse to where you want them - I use "X:\premiere_cache"). This way, when you back up projects you are not backing all of this stuff up too.
    2) They do not clean up for themselves - go to the same panel mentioned in #1 and click the "clean" button to remove all of the files. When Premiere Pro is closed, you can manually delete all of the folders created by Premiere and you will not destroy anything that is recoverable.
    The purpose of cache files is to prepare some files additional your projects and media for performance enhancing reasons.
    Regards,
    Jim

Maybe you are looking for