DB2创建用户是很常见的操作,下面就为您详细介绍DB2创建用户的方法,如果您在DB2创建用户方面遇到过类似的问题,不妨一看。
1.创建实例用户
mkdir /db2/db2test 创建实例用户目录
smitty user
选择Add a User
* User NAME [db2test]
User ID []
ADMINISTRATIVE USER? false
Primary GROUP [db2iadm1]
Group SET [staff]
ADMINISTRATIVE GROUPS []
ROLES []
Another user can SU TO USER? true
SU GROUPS [ALL]
HOME directory [/db2/db2test]
Initial PROGRAM [/usr/bin/ksh]
2.创建实例 DB2_install=/usr/opt/db2_08_01/instance
./db2icrt -u db2test db2test
3.创建数据库
su - db2test
db2start #此处不执行启动实例将报:SQL1032N No start database manager command was issued. SQLSTATE=57019
db2 create db db2test
4.删除数据库
db2 drop db db2test
db2stop
5.删除实例
cd DB2_install
./db2idrop -f db2test # -f参数一定要添加否则删除完了会报错!
6.删除用户
smitty user
选择Remove a User
* User NAME [db2test] +
Remove AUTHENTICATION information? yes
删除用户目录
rm -rf db2test
【编辑推荐】