db2手工建库


环境说明
CentOS6.5

  1. [db2inst3@kvm101 newtb]$ db2level
  2. DB21085I This instance or install (instance name, where applicable:
  3. "db2inst3") uses "64" bits and DB2 code release "SQL10014" with level
  4. identifier "0205010E".
  5. Informational tokens are "DB2 v10.1.0.4", "s140509", "IP23584", and Fix Pack
  6. "4".
  7. Product is installed at "/opt/ibm/db2/V10.1.0.5".

创建数据库


  1. mkdir -p /home/db2inst3/test

  2. db2 "create database testdb
  3. AUTOMATIC STORAGE NO
  4. on /home/db2inst3/test
  5. ALIAS test
  6. using codeset GBK
  7. territory zh_CN
  8. collate using identity
  9. PAGESIZE 8 k
  10. RESTRICTIVE
  11. catalog tablespace managed by system
  12.     using ('/home/db2inst3/test/catalog/')
  13. TEMPORARY tablespace managed by system
  14.     using ('/home/db2inst3/test/temp/')
  15. user tablespace managed by database
  16.     using (file '/home/db2inst3/test/user/usertab.file' 65000)"

test下表空间的目录和文件可以不用预创建


  1. [db2inst3@kvm101 test]$ du -sh *
  2. 93M catalog
  3. 14M db2inst3
  4. 8.0K temp
  5. 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         =


使用非自动存储管理,创建后的表空间情况


  1. TBSP_ID TBSP_NAME TBSP_TYPE TBSP_STATE AUTO_STORAGE AUTO_RESIZE
  2. ------- -------------------- ---------- ---------- ------------ -----------
  3.       0 SYSCATSPACE SMS NORMAL 0 -
  4.       1 TEMPSPACE1 SMS NORMAL 0 -
  5.       2 USERSPACE1 DMS NORMAL 0 0
  6.       3 SYSTOOLSPACE DMS NORMAL 0 1

  7.   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/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值