Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Location
    ISTANBUL/TURKEY
    Posts
    6

    Unanswered: cache 0 ?= nocache

    Hi,
    Considering sequences, is nocache equal to cache 0 ?
    Is there a way to find optimum cache value for a new project?
    Thanks and regards;

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    No, it is not. NOCACHE indicates that values of the sequence are not preallocated. Minimum CACHE value is 2 (therefore, you can not specify CACHE 0). If you omit both CACHE and NOCACHE values, Oracle caches 20 sequence numbers by default.

    Optimum cache value? No idea ... but, thinking about it, it seems that if sequence is often used in the application, there might be some advantages if larger number of sequence values is cached.

    Read more about sequences here.

  3. #3
    Join Date
    Feb 2006
    Location
    ISTANBUL/TURKEY
    Posts
    6
    Hi littlefoot;
    Thanks for the information you provided.
    From the app.side it is an OLTP environment and is frequently
    used. So , as you said it is better to have a larger value.
    thank you,

    Regards,

  4. #4
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    Depends on how often the sequences are going to be used. If the default of 20 is used, Oracle will read the next 20 numbers and load them into the CACHE.

    One point to remember, if you plan on using the sequence number for any type of reporting, keep in mind that you may have "gaps" in the numbers.
    ie, Oracle loaded the next 20 sequences, the database is brought down for some reason ... Those last 20 sequence numbers are now gone...

    HTH
    Gregg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •