1 DB2 安装后组情况
Users | User Desc | Username | Home folder | Password | Group |
Administration User | -dasusr1 | /home/dasusr1 | -passw0rd | Dasadm1 | |
DB2 Instance owner | -db2inst1 | /home/db2inst1 | -passw0rd | Db2dadm1 | |
Fenced user | -db2fenc1 | /home/db2fenc1 | -passw0rd | Db2iadm1 | |
DB User for Connection : | -lcuser | -passw0rd | Db2users |
2 创建系统用户
User Creation | |
useradd lcuser | |
passwd lcuser | |
Group cration | Groupadd -g db2users |
Add user to group | Usermod -G db2users lcuser |
Check the groups for one user | |
Su lcuser | |
Groups |
3 首先建立数据库,然后在这个数据库上建立表空间
Create db Nitro using codeset UTF-8 territory us PAGESIZE 32768 |
CONNECT TO NITRO |
CREATE BUFFERPOOL LARGE_BUFFER_POOL IMMEDIATE SIZE 250 PAGESIZE 32 K |
CONNECT RESET |
CONNECT TO NITRO |
CREATE USER TEMPORARY TABLESPACE LARGE_USERTEMP PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 16 OVERHEAD 10.5 PREFETCHSIZE 16 TRANSFERRATE 0.14 BUFFERPOOL LARGE_BUFFER_POOL |
CONNECT RESET |
小结
DB2下面的用户和oracle不一样,不是你在oracle系统里随便建,
DB2的用户是跟操作系统用户相关联的,比如你要添加一个用户,你先在操作系统上建个用户
然后再授权。
还有DB2下面的表空间建立是数据库想关联的,
首先建立数据库,然后在这个数据库上建立表空间
例如
01.db2 "CREATE DB TestDB using codeset UTF-8 territory us"
02.db2 CONNECT TO TestDB
03.db2 "CREATE BUFFERPOOL icmsbuffer SIZE 1000 PAGESIZE 32K"
04.db2 "CREATE TABLESPACE icmsspace PAGESIZE 32K MANAGED BY SYSTEM USING ('D:\db2admin\sqlt0003.0') BUFFERPOOL icmsbuffer"
而oracle下面应该是在某个实例下面,然后创建表空间,然后给建立用户,给用户分配默认访问的表空间。