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

Similar Messages

  • 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.

  • 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.

  • 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.

  • Premiere Pro CC's sequence lost. Is there a way to "search" for it from outside the project?

    I seem to have lost a sequence created in Premiere Pro CC. I can't find it anywhere inside the Project bin.
    We have so many same-name, older projects (between Auto-Save, different drives and so on) that looking inside each of them would take forever.
    But we do know the name of the sequence. I am wondering  if there is a way to "search" for a sequence name from outside the project?
    Thanks

    there is a way to "search" for a sequence name outside of the project,
    but it would be a pointless waste of time.
    sequences are only saved within the project file itself!!
    We have so many same-name, older projects (between Auto-Save, different drives and so on) that looking inside each of them would take forever.
    better get at it then!
    hahahahahahahaha!!!

  • 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

  • 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

  • Some sequences lost after upgrade to 12.1.3

    We update our EBS from 11.0.3 to 12.1.3,but we find some sequences in 'BNE' are lost.
    such as 'BNE_ATTRIBUTE_S'.
    we upgrade ebs step is :
    1.upgrade 11.0.3 to 11.5.10.2
    2.upgrade 11.5.10.2 to 12.1.1
    3.upgrade 12.1.1 to 12.1.3
    we can not find 'BNE_ATTRIBUTE_S' in all of the versions of the EBS.
    Please HELP!
    Thanks in adv,
    Jackie

    Jackie,
    WebADI comes with Oracle Apps installation. However, you can find the list of recommended patches in these docs.
    List Of All Webadi Integrator Patches For R12 EBusiness Modules. [ID 736621.1]
    List of Patches in Web Applications Desktop Integrator (Web ADI) for Releases 11i and 12 [ID 726989.1]
    R12 List of Patches and File Versions in Web ADI [ID 878434.1]
    Latest Web ADI Patches [ID 257808.1]What Patches and Documentation are Required To Use WebADI in HRMS? [ID 416445.1]
    What Patches Should be Applied for Installing WEB ADI [ID 197199.1]
    Is There A Patch For WebADI To Allow It To Work With Excel 2010? [ID 1272346.1]
    Thanks,
    Hussein

  • Track Sequence Lost when moving files

    Hi there,
    We had a breech of access in one of our labs, and an account that was created by a student (and set to admin) was deleted. The student was working on several FCP projects in this account, and rather than deleting the data I copied the entire user folder to the /Users/Shared folder for the student to access within his own account (set the approriate permissions and everything).
    The student is now claiming that after the files were moved, that the track sequence is now not there. There were like 4-5 video tracks and many audio tracks. The only thing that shows up is one video track, and 2 audio tracks. Is there anything that can be done, or is the data lost? Is it possible for this to happen? Thanks for any help, as I am not that familiar with Final Cut Pro.

    If you click on the desktop and press command(apple)+F and do a search for 'Autosave Vault' you will find a folder that stores all the saved FCP projects that your system has archived.
    Each project will have it's own holder within the Autosave Vault folder.
    When you look in a folder, the most recent version is at the BOTTOM, not the top.
    If you go to User Preferences in FCP, in the bottom left corner you will see the time settings for the Autosave function. If you open up the Log and Capture window and go to 'Scratch Disc' you will see where the files are saved to.
    Good luck.

  • End of sequence lost when exporting

    Hello everyone!
    I have had the problem twice that after working on a sequence for a while it leaves out about ten seconds at the end when I export. The same sequence would have exported fine earlier on. I dont have any In and Out points, although I have tried this as well without success. I have used text on top of the image, and the audio files have been edited in Soundtrack Pro, but thats all the "fancy stuff" i have done. I have checked for blank spaces in between clips and dont have any.
    Please help I have to submit something on Saturday and am feeling very unhappy ;-(
    Very thankful for help

    YUP! That's the problem.  FCP doesn't work well with H.264. The biggest issues are sync issues, something you might not see until you export.  The problem is that FCP SEEMS LIKE it'll work with that footage fine, it gives no warning.  Apple fixed this with FCX, making it ask if you want to "optimize" the footage...meaning convert it to ProRes.  FCP 7 and lower...didn't do that.  Thus it lead you down a bad path.
    If you have H.264 footage, you need to convert it to ProREs before you start editing. Yes, the file sizes will increase dramatically, but that's what you need to do in order to work properly. Working with highly compressed footage like H.264 is difficult, takes a lot of resources. Adobe does this by having you load lots of RAM and use a graphics card that enables a special acceleration engine.  FCP 7 does not have this, so you need to convert.
    The quick  solution here is to go to the SEQUENCE menu and choose SETTINGS. In the COMPRESSOR menu there, click on H.264 and scroll up to Apple ProRes 422.  Click OK.  Render the sequence (this will render it as ProRes)...and then export.

  • Movie lost,cache and preview files

    I am in a bad situation. I created some  movies of personal memories with premierePro and the medium they were on died. All i have left is the cache/preview (is there a difference between them?)files. Is there any way that i can use them to retrieve the videos..or is there even a player for them???

    If you can spin up your dead HDD, maybe a recovery program, like Stellar-Phoenix, can recover your data. I've used it a few times, and it has been a real life-saver (or file-saver, as the case may be).
    Good luck,
    Hunt

  • Implications/side effects of changing cache size of sequence

    Hi Experts,
    We are on Oracle 11.2.0.2 on Solaris 10. I have a question about sequences. They are defined as NOCACHE in my database and we are seeing a lot of "row cache lock". So I am thinking of changing the sequences to cache 20 values. Does this have any other implication -except that during db restart the cached values can be lost.
    Thanks,

    @VenkatB, when you get a value from sequence, to provide consistency, sequence execute an internal commit, works like kind of autonomous transaction.edit: this is also how, after a crash sequence still get his last value.
    that is because if you dont set cache and use in a loop the sequence, that cause to log file sync event. (of course you must get many values from sequence)
    >
    Prove it.
    Log file sync may only be incidental but may happen only from the application code when they get sequence and then do a commit within a loop. In fact, log file sync need not happen just because it's committed in loop.
    When user process gets sequence value, Oracle updates SEQ$ with the value to update the value. In fact, Oracle does it for almost all of the foreground code. When Oracle has to add an extent, when Oracle has to update a new datafile header, when Oracle has to autoextend a file, etc...it always inserts/updates one of the dictionary views all the time. So it's nothing new or just with sequence.
    And don't confuse yourself with a timed event with a wait.
    I have tested on a 11g and 10g and I don't see any log file sync waits in tkprof or v$session_event
    SQL> create sequence seq_test start with 1 nomaxvalue nocache;
    Sequence created.
    SQL> Declare
      2   v_cnt number;
      3  Begin
      4   For i in 1..10000
      5   Loop
      6     select seq_test.nextval into v_cnt from dual;
      7   End Loop;
      8  End;
      9  /
    PL/SQL procedure successfully completed.

  • Gaps in sequences set to cache

    Would like to know if sequences are set to cache is it possable to see gaps in the sequence when a process like rman or a long period of time accures.
    I am trying to pin down why we have gaps. I read a little about if the system comes down then the sequence in cache memory would be lost and Oracle would get the next set of numbers.
    10.2.0.4
    linux
    Thank you,
    Steve

    user12551219 wrote:
    Would like to know if sequences are set to cache is it possable to see gaps in the sequence when a process like rman or a long period of time accures.
    I am trying to pin down why we have gaps. IOracle sequences will always have gaps for various reasons, a rollback is one, caching and database shutdowns are others. Caching sequences produces better performance.
    The answer is to not care that sequences have gaps.
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:4343369880986
    A sequence is a unique identifier and not a counter, storing a row count in a table is non-relational and does not perform or scale. If rows need to be counted they should be counted when they are selected.
    If you are concerned about losing numbers because you may run out, I wouldn't worry about that for a while either.
    Re: What kind of transaction in procedure?

  • Cache sequence

    Hi All,
    I have a straight insert/select -
    insert into t_tab
    (p_id,
    p_name,
    p_ser_id,
    p_flag)
    select my_seq.nextval,
    p_name,
    p_ser_id,
    p_flag
    from my_table
    The table my_table has about 500K records. It takes lot of time.
    Most time spent that sequence returs the next_val too slow.
    I am thinking to cache the seq before the select - like
    alter sequence MY_SEQ cache 10000000
    Do I need to alter it back again to no cache mode or default cache after the
    insert in done. If yes then whats the syntax for that.
    Also, any suggestion to use append / parallel here.
    Thanks a lot.
    ds

    You can find the current setting of the cache size by querying the CACHE_SIZE column in the USER_SEQUENCES view.
    Setting it to value 10000000, seems a bit over the top if you ask me.
    I'd increase the current setting by a factor of 100, maybe 500, and see how the performance gains from that.
    If yes then whats the syntax for that. Same syntax. Just use the current setting you found in USER_SEQUENCES.

  • Sequence cache question

    if there is a sequence with CACHE 20, are numbers that are allocated from the cache going to be ordered?. So if I have values 61..80 in the sequence cache, is the next NEXTVAL call GUARANTEED to get 61, or will it get any random value from the cache
    thanks

    In a RAC environment, by default, sequence values can be returned out of order. There is an ORDER attribute that can be added to he DDL to create a sequence to force sequence values to be returned in order (though I'd wager this has a decent performance cost).
    In a single instance database, sequence values will be returned sequentially whether the sequence is created as ORDER or NOORDER.
    Of course, even if sequences come in order, it's possible that when you have concurrent transactions, the one with the later sequence value manages to commit before the one with the earlier sequence value. This may or may not be a concern in your environment.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • Adobe creative cloud.exe ne fonctionne plus

    adobe creative cloud.exe ne fonctionne plus. Impossible donc de tenir à jour mes logiciels à moins qu'Adobe le fasse lui-même sans que je le demande. Je ne suis plus tenu au courant de la disponibilité des MAJ disponibles ! Et ça fait des semaines qu

  • Cutover approach - new fields added to existing DataSources / DSOs / Cubes

    My current project has been phased across multiple releases. The phase 1 go-live was a few months ago and there is already a reasonable amount of data in the production environment. We will soon cutover from our QA to production environment. Some of

  • Problems with snow leopard and file vault

    I just installed snow leopard on my macbook. When I try to log on, I get a message "your home folder is protected by file vault and didn't open, it needs to be repaired. To repair folder and continue logging in click ok."   When I click ok, I get the

  • Error #1006: value is not a function

    I'm trying to port a big library to Alchemy. I've run into something that looks like an Alchemy bug. I have a class with a static member. There's a static function that uses it. Something like this: In foo.h:     class Foo         static Bar m_pBar;

  • Adding custom fields to CN41 Transaction code

    Hi Experts, I have a requirement to display few SAP standard fields (like VORN1 from AFABD structure) in CN41 transaction code. I modified the custom include structure CI_PROJ in table PROJ. When I ran CN41 tcode, this field doesn't show up in the la