DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: Sequence Help

Hybrid View

  1. #1
    Join Date
    Nov 1999
    Posts
    226

    Sequence Help

    How to find out in a database what sequences are reaching their max value . I need to increase the max_value of these because if they cycle their I will have a unique constraint problem

    Thanks

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    select from the dba_sequences, all_sequences, or user_sequences view.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Use the dba_sequence/user_sequences view to check this
    Code:
       View the sequences that are 100 counts short of reaching the max value.
    
       SELECT sequence_name,
              sequence_owner,
              last_number,
              max_value 
         FROM dba_sequences
        WHERE last_number > (max_value-100);
    Sam
    Last edited by sambavan; 07-15-2003 at 06:36 PM.
    Thanx
    Sam



    Life is a journey, not a destination!


  4. #4
    Join Date
    Nov 1999
    Posts
    226
    How do I compare the CURVAL to max_value for all these sequences ..

  5. #5
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    The last number is your CURVAL

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  6. #6
    Join Date
    Nov 1999
    Posts
    226
    Thanks

    You are always a Great help !

  7. #7
    Join Date
    Jul 2001
    Location
    Slovenia
    Posts
    422
    alter sequence sequence_name nocycle?
    Tomaž
    "A common mistake that people make when trying to design something completely
    foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams

Posting Permissions

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


Click Here to Expand Forum to Full Width