Extends the range of a segment to another database device.
sp_extendsegment segname, dbname, devname
is the name of the existing segment previously defined with sp_addsegment.
is the name of the database on which to extend the segment. dbname must be the name of the current database.
is the name of the database device to be added to the current database device range already included in segname.
Extends the range of the segment indexes for the database pubs2 on the database device dev2:
sp_extendsegment indexes, pubs2, dev2
A segment can be extended over several database devices.
You can only execute sp_extendsegment for the logsegment system segment in single-user mode.
If the logsegment segment is extended, any other segments on the device are dropped and the device is used for the log segment exclusively.
When you extend the logsegment segment, Adaptive Server recalculates its last-chance threshold.
To associate a segment with a database device, create or alter the database with a reference to that device. A database device can have more than one segment associated with it.
After defining a segment, you can use it in the create table and create index commands to place the table or index on the segment. If you create a table or index on a particular segment, subsequent data for the table or index is located on that segment.
The permission checks for sp_extendsegment differ based on your granular permissions settings.
Granular permissions enabled |
With granular permissions enabled, you must be a user with manage database privilege. |
Granular permissions disabled |
With granular permissions disabled, you must be the database owner or a user with sa_role. |
Values in event and extrainfo columns from the sysaudits table are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
38 |
exec_procedure |
Execution of a procedure |
|
Commands alter database, create index, create table
System procedures sp_addsegment, sp_dropsegment, sp_helpdb, sp_helpdevice, sp_helpsegment, sp_placeobject