码迷,mamicode.com
首页 > 数据库 > 详细

db2创建数据库

时间:2018-01-24 19:50:09      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:ora   err   temp   using   tor   schema   immediate   space   导数据   

1.在实例用户用户下执行
db2 create database CPM on /home/db2inst1/CPM using codeset UTF-8 territory CN pagesize 32768
2.对smart用户进行赋权
db2 connect to CPM
db2 grant connect on database to user smart
db2 grant dbadm on database to user smart
3.创建schema
db2 create schema CPM authorization smart

4.创建缓存池
db2 CREATE BUFFERPOOL "CPMPOOL" IMMEDIATE SIZE 100000 NUMBLOCKPAGES 0 PAGESIZE 32 K;

5.创建临时表空间
db2 CREATE USER TEMPORARY TABLESPACE "TMPCPM" PAGESIZE 32K MANAGED BY automatic storage EXTENTSIZE 32 PREFETCHSIZE AUTOMATIC BUFFERPOOL "CPMPOOL" OVERHEAD 7.50 TRANSFERRATE 0.06 DROPPED TABLE RECOVERY OFF;

6.
db2 CREATE LARGE TABLESPACE "TSP_CPM" PAGESIZE 32K MANAGED BY automatic storage EXTENTSIZE 32 PREFETCHSIZE AUTOMATIC BUFFERPOOL "CPMPOOL" OVERHEAD 7.50 TRANSFERRATE 0.06 DROPPED TABLE RECOVERY On;

7.
db2 CREATE LARGE TABLESPACE "TSP_LOG" PAGESIZE 32K MANAGED BY automatic storage EXTENTSIZE 32 PREFETCHSIZE AUTOMATIC BUFFERPOOL "CPMPOOL" OVERHEAD 7.50 TRANSFERRATE 0.06 DROPPED TABLE RECOVERY ON;

8.
db2 CREATE LARGE TABLESPACE "TSP_INDEX" PAGESIZE 32K MANAGED BY automatic storage EXTENTSIZE 32 PREFETCHSIZE AUTOMATIC BUFFERPOOL "CPMPOOL" OVERHEAD 7.50 TRANSFERRATE 0.06 DROPPED TABLE RECOVERY ON;

导数据
db2 set current schema CPM;

db2创建数据库

标签:ora   err   temp   using   tor   schema   immediate   space   导数据   

原文地址:https://www.cnblogs.com/restart30/p/8342818.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!