INITIAL
specifies the size in bytes of the object's first extent. Oracle7 allocates space for this extent when you create the object. You can also use K or M to specify this size in kilobytes or megabytes. The default value is the size of 5 data blocks. The minimum value is the size of 2 data blocks. The maximum value varies depending on your operating system. Oracle7 rounds values up to the next multiple of the data block size for values less than 5 data blocks. Oracle7 rounds values up to the next multiple of 5 data blocks.
NEXT
PCTINCREASE
You cannot specify PCTINCREASE for rollback segments. Rollback segments always have a PCTINCREASE value of 0.
Oracle7 rounds the calculated size of each new extent up to the next multiple of the data block size.
MINEXTENTS
If the MINEXTENTS value is greater than 1, then Oracle7 calculates the size of subsequent extents based on the values of the INITIAL, NEXT, and PCTINCREASE parameters.
MAXEXTENTS
specifies the total number of extents, including the first, that Oracle7 can allocate for the object. The minimum value is 1. The default and maximum values vary depending your data block size.
UNLIMITED specifies that extents should automatically be allocated as needed. You should not use this option for rollback segments.
FREELIST GROUPS
for objects other than tablespaces, specifies the number of groups of free lists for a table, cluster, or index. The default and minimum value for this parameter is 1. Only use this parameter if you are using Oracle7 with the Parallel Server option in parallel mode.
FREELISTS
You can only specify the FREELISTS parameter in CREATE TABLE, CREATE CLUSTER, and CREATE INDEX statements. You can only specify the FREELIST GROUPS parameter in CREATE TABLE and CREATE CLUSTER statements.
OPTIMAL
specifies an optimal size in bytes for a rollback segment. Not applicable to other kinds of objects. You can also use K or M to specify this size in kilobytes or megabytes. Oracle7 tries to maintain this size for the rollback segment by dynamically deallocating extents when their data is no longer needed for active transactions. Oracle7 deallocates as many extents as possible without reducing the total size of the rollback segment below the OPTIMAL value.
The value of this parameter cannot be less than the space initially allocated for the rollback segment specified by the MINEXTENTS, INITIAL, NEXT, and PCTINCREASE parameters. The maximum value varies depending on your operating system. Oracle7 rounds values to the next multiple of the data block size.
When you create a tablespace, you can specify values for the STORAGE parameters. These values serve as default STORAGE parameter values for segments allocated in the tablespace.
When you create a cluster, index, rollback segments, snapshot, snapshot log, or table, you can specify values for the STORAGE parameters for the segments allocated to these objects. If you omit any STORAGE parameter, Oracle7 uses the value of that parameter specified for the tablespace.
When you alter a cluster, index, rollback segment, snapshot, snapshot log, or table, you can change the values of STORAGE parameters. These new values only affect future extent allocations. For this reason, you cannot change the values of the INITIAL and MINEXTENTS parameter. If you change the value of the NEXT parameter, the next allocated extent will have the specified size, regardless of the size of the most-recently allocated extent and the value of the PCTINCREASE parameter. If you change the value of the PCTINCREASE parameter, Oracle7 calculates the size of the next extent using this new value and the size of the most recently allocated extent.
When you alter a tablespace, you can change the values of STORAGE parameters. These new values serve as default values only to subsequently allocated segments (or subsequently created objects).
A rollback segment created without specifying the storage option has the same storage options as the tablespace that the rollback segment is created in. Thus, if the tablespace is created with MAXEXTENT UNLIMITED, then the rollback segment would also have the same default.
Example I
The following statement creates a table and provides STORAGE parameter values:
CREATE TABLE dept
(deptno NUMBER(2),
dname VARCHAR2(14),
loc VARCHAR2(13) )
STORAGE (INITIAL 100K NEXT 50K
MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 5 )
Oracle7 allocates space for the table based on the STORAGE parameter values for the following reasons:
The following statement creates a rollback segment and provides STORAGE parameter values:
CREATE ROLLBACK SEGMENT rsone
STORAGE ( INITIAL 10K NEXT 10K
MINEXTENTS 2 MAXEXTENTS 25
OPTIMAL 50K )
Oracle7 allocates space for the rollback segment based on the STORAGE parameter values:
If you are using Trusted Oracle, your DBMS label must match the creation label of the table or cluster or you must satisfy one of these criteria. If the creation label of the table or cluster is not comparable or higher than your DBMS label, you must have READUP system privilege.
TABLE
specifies the schema and name of the table to be truncated. If you omit schema, Oracle7 assumes the table is in your own schema. This table cannot be part of a cluster.
When you truncate a table, Oracle7 also automatically deletes all data in the table's indexes.
CLUSTER
specifies the schema and name of the cluster to be truncated. If you omit schema, Oracle7 assumes the cluster is in your own schema. You can only truncate an indexed cluster, not a hash cluster.
When you truncate a cluster, Oracle7 also automatically deletes all data in the cluster's tables' indexes.
DROP STORAGE
REUSE STORAGE
leaves the space from the deleted rows allocated to the table or cluster. STORAGE values are not reset to the values when the table or cluster was created. This space can be subsequently used only by new data in the table or cluster resulting from inserts or updates.
The DROP STORAGE or REUSE STORAGE option that you choose also applies to the space freed by the data deleted from associated indexes.
If you omit both the REUSE STORAGE and DROP STORAGE options, Oracle7 uses the DROP STORAGE option by default.
Deleting rows with the TRUNCATE command is also more convenient than dropping and recreating a table for the following reasons:
You cannot individually truncate a table that is part of a cluster. You must either truncate the cluster, delete all rows from the table, or drop and recreate the table.
You cannot truncate the parent table of an enabled referential integrity constraint. You must disable the constraint before truncating the table.
If you truncate the master table of a snapshot, Oracle7 does not record the removed rows in the snapshot log. For this reason, a fast refresh does not remove the rows from the snapshot. Snapshots based on a truncated table must be refreshed completely for Oracle7 to remove their rows.
You cannot roll back a TRUNCATE statement.
Example I
TRUNCATE TABLE emp
The above statement also deletes all data from all indexes on EMP and returns the freed space to the tablespaces containing them.
Example II
The following statement deletes all rows from all tables in the CUST cluster, but leaves the freed space allocated to the tables:
TRUNCATE CLUSTER cust
REUSE STORAGE
The above statement also deletes all data from all indexes in the tables in CUST.