Unused tables in the buffer cache

I have a program that queries the V$BH view every hour and stores the name of every table in the buffer cache. There is a set of tables that are never used which are appearing in the buffer cache every hour. I did a case insensitive search of the V$SQL and V$SQLTEXT views for these table names, but found nothing. How can tables be put in the buffer cache if there is no SQL statement refering to them? I'd like to find the session and program which is using these tables that no one is supposed to be using.
Kevin Tyson

This can be due to recursive SQL. Means the SQL not fired directly by the app but fired by oracle to satistfy some requirment. It can be related to some system tables or other users tables.
Example of system tables:
Oracle use system tables to reflect the current state of the database like when you insert records it update the extent information and when you create the object it update the data dictionary so that object reflect in that etc etc etc
Example of users tables:
you fired an insert statement to insert one record in table emp but to insert that record oracle has to check the state of foreign key data by querying dept and other tables so enev if you didn't specify dept table oracle use it internally to check the integrity constraint.
Daljit Singh

Similar Messages

  • 10G NEW FEATURE-HOW TO FLUSH THE BUFFER CACHE

    제품 : ORACLE SERVER
    작성날짜 : 2004-05-25
    10G NEW FEATURE-HOW TO FLUSH THE BUFFER CACHE
    ===============================================
    PURPOSE
    이 자료는 Oracle 10g new feature 로 manual 하게
    buffer cache 를 flush 할 수 있는 기능에 대하여 알아보도록 한다.
    Explanation
    Oracle 10g 에서 new feature 로 소개된 내용으로 SGA 내 buffer cache 의
    모든 data 를 command 수행으로 clear 할 수 있다.
    이 작업을 위해서는 "alter system" privileges 가 있어야 한다.
    Buffer cache flush 를 위한 command 는 다음과 같다.
    주의) 이 작업은 database performance 에 영향을 줄 수 있으므로 주의하여 사용하여야 한다.
    SQL > alter system flush buffer_cache;
    Example
    x$bh 를 query 하여 buffer cache 내 존재하는 정보를 확인한다.
    x$bh view 는 buffer cache headers 정보를 확인할 수 있는 view 이다.
    우선 test 로 table 을 생성하고 insert 를 수행하고
    x$bh 에서 barfil column(Relative file number of block) 과 file# 를 조회한다.
    1) Test table 생성
    SQL> Create table Test_buffer (a number)
    2 tablespace USERS;
    Table created.
    2) Test table 에 insert
    SQL> begin
    2 for i in 1..1000
    3 loop
    4 insert into test_buffer values (i);
    5 end loop;
    6 commit;
    7 end;
    8 /
    PL/SQL procedure successfully completed.
    3) Object_id 확인
    SQL> select OBJECT_id from dba_objects
    2 where object_name='TEST_BUFFER';
    OBJECT_ID
    42817
    4) x$bh 에서 buffer cache 내에 올라와 있는 DBARFIL(file number of block) 를 조회한다.
    SQL> select ts#,file#,dbarfil,dbablk,class,state,mode_held,obj
    2 from x$bh where obj= 42817;
    TS# FILE# DBARFIL DBABLK CLASS STATE MODE_HELD J
    9 23 23 1297 8 1 0 7
    9 23 23 1298 9 1 0 7
    9 23 23 1299 4 1 0 7
    9 23 23 1300 1 1 0 7
    9 23 23 1301 1 1 0 7
    9 23 23 1302 1 1 0 7
    9 23 23 1303 1 1 0 7
    9 23 23 1304 1 1 0 7
    8 rows selected.
    5) 다음과 같이 buffer cache 를 flush 하고 위 query 를 재수행한다.
    SQL > alter system flush buffer_cache ;
    SQL> select ts#,file#,dbarfil,dbablk,class,state,mode_held,obj
    2 from x$bh where obj= 42817;
    6) x$bh 에서 state column 이 0 인지 확인한다.
    0 은 free buffer 를 의미한다. flush 이후에 state 가 0 인지 확인함으로써
    flushing 이 command 를 통해 manual 하게 수행되었음을 확인할 수 있다.
    Reference Documents
    <NOTE. 251326.1>

    I am also having the same issue. Can this be addressed or does BEA provide 'almost'
    working code for the bargin price of $80k/cpu?
    "Prashanth " <[email protected]> wrote:
    >
    Hi ALL,
    I am using wl:cache tag for caching purpose. My reqmnt is such that I
    have to
    flush the cache based on user activity.
    I have tried all the combinations, but could not achieve the desired
    result.
    Can somebody guide me on how can we flush the cache??
    TIA, Prashanth Bhat.

  • Pinning blocks to the Buffer Cache

    Does any one remember how you can pin data buffers to the buffer cache so they don't get cycled out ? The shared pool has dbms_shared_pool.KEEP for library caches. I thought there was something like this for the buffer cache as well ? Can't find it.
    thx,
    RP.

    Does any one remember how you can pin data buffers to the buffer cache so they don't get cycled out ? The shared pool has dbms_shared_pool.KEEP for library caches. I thought there was something like this for the buffer cache as well ? Can't find it.
    thx,
    RP. Use ALTER TABLE <table_name> CACHE;
    and that will cache the table in the buffer pool. Or in the future (or if you recreate the table as CREATE TABLE . . . AS SELECT) the CACHE argument can be added to the CREATE TABLE statement;

  • " unable to allocate space from the buffer cache" Message

    Hi
    I am trying to delete a large volume or records from a BTREE database. I have used the DB_SET_RANGE with a cursor to locate the desired records. After that the Dbc::get() with DB_NEXT is called. After deleting a considerable amount of records I am receiving a message in the error callback function as "unable to allocate space from the buffer cache".
    What might be the reason for such a message.
    Regards
    Nisam

    Nisam,
    This means that the cache is full and there are no pages that BDB can evict to make space. Are you running with the default cache size? You can increase the cache size by calling: dbenv->set_cachesize or db->set_cachesize.
    Related docs:
    Selecting a cache size: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_conf/cachesize.html
    Bogdan Coman

  • In which table is the Live cache data stored?

    Hi experts,
       I am new APO .Can anyone let me know in which database table will the Live cache data be stored?
    Thanks in advance
    regards
    Ashwin.

    Hello Ashwin,
    the idea of the liveCache is to haev data permanently and quickly available without having to read/write from/to database. Therefore, the liveCache is <b>NOT</b> a physical database, it is a program in C++ that <i>simulates</i> a database and holds the data in the memory.
    However, it does need so called liveCache-anchors which are saved on the database, and which are similar to pointers.
    However, you can extract data from liveCache using BADIs or by creating a datasource on a planning area (for DP and SNP), manipulation can also be done only by BADIs or sophisticated programming (which basically uses RFCs).
    I hope this answers your question.
    Regards,
    Klaus

  • Understanding the buffer cache architecture

    1st Question :
    When we want to modify a single record in block ( which has multiple records), does the oracle process reads that particular record into the buffer cache or it will read the entire block into the buffer cache?
    2nd Question : Metalink note 62172.1 says --- The cache may hold more than one copy of a block from different points in time . Can some one explain me why it is architected in this manner.
    3rd Question : By increasing the pctfree , how can we over come the 'cache buffers chains' latch . How the less rows per block will reduce the contention to 'cache buffers chains' latch .
    Thanks
    Naveen
    Edited by: Naveen Sangam on Jul 15, 2009 8:07 AM

    Naveen Sangam wrote:
    1st Question :
    When we want to modify a single record in block ( which has multiple records), does the oracle process reads that particular record into the buffer cache or it will read the entire block into the buffer cache?It will be always a block by block access. That's why it is suggested that choose your block size properly so that you wont' waste the memory of the cache. Oh god, what did I just write :-) ?
    >
    2nd Question : Metalink note 62172.1 says --- The cache may hold more than one copy of a block from different points in time . Can some one explain me why it is architected in this manner.Yes, that's correct. This is the concept that makes Oracle, well Oracle. In Oracle. the isolation level is set to Read Committed which means, any dirty read wont' be allowed within oracle. So when you change a buffer and its still haven't got a commit, oracle would not let anyone else read the same buffer in its current state. This buffer's old image would be used by oracle to satisfy the read request of the user. For this, the concept of Multiversoning or Read Consitancy comes into the picture. For an dirty buffer, oralce prepares a Snapshot/Consistent Read(CR) buffer in the same hash bucket. This buffer is given to the user. That's why there can be more than one copy of the changed buffer be there in the cache , depending on the requests issued by the users.
    3rd Question : By increasing the pctfree , how can we over come the 'cache buffers chains' latch . How the less rows per block will reduce the contention to 'cache buffers chains' latch .I am not sure how did you make up this link? The only thing that ML note is saying that there should be less number of rows within a block so that a single block doesn't become a "hot spot" . The less number of rows, the less contention would be there over it. How did you link up this with the CBC Chain lathc?
    HTH
    Aman....

  • How to tune effectively to the buffer cache hit ratio?

    We have a database with following sga sizes;
    shared pool : 256 MB
    Buffer Cache: 880 MB
    Large pool: 32 MB
    Java pool: 32 MB
    Total SGA: 1201.435 mb. From the health check, i found Buffer Cache Hit Ratio is giving the trouble. so, i need advice from dba gurus, should Buffer Cache Hit ratio be increase or decreasee, in order to improve the performance?
    Please help me
    Ateeq

    I will generate statspack tommorrow morning when there will be lot of activity on the database. In the meantime, some output from Health check toad are:
    ->!Buffer Cache Hit Ratio : 82.3246
    -->[Segments with > 100 extents] Exec Time 1 seconds
    ! TABLE IN_CHIYODA.SPEC_REVISION_DOCUMENT_MAIN: 107 Extents
    ! TABLE EF2_DATA.N3RGRPRGRP: 126 Extents
    ! TABLE EF2_DATA.N3OBJATTR: 192 Extents
    ! TABLE EF2_DATA.EFT_UID: 119 Extents
    ! TABLE EF2_DATA.N2FILEOBJ: 121 Extents
    ! TABLE EF2_DATA.N2IFOBJ: 211 Extents
    ! TABLE EF2_DATA.N2REVGRP: 128 Extents
    ! INDEX EF2_DATA.N3OBJATTR_RLTLEFTRELINDEX: 122 Extents
    ! INDEX EF2_DATA.N3OBJATTR_RLTRIGHTRELINDEX: 114 Extents
    ! INDEX EF2_DATA.PK_N3OBJATTR: 119 Extents
    ! INDEX EF2_DATA.EFI_UID_N1UID: 120 Extents
    ! INDEX EF2_DATA.EFI_UID_N1OBJOBID: 103 Extents
    ! INDEX EF2_DATA.N1BOBJOBID_N2IFOBJ: 186 Extents
    ! INDEX EF2_DATA.N2IFOBJ_N1BOBJOBID: 159 Extents
    ! INDEX EF2_DATA.N2IFOBJ_N1NAME: 115 Extents
    ! INDEX EF2_DATA.PK_N2IFOBJ: 158 Extents
    ! INDEX EF2_DATA.N2IFOBJ_MYINDEX: 187 Extents
    Can you advice anthing based on these results.
    Thanks

  • Will Oracle look into the database buffer cache in this scenario?

    hi guys,
    say I have a table with a million rows, there are no indexes on it, and I did a
    select * from t where t.id=522,000.
    About 5 minutes later (while that particular (call it blockA) block is still in the database buffer cache) I do a
    select * from t where t.id >400,000 and t.id < 600,000
    Would Oracle still pick blockA up from the database buffer cache? if so, how? How would it know that that block is part of our query?
    thanks

    Without an Index, Oracle would have done a FullTableScan on the first query. The blocks would be very quickly aged out of the buffer cache as they have been retrieved for an FTS on a large table. It is unlikely that block 'A' would be in the buffer_cache after 5minutes.
    However, assuming that block 'A' is still in the buffer_cache, how does Oracle know that records for the second query are in block 'A' ? It doesn't. Oracle will attempt another FullTableScan for the second query -- even if, as in the first query -- the resultset returned is only 1 row.
    Now, if the table were indexed and rows were being retrieved via the Index, Oracle would use the ROWID to get the "DBA" (DataBlockAddress) and get the hash value of that DBA to identify the 'cache buffers chain' where the block is likely to be found. Oracle will make a read request if the block is not present in the expected location.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • How to clear file cache (or buffer cache?) in the system

    i found that after copying a large file, say >200M the system's memory drop 200M exactly until i delete the file. it is suspected that the memory is used for file cache.
    After installing memtool, the prtmem command shows the following:
    Total memory: 983 Megabytes
    Kernel Memory: 106 Megabytes
    Application: 193 Megabytes
    Executable & libs: 40 Megabytes
    File Cache: 495 Megabytes
    Free, file cache: 60 Megabytes
    Free, free: 87 Megabytes
    It shows that nearly 500M of system's memory is used for file cache.
    The temporary solution i use now is to copy a large file, say 300M, and delete that file.
    eg
    cp temp1.txt temp2.txt
    rm temp2.txtAnd then most of the file cache will be freed out.
    is there any way to release this file cache?
    I've checked the system use the default value for the bufhwm parameter. ie, about 20M. however, as i know, this bufhwm parameter is related to buffer cache. is it really related to file cache?

    To answer your question directly - delete the file or unmount the file system.
    To answer your question indirectly - You are worrying about the wrong thing here. Also the buffer cache is slightly different the file system page cache. The file system page cache is behaving exactly as it should as is the virtual memory subsystem. When a system is operating for some period of time, the amount of free memory will always drop towards LOTSFREE and, if allowed, stay right above LOTSFREE - forever - if the work behavior of the machine stays about the same. This is usually because of the file system page cache.
    Its nothing to worry about. Actually you want that to happen. Otherwise your disks would be getting the crap kicked out of them all the time.

  • Buffer cache hit ration found 99.7%,still the app users complains.

    Here in my database,i querey the v$sysstat and found the buffer cache hit ration 99.7% ,by looking that hit ration there is room improvements.
    what are the other things which can examine here ?
    hare krishna
    Alok

    As others have said, buffer cache hit ratio is only one of the measurements - and it is often improperly applied, making it worse than useless.
    Since this is in production,. it's too late to do anything about the design. So we skip that very important step and go to the SQL statements ...
    What are the users complaining about, in detail? Is it the system, or is it a specific operation? Use that knowledge to attempt to define a single SQL statement or a small set of SQL statements, and then start tuning those.
    The other possibility, seen A LOT these days, is that the app was written in Visual Basic, .Net or Java and uses the "build the statement on the fly and execute immediate" method. In that case, your server is probably sitting at very high CPU useage and your shared pool is used very inefficiently. Use the V$PGA_TARGET_ADVICE and V$SHARED_POOL_ADVICE views (described in the Administrator's manual and the Performance Tuning manual) to adjust these memory segments properly. All youi can do is alleviate the result of bad development.
    And finally, you may simply have gone into swapping or paging, the evil that occurs when you attempt to a) put multiple instances on a server, or b) put the instance and the application background tasks on the same server, or c) do not use PGA_AGGREGATE_TARGET properly.

  • How to create a temp table in the memory, not in disk?

    in sql server, you can create a temp table in the memory instead of disk,
    then you can do the insert, delete,update and select on it.
    after finishing, just release it.
    in Oracle,
    I am wonderfing how to create a temp table in the memory, not in disk?
    thanks,

    Thanks for rectifying me Howard.
    I just read your full article on this too and its very well explained here:
    http://www.dizwell.com/prod/node/357
    Few lines from your article
    It is true, of course, that since Version 8.0 Oracle has provided the ability to create a Keep Pool in the Buffer Cache, which certainly sounds like it can do the job... especially since that word 'keep' is used again. But a keep pool is merely a segregated part of the buffer cache, into which you direct blocks from particular tables (by creating them, or altering them, with the BUFFER POOL KEEP clause). So you can tuck the blocks from such tables out of the way, into their own part of the buffer cache... but that is not the same thing as guaranteeing they'll stay there. If you over-populate the Keep Pool, then its LRU mechanism will kick in and age its contents out just as efficiently as an unsegregated buffer cache would.
    Functionally, therefore, there can be no guarantees. The best you can do is create a sufficiently large Keep Pool, and then choose the tables that will use it with care such that they don’t swamp themselves, and start causing each other to age out back to disk.
    Thanks and Regards

  • Will I increase my Buffer Cache ?

    Oracle 9i
    Shared Pool 2112 Mb
    Buffer Cache 1728 Mb
    Large Pool 32Mb
    Java Pool 32 Mb
    Total 3907.358 Mb
    SGA Max Size 17011.494 Mb
    PGA
    Aggregate PGA Target 2450 Mb
    Current PGA Allocated 3286059 KB
    Maximum PGA Allocated (since Startup) 3462747 KB
    Cache Hit Percentage 98.71%
    The Buffer Cache Size advise is telling me that if I increase the Buffer Cache to 1930Mb i will get a 8.83 decrease in phyiscal reads (And its get better the more I increase it)
    The question is .. can I safely increase it (In light of my current memory allocations) ? Is it worth it .. ?

    Two things stand out:
    Your sga max size is 17Gb, but you are only using about 4Gb of it - so you seem to have 13Gb that you are not making best use of.
    Your pga aggregate target is 2.4Gb, but you've already hit a peak of 3.4Gb - which means your target may be too small - so it's lucky you had all that spare memory which hadn't gone into the SGA. Despite the availability of memory, some of your queries may have been rationed at run-time to try to minimise the excess demand.
    Is this OLTP or DSS - where do you really need the memory ? (Have a look in v$process to see the pga usage on a process by process level).
    How many processes are allowed to connect to the database ? (You ought to allow about 2Mb - 4Mb per process to the pga_aggregate_target for OLTP) and at least 1Mb per process for the buffer cache.
    Where do you see time lost ? time on disk I/O, or time on CPU ? What type of disk I/O, what's the nature of the CPU usage. These figures alone do not tell us what you should do with the spare memory you seem to have.
    A simple response to your original question would be that you probably need to increase the pga_aggregate_target, and you might as well increase the buffer size since you seem to have the memory for both.
    On the downside, changing the pga_aggregate_target could cause some execution plans to change; and changing the buffer size does change the limit size on a 'short' table, which can cause an increase in I/O as an unlucky side effect if you're a little heavy on "long" tablescans.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • How to setup a validation table in the IBM AS400 ?????

    I am trying to use the Java studio creator with the IBM AS400
    and I am having difficulty setting up a validation table.
    I created a totally new DB2 SQL table, with just a couple of columns.
    However, when I use it as the validation table to setup the Datasource, I get the following message:
    [SQL5016] Qualified object name PMABR not valid.
    The ideal validation table exists only for connection validation purposes. Do not use an existing table that has a large number of rows or a table that will be frequently accessed.
    any ideas?
    thanks a lot

    Thanks for rectifying me Howard.
    I just read your full article on this too and its very well explained here:
    http://www.dizwell.com/prod/node/357
    Few lines from your article
    It is true, of course, that since Version 8.0 Oracle has provided the ability to create a Keep Pool in the Buffer Cache, which certainly sounds like it can do the job... especially since that word 'keep' is used again. But a keep pool is merely a segregated part of the buffer cache, into which you direct blocks from particular tables (by creating them, or altering them, with the BUFFER POOL KEEP clause). So you can tuck the blocks from such tables out of the way, into their own part of the buffer cache... but that is not the same thing as guaranteeing they'll stay there. If you over-populate the Keep Pool, then its LRU mechanism will kick in and age its contents out just as efficiently as an unsegregated buffer cache would.
    Functionally, therefore, there can be no guarantees. The best you can do is create a sufficiently large Keep Pool, and then choose the tables that will use it with care such that they don’t swamp themselves, and start causing each other to age out back to disk.
    Thanks and Regards

  • Fiori Enhancment - BSP how to clear buffer/cache?

    Hi All,
    So I'm trying to make some enhancmenets to a Fiori app. I have downloaded it and reuploaded is as a new BSP application.
    I wanted to make some changes to the BSP, so I changed the code directly, in SAP.
    I thought I must be doing something wrong, but my changes weren't having any effect.
    To further test this I wrote some nonsense which should ahve broken it... but it still ran fine!
    To test further again I went to SICF and deactivated the node!! ANd it STILL worked fine!
    I opened new sessions in my browser, and new incognito windows, and closed it all and reopened it all, but it STILL works fine!
    There is clearly some kind of caching/buffering going on here, I've found the tables: O2PAGDIR and O2PAGDIRT have buffered values (found out this from ST02)
    But how do I clear it?! I turned buffering off in these tables, to see if that worked, and made another change, and tried to reload the table... but STILL the page loads with no changes.
    Please, can anyone tell me how to clear the buffer/cache that means that when I make UI chanegs in a BSP it doesn't show them?!
    Thank you
    Lindsay

    Hi Mauro,
    I overcame this issue in a variety of ways:
    Firstly, I do all the customisation of the BSP applications locally on my machine.
    Then I upload the whole BSP using the program /UI5/UI5_REPOSITORY_LOAD.
    In order to make sure the display you see in your browser is the up-to-date version, there are various cache clearing things you can do:
    Program /UI5/RESET_CACHEBUSTER - this has no UI, and takes only a second to run
    Transaction /UI5/THEME_TOOL : double click on "Invalidate Cache" to refresh the theme cache (if you have made theme changes)
    Then you have the two model caches mentioned above by Ashish - if you changes the Gateway service but aren't seeing these changes you should run these to ensure the model is up-to-date.
    Browser caches: make sure you browser cache is cleared: for Chrome this is easy: hit F12 (to get Dev toold open), clickk on the cog icon, and tick the box "Disable cache (while DevTootls is open)" - then keep devtools open while refreshing the page.
    The best way to enhance the BSP applications is locally on your machine, and do all your testing locally before uploading.
    I hope this helps, let me know how you get on.
    Lindsay

  • Flushing Database Buffer Cache

    I am trying out variants of a SQL statement in an attempt to tune it. Each variant involves joins across a different combination of tables, although some tables are common across all variants. In order to be able to do a valid comparison of the TKPROF outputs for the variants, I believe I need to flush the database buffer cache between variants so that the db block gets, consistent gets and physical reads parameters are true for each variant. By doing this, data retrieved for one variant is not already in the buffer cache for the next variant, thus not influencing the above parameters for the next variant.
    Is it possible to flush the buffer cache? The shared pool can be flushed with the ALTER SYSTEM FLUSH SHARED_POOL command. I've searched but have not been able to find an equivalent for the buffer cache. The NOCACHE option to the ALTER TABLE command only pushes retrieved data to the LRU list in the buffer cache, but does not remove it from the buffer cache.
    I'm hoping to be able to do this without bouncing the database between variants. It is a development instance, and I have it to myself after hours.

    Hi,
    I never tried this before, but if you want make a test you can try corrupt the block ID's returned by one of these queries below:
    Try corrupt the ID of the block containing the segment header
    select dbms_rowid.rowid_block_number(rowid) from hr.regions;
    Try corrupt one of the blocks returned by the query, which shows the ID of the block where each row is located
    select s.owner,t.ts#,s.header_file,s.header_block
    from
    v$tablespace t, dba_segments s
    where
    s.segment_name='REGIONS' and
    owner='HR' and
    t.name = s.tablespace_name;Legatti
    Cheers

