设为首页 加入收藏 网站搜索 繁體中文 中国建站网 — 站长资源分享平台

Dealing with identity gaps (Freebob)

来源:本站整理 作者:佚名 时间:2006-06-19 15:02:15

请大家耐心看下去,受益非浅! 


Identity columns (sometimes referred to as "auto-increment" columns) remain a somewhat controversial topic in ASE: while the functionality is very useful, the implementation in ASE leaves quite a few things to be desired. In practice, this means that there is a risk of running into "identity gaps" : these are occasions where the identity value suddenly make large jumps, like from 10031 to 5000002 instead of to 10032, usually as a result of a shutdown with nowait. 
Because shutdown with nowait cannot always be avoided, identity gaps may occur at some point, and they can cause real problems for applications that are not expecting such large numbers. 
It is unfortunate that ASE does not have any features to make repairing an identity gap easy: the repair procedure documented by Sybase is a bit clumsy and can cause significant application downtime (it requires a full BCP-out and BCP-in of the table). For this reason, some developers or DBAs have decided not to use identity columns at all. 

The problems caused by identity gaps can actually be limited; the precise method depends on your ASE version: 

1)When running ASE 12.0 or later, you should use the identity_gap feature for each table with an identity column to limit the size of possible identity gaps. Details are described here . 见文1 

2)For all ASE versions, you can design your data model in such a way that identity gaps will never occur.见文2 


--------------------------------------------------------------------------- 

A better method for dealing with "identity gaps" 

Introduction 
A well-known feature of Sybase Adaptive Server Enterprise is the "identity column". Identity columns are useful because they automatically generate consecutive numeric values upon insertion of new rows, while having minimal impact on performance. 
A disadvantage of using identity columns is that so-called "identity gaps" may occasionally occur. Identity gaps are large, sudden jumps in the value of an identity column, which often cause problems for applications. 
Unfortunately, there is currently no quick or easy way of repairing an identity gap. The standard remedy as recommended by Sybase Technical Support can be rather time-consuming, which may result in unacceptable, hour-long application downtime. For this reason, DBA’s or developers sometimes prefer to avoid the use of identity columns for applications with high availability requirements. 

This article presents a database design technique that allows identity gaps to be fixed easily and quickly, taking no more than a few seconds. With this approach, full advantage can be taken of the functionality of identity columns, while minimising the impact on application availability in case identity gaps need to be repaired. 

What "identity gaps" look like 

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]  下一页

Tags:

  • 好的评价 如果您觉得好,就请您
      0%(0)
  • 差的评价 如果您觉得差,就请您
      0%(0)
  • 相关文章
    广告赞助

    文章随便看看 设计素材 建站学院 网页模板 视频教程

    网友评论

    共有 0 位网友发表了评论,得分 0 分,平均 0 分    查看完整评论

    用户名: 查看更多评论

    分 值:100分 85分 70分 55分 40分 25分 10分 1分

    内 容:

             通知管理员 验证码: