环境说明
CentOS6.5
- [db2inst3@kvm101 newtb]$ db2level
- DB21085I This instance or install (instance name, where applicable:
- "db2inst3") uses "64" bits and DB2 code release "SQL10014" with level
- identifier "0205010E".
- Informational tokens are "DB2 v10.1.0.4", "s140509", "IP23584", and Fix Pack
- "4".
- Product is installed at "/opt/ibm/db2/V10.1.0.5".
创建数据库
- mkdir -p /home/db2inst3/test
-
- db2 "create database testdb
- AUTOMATIC STORAGE NO
- on /home/db2inst3/test
- ALIAS test
- using codeset GBK
- territory zh_CN
- collate using identity
- PAGESIZE 8 k
- RESTRICTIVE
- catalog tablespace managed by system
- using ('/home/db2inst3/test/catalog/')
- TEMPORARY tablespace managed by system
- using ('/home/db2inst3/test/temp/')
- user tablespace managed by database
- using (file '/home/db2inst3/test/user/usertab.file' 65000)"
test下表空间的目录和文件可以不用预创建
- [db2inst3@kvm101 test]$ du -sh *
- 93M catalog
- 14M db2inst3
- 8.0K temp
- 508M user
关于以上创建数据库的几点说明:
user表空间,pagezie是8k,65000个pagesize,总大小是8k*65000/1024=507.8125M
创建后的编目信息
数据库本身编目
Database 1 entry:
Database alias = TESTDB
Database name = TESTDB
Local database directory = /home/db2inst3/test
Database release level = f.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
别名编目
Database 3 entry:
Database alias = TEST
Database name = TESTDB
Local database directory = /home/db2inst3/test
Database release level = f.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
使用非自动存储管理,创建后的表空间情况
- TBSP_ID TBSP_NAME TBSP_TYPE TBSP_STATE AUTO_STORAGE AUTO_RESIZE
- ------- -------------------- ---------- ---------- ------------ -----------
- 0 SYSCATSPACE SMS NORMAL 0 -
- 1 TEMPSPACE1 SMS NORMAL 0 -
- 2 USERSPACE1 DMS NORMAL 0 0
- 3 SYSTOOLSPACE DMS NORMAL 0 1
-
- 4 record(s) selected.
关于pagesize
PAGESIZE integer
Specifies the page size of the default buffer pool along with the initial table spaces (SYSCATSPACE, TEMPSPACE1, USERSPACE1) when the database is created. This also represents the default page size for all future CREATE BUFFERPOOL and CREATE TABLESPACE statements. The valid values for integer without the suffix K are 4 096, 8 192, 16 384, or 32 768. The valid values for integer with the suffix K are 4, 8, 16, or 32. At least one space is required between the integer and the suffix K. The default is a page size of 4 096 bytes (4 K).
关于 RESTRICTIVE
If the RESTRICTIVE parameter is present it causes the restrict_access database configuration parameter to be set to YES and no privileges or authorities are automatically granted to PUBLIC. If the RESTRICTIVE parameter is not present then the restrict_access database configuration parameter is set to NO and privileges are automatically granted to PUBLIC. For information about privileges, see: "Default privileges granted on creating a database".
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29023300/viewspace-2119612/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29023300/viewspace-2119612/