Chinaunix首页 | 论坛 | 博客
  • 博客访问: 223436
  • 博文数量: 119
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 1261
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-23 17:50
文章分类

全部博文(119)

文章存档

2016年(8)

2015年(78)

2014年(33)

我的朋友

分类: DB2/Informix

2014-09-15 16:22:41

db2 connect SQL30082N failed with reason 24

db2 grant connect on database to user USERNAME
db2 "select * from syscat.dbauth where grantee='USERNAME'"

### 授予权限后还是报同样的错误
[hostname:/db2home/db2inst2/sqllib/db2dump] #
[hostname:/db2home/db2inst2/sqllib/db2dump] # db2 connect to dbname user  USERNAME using 'xxxxxxx'
SQL30082N  Security processing failed with reason "24" ("USERNAME AND/OR
PASSWORD INVALID").  SQLSTATE=08001
[hostname:/db2home/db2inst2/sqllib/db2dump] #


db2 ?  SQL30082N

24       

         Solutions to specific problem causes described above are:

          
         1. Run DB2IUPDT to update the instance.
         2. Ensure that the username created is valid. Review the DB2
            General Naming Rules.
         3. Ensure that catalog information is correct.
         

### 发现OS id 是大写的         
[hostname:/db2home/db2inst2/sqllib/db2dump] # id username
User not found in /etc/passwd file
[hostname:/db2home/db2inst2/sqllib/db2dump] # id USERNAME
uid=238(USERNAME) gid=1(staff) groups=209(cmwauto)
[hostname:/db2home/db2inst2/sqllib/db2dump] #
         
         


2014-09-15-09.40.29.334627+120 I201587A437        LEVEL: Warning
PID     : 57671740             TID  : 5399        PROC : db2sysc 0
INSTANCE: db2inst2             NODE : 000         DB   : dbname
APPHDL  : 0-95
EDUID   : 5399                 EDUNAME: db2agent (dbname) 0
FUNCTION: DB2 UDB, bsu security, sqlexLogPluginMessage, probe:20
DATA #1 : String with size, 66 bytes
Password validation for user USERNAME failed with rc = -2146500502




### 自己在Linux下测试 , 发现大写用户会报同上的错误
[db2inst1@bbbbbb migration]$ db2 connect to bbb user AAAA using aaaa
SQL30082N  Security processing failed with reason "24" ("USERNAME AND/OR
PASSWORD INVALID").  SQLSTATE=08001
[db2inst1@bbbbbb migration]$


[db2inst1@bbbbbb migration]$ db2 connect to bbb user aaaa using aaaa

   Database Connection Information

 Database server        = DB2/LINUXX8664 9.7.8
 SQL authorization ID   = AAAA
 Local database alias   = BBB

[db2inst1@bbbbbb migration]$


### 最终找到官方的说明

%2Fcom.ibm.installingcm.doc%2Fdcmcw128.htm


Rules for user IDs
Some of these rules are specific to the platform you are working on. For example, there is a rule regarding the use of uppercase and lowercase letters in a name.

Linux, AIX? or Solaris
    Names must be in lowercase.
Windows
    Names can be in uppercase, lowercase, and mixed case.

Unless otherwise specified, all names can include the following characters:

    A through Z. When used in most names, characters A through Z are converted from lowercase to uppercase.
    0 through 9.
    ! % ( ) { } . – ^ ~ _ (underscore) @, #, $, and space.
    \ (backlash).

Restrictions:

    Names cannot begin with a number or with the underscore character.
    Do not use SQL reserved words to name tables, views, columns, indexes, or authorization IDs.
    Do not start the name of a system administration or a connection ID with SYS, SQL, IBM?, or sql.
阅读(7551) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~