[DB2] SQL30082N Security processing failed with reason “1” (“PASSWORD EXPIRED”). SQLSTATE=08001

ใช้ DB2 บน Docker มา 7-8 เดือน วันนี้พี่ในทีมบอกว่า เฮ้ยยย Database เป็นอะไร Login เข้าไม่ได้ครับ โดย Error Message คือ

SQL30082N Security processing failed with reason "1" ("PASSWORD EXPIRED").
SQLSTATE=08001

ก่อนอื่นมาดูกันก่อนครับ มันเป็นที่ DB2 หรือป่าว ? คำตอบไม่เกี่ยวกับ DB2 เลยครับ เพราะ ตัว DB2 ไม่ได้จดจำ Username หรือ Password ของ Database เลยครับ สิ่งที่ DB2 ทำ คือ เชื่อใน OS ครับ เอาง่ายๆ

DB2 ฝากหน้าที่การตรวจสอบตัวตนให้ใช้งานของ OS

จากงานข้างต้นแสดงว่าการแก้ปัญหาไม่ได้มาจาก DB2 ครับ ต้องไปจัดการสิทธิของ User ใน OS ครับ อย่างผมใช้ CentOS ใน Docker IBM DB2 ครับ โดยคำสั่งที่ใช้ในการเปลี่ยน Password Expire ของ CentOS มี ดังนี้ครับ

  • แบบที่ 1 : กำหนดไม่ให้ Password Expire เลยครับ - เหมาะสำหรับเครื่อง Development ครับ
    • คำสั่ง  chage -m 0 -M 99999 -I -1 -E -1 <<username>>
    • ตัวอย่าง  chage -m 0 -M 99999 -I -1 -E -1 invest
    • ตรวจสอบผลลัพธ์ด้วยคำสั่ง chage -l <<username>>  โดยผลลัพธ์ที่ได้
[root@d9f4da8f7ddc /]# chage -l invest 
Last password change : Aug 01, 2018
Password expires : never
Password inactive : never
Account expires	: never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
  • แบบที่ 2 : กำหนดจำนวนวันที่ Password Expire ครับ – เหมาะสำหรับเครืองที่มี Policy กำหนดไว้ โดยใช้ parameter -M  โดยกำหนดวันจำนวน 120 วัน
    • คำสั่ง  chage -M 120 <<username>>
    • ตัวอย่าง  chage -M 120 invest
    • ตรวจสอบผลลัพธ์ด้วยคำสั่ง chage -l <<username>>  โดยผลลัพธ์ที่ได้
[root@d9f4da8f7ddc /]# chage -l invest
 Last password change : Jan 25, 2018
 Password expires : May 25, 2018
 Password inactive : never
 Account expires : never
 Minimum number of days between password change : 0
 Maximum number of days between password change : 120
 Number of days of warning before password expires : 7

เรื่องจุกจิของ DB บ่อยครั้งทีม DEVELOPER ก็ต้องรู้บ้างครับ ^__^


Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts to your email.