Sybase Question:
Download Questions PDF

How to compute database fragmentation in Sybase?



dbcc traceon(3604)
dbcc tab(production, my_table, 0)

A delta of one means the next page is on the same track, two is a short seek, three is a long seek. You can play with these constants but they aren't that important.

A table I thought was unfragmented had L1 = 1.2 L2 = 1.8

A table I thought was fragmented had L1 = 2.4 L2 = 6.6
How to Fix
You fix a fragmented table with clustered index by dropping and creating the index. This measurement isn't the correct one for tables without clustered indexes. If your table doesn't have a clustered index, create a dummy one and drop it.

Download Sybase Interview Questions And Answers PDF

Previous QuestionNext Question
How to implement database security?How to Save space when inserting rows monotonically?