Proving that sequence is cached in SGA

Hello,
I spent all day researching this yesterday without an answer - the information must be out there somewhere but I can't find it!
We know that when a sequence is created with CACHE 20 the values are generated 20 at a time and stored in the SGA. We also know that Oracle may choose to age these values out of SGA if the sequence is infrequently used (and for other reasons too).
I am trying to understand how to prove that a set of values is currently being cached for a particular sequence. I expect to be able to see a difference somewhere in memory between a sequence with CACHE 20 and a sequence created with NOCACHE - this is reproduceable. I also wish to be able to prove whether or not a sequence created with the CACHE option has been aged out of the SGA (this is more difficult to reproduce).
I looked in v$bh but this does not seem to contain sequences (I believe they are cached in library cache since Oracle 8?).
V$db_object_cache seems to contain a row for the sequence regardless or whether it was created with the CACHE option and there does not seem to be a pattern in the value of SHARABLE_MEM.
There are views available to see the contents of the buffer cache right down to the block level - is there something similar for the pool which contains sequences?
Thanks.

Hi Dom,
I'm hoping to write a script which I can run for a current point in time snapshot, rather than something I need to configure and monitor.
For example I use v$bh to see the buffer cache contents (right down to block level if necessary). I just assume there must be a data dictionary view somewhere that will contain a row for the sequence if it has values cached in the library and no row if there are no values cached.
I am assuming that the information is in the dictionary somewhere and I just don't know where to look, but perhaps it isn't there at all. Oracle internals can obviously track whether it needs to get nextval from memory or via a latch to disk but perhaps this information hasn't been opened up for us to see.

