Sybase- adding space

Posted on 2012-09-20
Last Modified: 2012-09-20
Am I doing this correct to add free space in sybase db ? the only problems with below is I found the same device exist in default segment and also in Segment_Data_02, how do I make sure I only extend Segment_Data_02 on the device size below ?

disk init name='secdisk1', physname='/dev/md/rdsk/d436',vdevno=12,size='2000M'

alter database sybsecurity on secdisk1 = "1000M"

sp_extendsegment Segment_Data_02, sybsecurity, secdisk1
Question by:motioneye
    LVL 24

    Assisted Solution

    by:Joe Woodhouse
    Segments aren't containers, they're labels. They just say "so this part of the database that lives on this device is reserved for these types of objects".

    So your "alter database" statement added 1000MB to sybsecurity, available for the built-in segments "system" (for system tables) and "default" (user objects if not created on another segment).

    Your "sp_extendsegment" said that any object created on "Segment_Data_02" is also allowed here... but none of the other segments were de-referenced.

    Run the following:

       use sybsecurity
       sp_helpdb sybsecurity

    (sp_helpdb gives you more information when run from within the database you run it on.)

    This will list every segment currently referencing this device. If you want only Segment_Data_02 to be there, run on any others:

       exec sp_dropsegment [segment], sybsecurity, secdisk1
       [repeat for the others]

    Author Comment

    Hi Joe,
    What make me confuse is the same device exist in default,system and also in Segment_Data_02.  so if we have new data inserted is that means data can be tied to one of these segment ?
    LVL 24

    Accepted Solution


    Like I said, segments are not containers, no data is stored in a segment.

    When you add a data fragment (piece of a device in a database), all built-in data segments now also point to that new space. If you add log space, the built in "logsegment" points there. All this is true unless you specifically remove it.

    Think of it like adding shelves to a bookshelf. You might say that the first two shelves are reserved for DVDs, and stick a label on them called "DVD". Does that mean anything is stored in that label? Of course not. And can you still put other things on those shelves? Of course, unless you also make the label say "DVDs only". :)

    Author Closing Comment

    Thanks Joe,
    Only u are expert in sybase in this EE :)

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Outlook Free & Paid Tools
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now