Maybe you are looking for

  • Why has iTunes stopped recognising my iPod Classic?

    I have iTunes running on a 64-bit Windows 7 system. iTunes itself works fine, but when I hook up my iPod Classic 160gb, it doesn't recognise it. I get a message saying "The software required for communicating with the iPod is not installed correctly.

  • I need desperate help

    Hi guys I don't know what settings I pressed but now when I want to log in to my MacBook, it tells me I have to type my username and password. My username has an emoji on it and I cannot type it at all!!! So I can't access my MacBook. any idea how I

  • How do I connect to multiple computers remotely

    I have several Macs that are on an internal network, that I need to administer remotely. I can get to one of the computers as long as that computer is in the DMZ of the router, and all the appropriate port forwards are sent to that computer. How do I

  • Installation of Developer Workplace fails at Phase 11

    Hi, I'm trying to install the Developer Workplace 7.01 MaxDB on a Virtual Box instance running Windows XP SP2. The Virtual Machine has 1 GB of RAM and about 8 GB of free disk space. (The aim is to run a local version of the ISA Webshop. When installi

  • How much time does it take to build a website in muse?

    I would like to know how much time I will have to use in order to make my website from scratch. I already have the content (Images, Text, Organization) I would like it to be 10 pages. I have watched a lot of tutorials and have played with muse for a