Sequences Wizard (Oracle)

From RapidSQL
Jump to: navigation, search

Go Up to Oracle Object Wizards

Sequences are programmable database objects that provide numbers in sequence for input to a table. A sequence can be used to automatically generate primary key values for tables.Once defined, a sequence can be made available to many users. When you create a sequence, you can define its initial value, increment interval, and maximum value.

The Sequence Wizard lets you:

  • Specify the name and owner of the sequence.
  • Set both the value of the sequence, and an interval and ranges for incrementing it.
  • Cache the sequence, cycle the sequence when it reaches its minimum or maximum values, and guarantee that Oracle generates sequence numbers in the order of request.
Note: To create a sequence, it must belong to your schema or you need CREATE SEQUENCE privilege.

To Open the Sequence Wizard

  1. On the Navigator, find the datasource where you want to create a rollback segment and expand the Schema node.
  2. Right-click the Sequences node, and select New.

The table that follows describes the fields you may encounter as you complete the wizard.

Required Information Description

Who owns the sequence?

Self-explanatory.

What is the sequence name?

Self-explanatory.

What is the first sequence number to be generated?

Start with: Pick an integer.

What is the interval between sequence numbers?

Increment by: Positive numbers will generate ascending values, and a negative number will generate descending numbers

What is the sequence’s minimum value?

The default is 1 for ascending sequences; This integer value can have 28 or fewer digits. None Minimum value - Identify how low the sequence can go.

What is the sequence’s maximum value?

For descending values, the default is 1. Lets you specify the maximum value the sequence can generate. This integer value can have 28 or fewer digits. None Maximum value - Indicate the highest sequence value that will be allowed.

Should Oracle preallocate sequence numbers and cache them for faster access?

This is the number of sequence values you want to specify in the SGA buffers. This speeds access, but cached numbers are erased when the database is shut down. The default value is 20. Yes Number of values No

Should the sequence continue to generate values after reaching either its maximum or minimum value?

If you say no, the sequences will automatically recycle to the minimum value when you’ve hit the maximum for ascending sequences and vice versa for descending sequence values. Yes No

Should the sequence numbers be generated in the order of request?

This may be required when sequences are required for timestamping. But generally, because sequences are naturally ordered, this is only necessary for if you use Oracle RAC clusters for parallel mode. Yes No