数据库有max row sizex限制, 它的大小取决于 max page size, 而后者是在创建DB Server时指定的,它是Server-wide的,作用于DB Server下的所有数据库。 就Sybase 数据库而言, max row size 是1962byte, 而 max page size 是2048byte, 在Sybase version12 之前,max page size 只有2048byte 一种选择,而之后有了:2048 4096 8192 16384
四种选择,可以在创建DB Server 时指定,也可以之后通过Sybase Central 工具修改, 重启DB Server后生效, 而默认的为2048。 具体page size 与row size关系如下。
|
Page size |
Maximum row length |
Maximum column length |
|---|---|---|
|
2K (2048 bytes) |
1962 |
1948 |
|
4K (4096 bytes) |
4010 |
3988 |
|
8K (8192 bytes) |
8096 |
8058 |
|
16K (16384 bytes) |
16298 |
16228 |
com.sybase.jdbc2.jdbc.SybSQLException: Attempt to update or insert row failed because resultant row of size 2864 bytes is larger than the maximum size (1962 bytes) allowed for this table.
事实上,在创建存储过程时已有警告:
Warnings: --->
W (1): Warning: Rowsize (2624 bytes) could exceed row size limit, which is 1962 bytes.
<---所以,如果遇到此警告,为避免今后数据库操作存在潜在问题,可以larger max page size或者优化sql 语句或表的结构,避免row size 大于 max row size。
更多的资料可以参考官方文档:http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc20020_1251/html/databases/databases255.htm
此外,Sql Server数据库的max page size 要大些:8060byte。
Sybase 数据库的最大行尺寸受 max page size 影响,该限制为1962 byte,而 max page size 在 Sybase version 12 之后提供了多种选择。创建或更新超尺寸行会导致错误,警告在存储过程创建时已发出。为解决此问题,可增大 max page size 或优化 SQL 语句和表结构。Sql Server 的 max page size 更高,为 8060 byte。查阅官方文档了解更多。
3041

被折叠的 条评论
为什么被折叠?



