?
Solved

Sybase- adding space

Posted on 2012-09-20
4
Medium Priority
?
728 Views
Last Modified: 2012-09-20
Hi,
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'
go

alter database sybsecurity on secdisk1 = "1000M"
go

sp_extendsegment Segment_Data_02, sybsecurity, secdisk1
0
Comment
Question by:motioneye
  • 2
  • 2
4 Comments
 
LVL 24

Assisted Solution

by:Joe Woodhouse
Joe Woodhouse earned 2000 total points
ID: 38417307
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
   go
   sp_helpdb sybsecurity
   go

(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]
   go
0
 

Author Comment

by:motioneye
ID: 38417587
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 ?
0
 
LVL 24

Accepted Solution

by:
Joe Woodhouse earned 2000 total points
ID: 38417624
Yes.

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". :)
0
 

Author Closing Comment

by:motioneye
ID: 38418514
Thanks Joe,
Only u are expert in sybase in this EE :)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
With more and more companies allowing their employees to work remotely, it begs the question: What are some of the security risks involved with remote employees and what actions should we take to secure them?
Loops Section Overview
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

850 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