DB2資料庫的SQL1042C錯誤解決案例

來源:互聯網
上載者:User

 測試機上一個老的DB2資料庫在正常停庫後,在啟庫時報SQL1042C錯誤。具體資訊如下:

# su - db2inst1

 

$ db2start

2013-04-23 13:23:08     0   0   SQL1042C  An unexpected system error occurred.

SQL1032N  No start database manager command was issued.  SQLSTATE=57019

 

這個錯誤必須要檢查的資訊:

o    看看檔案系統的空間是否足夠 

o    查看是否有足夠的記憶體和交換/調頁空間可用 

o    系統時間和日期設定正確,關係到db2授權許可的到期 

o    查看追蹤檔案,db2diag.log裡面的內容來確認問題的所在 

經過檢查,前三個問題正常。現在查看DB2DIAG.LOG日誌,有如下資訊需注意

 

PID     : 1388642              TID  : 1           PROC : db2star2

INSTANCE: db2inst1             NODE : 000

FUNCTION: DB2 UDB, base sys utilities, LicCheckProcessors, probe:20

MESSAGE : ADM12017E  The number of processors on this machine exceeds the 

          defined entitlement of "1" for the product "DB2 Enterprise Server 

          Edition". The number of processors on this machine is "2". You should 

          purchase additional processor based entitlements from your IBM 

          representative or authorized dealer and update your license using the 

          License Center or the db2licm command line utility. For more 

          information on updating processor based licenses, refer to the Quick 

          Beginnings manual for your platform. For more information on the 

          db2licm utility, refer to the DB2 Command Reference.

這個問題CPU的授權許可,關於這個問題可以查看一下許可檔案資訊

 

$ db2licm -l

Product Name                            = "DB2 Enterprise Server Edition"

Product Identifier                      = "DB2ESE"

Version Information                     = "8.2"

Expiry Date                             = "Permanent"

Registered Connect User Policy          = "Disabled"

Number Of Entitled Connect Users        = "5"

Enforcement Policy                      = "Soft Stop"

Number of processors                    = "2"

Number of licensed processors           = "1"

Database partitioning feature           = "Not entitled"

Annotation                              = ""

Other information                       = ""

 

Product Name                            = "DB2 High Availability Disaster Recovery 

 

Option"

Product Identifier                      = "DB2HADR"

Version Information                     = "8.2"

Expiry Date                             = "Permanent"

Annotation                              = ""

Other information                       = ""

 

Product Name                            = "DB2 Advanced Security Option"

Product Identifier                      = "DB2ASO"

Version Information                     = "8.2"

Expiry Date                             = "Permanent"

Annotation                              = ""

Other information                       = ""    

如果你注意到紅色的兩行,將會發現系統處理器的個數與授權個數不一樣。這種情況下,使用db2licm -n “DB2ESE” 2 (註:2對應系統的處理器個數)即可。命令如下:#/home/db2inst1/sqllib/adm/db2licm -n "DB2ESE" 2DBI1418I The number of licensed processors on this system has           been updated successfully.  
 然後再看,CPU許可已變過來了。

$ db2licm -l

Product Name                            = "DB2 Enterprise Server Edition"

Product Identifier                      = "DB2ESE"

Version Information                     = "8.2"

Expiry Date                             = "Permanent"

Registered Connect User Policy          = "Disabled"

Number Of Entitled Connect Users        = "5"

Enforcement Policy                      = "Soft Stop"

Number of processors                    = "2"

Number of licensed processors           = "2"

Database partitioning feature           = "Not entitled"

Annotation                              = ""

Other information                       = ""

 

Product Name                            = "DB2 High Availability Disaster Recovery 

 

Option"

Product Identifier                      = "DB2HADR"

Version Information                     = "8.2"

Expiry Date                             = "Permanent"

Annotation                              = ""

Other information                       = ""

 

Product Name                            = "DB2 Advanced Security Option"

Product Identifier                      = "DB2ASO"

Version Information                     = "8.2"

Expiry Date                             = "Permanent"

Annotation                              = ""

Other information                       = ""   

 再啟資料庫發現依然報SQL1042C錯誤

 

$ db2start

2013-04-23 13:59:28     0   0   SQL1042C  An unexpected system error occurred.

SQL1032N  No start database manager command was issued.  SQLSTATE=57019

 

繼續查看日誌發現有如下資訊:PID     : 315522               TID  : 1           PROC : db2sysc 0INSTANCE: db2inst1             NODE : 000FUNCTION: DB2 UDB, oper system services, sqloRunInstance, probe:210CALLED  : OS, -, unspecified_system_functionOSERR   : EPERM (1) "Not owner" 針對這個問題,可以用如下方法解決:

1) 停止所有DB2進程

#ps -ef | grep db2

如有DB2進程,可以強制終止(kill),確保所有DB2進程已終止;

 

2) 執行以下語句

#/usr/opt/db2_08_01/instance/db2iupdt tstdb   #執行個體名

or

#/usr/opt/db2_08_01/instance/db2iupdt -e

 

db2inst1

db2inst2

DBI1070I Program db2iupdt completed successfully.  

註:更新執行個體,用於執行個體獲得一些新的產品選項特別是更改後)或修訂包的訪問權。 


然後再啟

 

$ db2start

2013-04-23 14:23:39     0   0   SQL1063N  DB2START processing was successful.

SQL1063N  DB2START processing was successful.

$ db2 connect to tstdb 

 

   Database Connection Information

 

 Database server        = DB2/6000 8.2.3

 SQL authorization ID   = DB2INST1

 Local database alias   = tstdb 

最後資料庫終於起來了,經測試一切正常。 

 

二維碼 BKJIA滴水穿石

650) this.width=650;" alt="" border="0" src="http://www.bkjia.com/uploads/allimg/131228/22560962O-0.jpg" />

  

本文出自 “滴水穿石” 部落格,請務必保留此出處http://xjsunjie.blog.51cto.com/999372/1184826

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.