精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● Powerbuilder>>数据库相关技术>>Re: 关于sql anywhere database's size

主题:Re: 关于sql anywhere database's size
发信人: ilike()
整理人: leitiger(2002-06-05 23:45:28), 站内信件
王安说的不错,下面这篇转贴自Sybase权威文档。
Database's Page Size Too Big - Refined Solutions and Performance Issue
----------------------------------------------------------------------------
----
SUMMARY:  The database server must use a page size greater than or equal to 
the maximum page size of any databases running on the database server.
If not, it will result in the error message "Page size too big".
Document ID: 47959 Last Revised:  09/15/99
Topic: Error Messages Document Type: TechNote
Product: Adaptive Server Anywhere Version: Not Version Specific
Platform: PC Operating System: Windows 3.1, Windows 95, Windows NT, Windows 
98
----------------------------------------------------------------------------
----
Document:
The general rule regarding the database server page size/database page size 
relationship in Adaptive Server Anywhere is:
The database server must use a page size greater than or equal to the maximu
m page size of any database running on the database server.
When the database(s) is(are) started at the same time as the database server
 the database server page size is set up correctly. If however, you attempt 
to dynamically start another database with a page size greater than the larg
est database page size running on the database server, the error message "Pa
ge size too big" appears.
By default, a database is created with a page size of 1024 bytes (Note: as o
f Adaptive Server Anywhere 6.0.3 the default page size is 2048 bytes).
Refined Solution 1
When it is possible beforehand to determine which databases will be running 
on a particular database server, the page size of the database server should
 be set as the maximum page size of these databases.
Examples:
Assume that there are three database files: db1.db, db2.db and db3.db with p
age sizes 1024, 1024 and 2048 respectively, on drive C:\ on a server named d
b1.
Any of the following commands will set the page size for a database server n
amed db1: to 2048 bytes.
The database server will be named the same name as the first database starte
d if no -n switch is provided to name the database server explicitly. The da
tabase server page size will be set to the largest page size of the database
s being started at the same time.
dbsrv6 c:\db1.db c:\db2.db c:\db3.db
The database server page size is being set explicitly to 2048 bytes using th
e -gp switch in the database server start command.
dbsrv6 -gp 2048 c:\db1.db c:\db2.db c:\db3.db
The database server page size is being set explicitly to 2048 bytes using th
e -gp switch in the database server start command. The database (db1) page s
ize is still 1024 bytes. Half of every database server page will be left emp
ty.
dbsrv6 -gp 2048 -n db1
The database server is explicitly named db1 using the -n switch in the datab
ase server start command before any databases are specified. The page size w
ill be set to 2048 by default since the page size of c:\db3.db is 2048 bytes
.
dbsrv6 -n db1 c:\db3.db
The DBINFO utility can be used to verify database page size,
Example:
dbinfo -c "uid=dba;pwd=sql;dbf=c:\db1.db"
Refined Solution 2
Changing the page size of the databases can be accomplished by creating a ne
w database with a different page size, unloading the original database and r
eloading it to the new database with the new page size.
Example:
Assume again there are three database files: db1.db, db2.db and db3.db with 
page sizes 1024, 1024 and 2048 respectively, on drive C:\, on a server named
 db1, and for some reason you want them to use the same page size, 2048 byte
s. The db3.db can be left as is, and for db1.db and db2.db the following can
 be done, assuming the directory c:\unload exists:
Create a new database with the new page size
dbinit -p 2048 c:\db1new.db
Unload the old database
dbunload -c "uid=dba;pwd=sql;dbf=c:\db1.db" -r c:\reload.sql c:\unload
Reload the old database into the new database
isql -c "uid=dba;pwd=sql;dbf=c:\db1new.db" read c:\reload.sql
Repeat these steps for c:\db2.db
Performance Issue
At most one database page can be put into one database server page. If you s
tart two databases, one with a page size of 4K and one with a page size of 1
K, the database server will use a 4K page size, which means that the 1K data
base pages will only use one quarter of the database server page. In the cas
e of a 512 byte database page size, at least half of all 1024 byte cache pag
es will be wasted. This makes the use of 512 byte page size for databases no
t recommended, although it is still supported for upward compatibility.


--
※ 来源:.网易 BBS bbs.netease.com.[FROM: 202.103.139.166]

[关闭][返回]