Similar Messages

  • How much data canbe cache in SGA

    Hai everybody,
    my company using Oracle 11g 11.2.0.1.0 - Production database, my os is RHEL 5.5 ,my server's physical memory is 30.9 GB ( cat /proc/meminfo ) ie the SGA size [ (30.9*40/100)=12.5 GB ] so i use 12.5GB SGA size for one instance, we need to cache some data for our application performance how much data can cache in SGA based on 12.5 GB or how to calculate how much data can cache in SGA without any performance degradation.
    Regards Benk

    Aman has it right. WHY?
    the keep pool, alter table cache, etc - I would not be doing ANY of these without a good reason.
    Often times, people think that forcing a table to stay in the cache is a good idea. It rarely is. If you want things in the cache, use them. If they are used, they will naturally have their blocks cached. If you don't use them, they can get flushed out. But if you don't use them, why do you want them using memory that could better be used by other things?
    My advice: don't try to second-guess Oracle's memory management and caching strategy. If you think you have a reason to, post it here and we can help you (or debunk your reason). Based on the fact that you've apparently calculated the SGA using that silly, meaningless "rule" that says give it 40% of your total RAM, I'd guess that you are looking around for a magic bullet, and you don't actually have a problem to solve.
    John

  • Sequence and Cache

    I created a sequence:
    SQL> create sequence s
    increment by 1
    start with 1;
    then,
    SQL> select s.nextval from dual;
    1
    SQL> select s.nextval from dual;
    2
    it works fine.
    But when I shutdown my Windows2000 Server (where Oracle 9i is installed) and restart it again...
    SQL> select s.nextval from dual;
    32
    The default cache for sequence is 20.
    After reboot, the cahched sequence number are lost!
    Is there any way to keep the cached sequence number after reboot?
    What if I do the following: "SQL> alter sequence s cache 0; " ???
    What if the side-effect if I set the cache to 0 ??? Do you suggest to set it to zero ?
    thank you very much.
    Chu Ka Keong

    Just to elaborate a bit on Don's post.
    If you want to minimize the number of holes in a sequence, you must use the NOCACHE option when creating the sequence (or alter it that way). Be aware that this will NOT eliminate holes in the sequence. Any transaction that gets a value from the the sequence, and then rolls back, or otherwise does not write to the table, will "waste" a sequence number.
    Having said that, who really cares. The only, and I emphasise only, use for a sequence is to generate a guaranteed unique number for some purpose, either an ID, or a sequential number to make an otherwise duplicated key unique. Personally, I see absolutely no reason for a sequence in the second case.
    If you expect multiple users, and frequent "hits" to your sequence, use a big cache (I have some that cache 500) and damm the holes.

  • [svn:fx-trunk] 5839: * Removed the logic that tracked when cached SWC had been removed from

    Revision: 5839
    Author: [email protected]
    Date: 2009-04-01 10:34:31 -0700 (Wed, 01 Apr 2009)
    Log Message:
    * Removed the logic that tracked when cached SWC had been removed from
    the library path, because it wasn't working correctly in some cases
    and it is no longer necessary due to revision 5524.
    tests Passed: checkintests, performance testsuite, FlexBuilder
    outputFolder JUnit tests
    Needs QA: YES
    Needs DOC: NO
    API Change: NO
    Reviewer: Pete F.
    Code-level description of changes:
    CompilerSwcContext.java
    Removed updateRemovedSources() and it's usage.
    CompilerAPI.java
    Removed deleteRemovedSwcSources(), renamed
    deleteObsoletedSwcSources() to reportObsoletedSwcSources(), and
    deleteShadowedSwcSources() to reportShadowedSwcSources().
    Updated validateCompilationUnits() to no longer report
    DependentFileNoLongerExists.
    SwcCache.java
    Removed "removed" and "updated" variables, their getters, and the
    code that initialized them.
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerAPI.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerSwcContext.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcCache.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcGroup.java

    Revision: 5839
    Author: [email protected]
    Date: 2009-04-01 10:34:31 -0700 (Wed, 01 Apr 2009)
    Log Message:
    * Removed the logic that tracked when cached SWC had been removed from
    the library path, because it wasn't working correctly in some cases
    and it is no longer necessary due to revision 5524.
    tests Passed: checkintests, performance testsuite, FlexBuilder
    outputFolder JUnit tests
    Needs QA: YES
    Needs DOC: NO
    API Change: NO
    Reviewer: Pete F.
    Code-level description of changes:
    CompilerSwcContext.java
    Removed updateRemovedSources() and it's usage.
    CompilerAPI.java
    Removed deleteRemovedSwcSources(), renamed
    deleteObsoletedSwcSources() to reportObsoletedSwcSources(), and
    deleteShadowedSwcSources() to reportShadowedSwcSources().
    Updated validateCompilationUnits() to no longer report
    DependentFileNoLongerExists.
    SwcCache.java
    Removed "removed" and "updated" variables, their getters, and the
    code that initialized them.
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerAPI.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerSwcContext.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcCache.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcGroup.java

  • Sequence losting cache

    Hi, I have some sequences in cache and i'm losing the cache with the instance "ON".
    I'm using 10g.
    The sequence's cache uses LRU list? What can I do?
    Thanks.

    The sequence cache is in the library cache.
    You will loose sequences by bouncing the instance amongst other.
    This is not a problem, as sequences are used for surrogate keys, and as surrogate keys don't have a meaning (except for bean counters), you can have a surrogate key with holes.
    If you want to minimize the impact create your sequences with the nocache clause.
    If you want a surrogate without holes, revert to the sequence table. Remember this 'solution' scales badly.
    Sybrand Bakker
    Senior Oracle DBA

  • Creating sequence without cach

    how can i create a sequence without cach to reduce the possibility of gabs

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_615a.htm#2067096
    Try search before you ask question.

  • Lr 5.6 error message that reading preview cache failed and will correct when reopened; does not correct on reopening; removing preview.lrdata files allows LR to open but photos not shown; what action should I take next?

    Lr 5.6 error message that reading preview cache failed and will correct when reopened; does not correct on reopening; removing preview.lrdata files allows LR to open but photos not shown; what action should I take next?

    Yikesyou have helped me before and I thank you for that.  Funny how at the last resort I ask a question and then an hour later I fix something that has been broken for five days.  I got off on the wrong foot with Lightroom installation and I really stepped in it...a lot had to do with a bad hard drive and all that.  I still have remnants of catalogues etc so I am never quite sure where I am.  I ran a search and found more than one .lrdata files.  I finally got the right one to delete and I think I am okI'll be crying to you again if I am wrongall best, thanks again for your helpjim sterne

  • I bought a ipod touch 3 i need help on this is there a youtube app that has a cach download to play youtube video's offline within the app if there is one can someone fill me some info on this matter

    i bought a ipod touch 3 i need help on this is there a youtube app that has a cach download to play youtube video's offline within the app if there is one can someone fill me some info on this matter

    You can only use apps that are compatible with your dvice and ios version.
    The secons gen ipod touch can only go to 4.2.1.
    If you are running 4.2.1 then you can only use apps that require 4.2.1 or lower.

  • Reset Task Sequence Variables cached in WinPE - Possible ?

    Hi All,
    We are currently receiving prestaged computers from vendor, the image on the disk is out of date. I have added logic to detect old prestaged images, upon detection it will download latest wim from DP and deploy. This automatically wipes the disk before applying
    the wim. 
    During the os build an error occurs when installing the sccm client, this is because in the prestaged build i specified that the SCCM Client should be cached onto the disk. Because the contents of the disk is wiped due to the latest wim being downloaded
    and applied the task sequence still looks for the cached package which has been deleted... i imagine this is due to the information being cached in a TS Variable...
    Is there any way i can remove this variable, or perhaps all variables relating to the prestaged build if an old prestaged image is detected...?
    "note: going forward i will not be caching any packages into a prestaged build"
    Many thanks.. 

    I don't work with pre-staged media much so don't know if what you want is actually stored in a variable that can be overwritten or not; however, you can overwrite the value of any (non-read only) variable at run-time by using the standard methods
    including the set task sequence variable task or a script that uses the Microsoft.sms.ysenvironment com object.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Buffer cache of SGA

    can anyone plz clarify my doubt,it is which parameter defines the size of db buffer cache in the SGA.does db_cache_size directly defines the size or is it the size of the cache of standard blocks(specified by db_block_size parameter).

    DB_BLOCK_BUFFERS specifies the number of blocks to allocate for data buffer. This parameter's value is then multiplied with DB_BLOCK_SIZE to calculate the size of the data buffer.
    DB_CACHE_SIZE specifies the size value itself directly in units of KV,MB or GB. This parameter alone is enough to calculate the data buffer cache size.
    DB_BLOCK_BUFFERS can only create buffer cache in units of blocks based on one parameter DB_BLOCK_SIZE. On the other hand, multiple data buffere caches can be created by using DB_nK_CACHE_SIZE parameters where n is the blocks's size of for the buffer cache. So for example, one can allocate X MB buffer cache of 8K block size and have Y MB buffer cache of 16K blocks. This helps when you have tablespaces of varying block sizes (This could not be possible using DB_BLOCK_BUFFERS as DB_BLOCK_SIZE is not modifiable).
    DB_CACHE_SIZE can work along with SGA_TARGET parameter (which decides SGA size). If DB_CACHE_SIZE is 0, then it's value varies based on usage. If a value is set then that value turns out to be a minimum value. This is not possible using DB_BLOCK_BUFFERS.

  • How to find out that sequence has finished loading?

    Hello,
    i have a custom C#-OPUI to load and execute testplans.
    I do this using these funtions:
    1. ApplicationManager.OpenSequencFile(filename)
    2. ???
    3.Command TestStart = axSequenceFileViewMgr.GetCommand(.......)
    TestStart.Execute(true)
    The question is now: How do i know that the OpenSequenceFile has finished doing everything?
    I need to know that is finished before i run the execute-command.
    Is there a specail final-event that i can check?
    Thanks for help
    Solved!
    Go to Solution.

    Hi jigg,
    Thanks for the info.
    In my sequence file, besides the main sequence, I also enabled "SequenceFileLoad" callback. In "SequenceFileLoad" sequence, I added some instruments initialization tests. The goal is to initialize the instruments only once when the sequence file is loaded. Therefore I need to know when the "SequenceFileLoad" is finished or when the sequence file has finished loading.
    My first idea is to use the event "axApplicationMgr_SequenceFileOpened", but I found that I will catch this event before the "SequenceFileLoad" execution finished.
    And then, I also found that together with the execution of sequence "SequenceFileLoad", there are 2 events in my C# code: "axApplicationMgr_StartExecution" and "axApplicationMgr_EndExecution" triggered. So I was thinking may be I can use "axApplicationMgr_EndExecution" to determine if the sequence file has finished loading. But the problem is every sequence execution will trigger these 2 events. The main sequence will also trigger these 2 events. So I needs to know the name/ID of the current executing sequence.
    So Is there a way to read current executing sequence name?
    Thanks and regards,
    0049

  • Sequences in cache connect

    Hi!
    I have some sequences in oracle, which is connected to a timesten with cache connect option.
    These sequences are used from both databases, and must provide unique values.
    Is there a method for caching some values from the sequences in the timesten so the nextval would not ask oracle each time?
    thanks in advance

    Cache connect does not cache Oracle sequences; so if you need to share the same Oracle sequence in both TimesTen and Oracle, then you will need to go to Oracle and retrieve the nextval each time.
    Simon

  • Buffer cache vs data blocks that can be cache

    Hi Guys,
    Do it means that if we have 2 GB of buffer cache allocated to Oracle, we can only store up to 2GB of data in memory?
    thanks

    dbaing wrote:
    Hi Guys,
    Do it means that if we have 2 GB of buffer cache allocated to Oracle, we can only store up to 2GB of data in memory?Yes, this means that you can any time, can have 2gb of cached blocks in your memory.
    Aman....

  • How to force FF to download a file that is in cache automatically

    We have files that others download. The files get changed frequently but have the same name in the same remote folder.
    Many times when they download from a link FF does not download it again but uses the last file (same name) that we previously downloaded.
    I do not have control of the user who is doing the download.
    The files in question are Windows exe files.
    The user doing the download is on Windows.
    So how can we force FF to download the file and not use the old file in cache????

    A good place to ask advice about web development is at the mozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.<br>
    You need to register at the mozillaZine forum site in order to post at that forum.

  • Why does Firefox sometimes still tell me that I have cache to clear in the Advanced tab of the Options menu after I completely clear it using Clear Recent History?

    I always have the time range in the Clear Recent History window set to "Everything", too.

    While I didn't know about the about:cache page, it doesn't help me understand why Firefox is doing this, and how to fix it. Also, as I said in my question, I already knew about the cache information in the Advanced tab of the Options menu. I was trying to imply that I sometimes have to clear it using both the Clear Recent History feature and in the Advanced tab of the Options menu, because using Clear Recent History doesn't delete it all.

Maybe you are looking for