BC remote Oracle DBA - Call (800) 766-1884  
Oracle Consulting Oracle Training Development

Remote DBA

Remote DBA Plans  

Remote DBA Service

Remote DBA RAC

Remote DBA Oracle Home
Remote DBA Oracle Training
Remote DBA SQL Tuning Consulting
Remote DBA Oracle Tuning Consulting
Remote DBA Data Warehouse Consulting
Remote DBA Oracle Project Management
Remote DBA Oracle Security Assessment
Remote DBA Unix Consulting
Burleson Books
Burleson Articles
Burleson Web Courses
Burleson Qualifications
Oracle Links
Remote DBA Oracle Monitoring
Remote DBA Support Benefits
Remote DBA Plans & Prices
Our Automation Strategy
What We Monitor
Oracle Apps Support
Print Our Brochure
Contact Us (e-mail)
Oracle Job Opportunities
Oracle Consulting Prices





Remote DBA services

Remote DBA Support

Remote DBA RAC

Remote DBA Reasons

Remote Oracle Tuning

Remote DBA Links

Oracle DBA Support

Oracle DBA Forum

Oracle Disaster

Oracle Training

Oracle Tuning

Oracle Training

 Remote DBA SQL Server

Remote MSSQL Consulting

Oracle DBA Hosting

Oracle License Negotiation








EnterpriseDB: SEQUENCE

Oracle Tips by Burleson Consulting

As I mentioned earlier in this chapter, a SEQUENCE is just a number generator (basically a counter).  In many instances, a sequence is used as the Primary Key of a table.  If you remember our discussion above, a Primary Key uniquely identifies each row of a table.  A number generator will do that nicely.  Of course, a sequence cannot guarantee that all of the other columns in the row are unique.  That would be a job for constraints.


Sequences can increment or decrement.  You can start at 100 and count down to 0 or you can start at 0 and count up to 100.

A sequence can skip more than one number by using the increment keyword and passing a numeric value.  An incrementing sequence can be created to start at 0 and skip 5 so each call would return 0, 5, 10, 15, etc.

A positive INCREMENT creates an incremental sequence and sets the number to skip on each call.  A negative value creates a decrement sequence and sets the number to reduce the sequence value on each call.


You can set the maximum (for incrementing) or minimum (for decrementing) value allowed for a sequence or you can allow it to count to the maximum allowed by the system.  On some older systems, the maximum is around 2 billion (+/-).  On some systems, it can be larger (9 million trillion).  Either way it's a pretty large number.  If your system supports 8 byte integers, it should support the larger value.


You can choose what happens when the sequence reaches its maximum value.  If you create a SEQUENCE with the CYCLE keyword, it will start over at the beginning (either minvalue or maxvalue depending on if it is an increment or decrement).  If you choose NO CYCLE, it will raise an error.


You can cache a sequence for better response time.  A sequence fetch is a serializing action.  If you are fetching a sequence value frequently, that can cause contention.  If you allow a cache, you will reduce that contention.

This is an excerpt from the book "EnterpriseDB: The Definitive Reference" by Rampant TechPress.

Expert Remote DBA

BC is America's oldest and largest Remote DBA Oracle support provider.  Get real Remote DBA experts, call
BC Remote DBA today.



Remote DBA Service

Oracle Tuning Book


Advance SQL Tuning Book 

BC Oracle support

Oracle books by Rampant

Oracle monitoring software







BC Remote Oracle Support

Remote DBA

Remote DBA Services

Copyright © 1996 -  2013 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.

Hit Counter