程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> DB2數據庫 >> DB2教程 >> DB2創建用戶的方法

DB2創建用戶的方法

編輯:DB2教程

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

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved