在開啟dbcc連線資料庫檢視資料庫配置引數時提示SQL1337錯誤

longan_plot發表於2013-11-22
在開啟dbcc連線資料庫檢視資料庫配置引數時提示SQL1337錯誤,檢視IBM的infocenter錯誤解釋如下:


SQL1337N
找不到服務 服務名稱。


說明
系統不能解析與服務名稱相關的埠號。可能的原因為:
編目 TCP/IP 節點時,指定的服務名稱值不正確。
指定了正確的服務名稱,但未在客戶機 services 檔案中對其進行定義。
聯合系統使用者:資料來源也可能會檢測到此情況。


使用者響應
確保編目 TCP/IP 節點時指定的服務名稱正確,且它是在本地 services 檔案中定義的。


聯合系統使用者還必須確保在資料來源上的 services 檔案中定義了該名稱。
[db2inst1@db2 ~]$ db2 list db directory


 System Database Directory


 Number of entries in the directory = 2


Database 1 entry:


 Database alias                       = MYSAMP
 Database name                        = SAMPLE
 Node name                            = MYNODE
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Remote
 Catalog database partition number    = -1
 Alternate server hostname            =
 Alternate server port number         =


Database 2 entry:


 Database alias                       = SAMPLE
 Database name                        = SAMPLE
 Local database directory             = /home/db2inst1
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =
[db2inst1@db2 ~]$ db2 list node directory --檢視node資訊,發現 Service name與/etc/services裡的名稱不一樣


 Node Directory


 Number of entries in the directory = 1


Node 1 entry:


 Node name                      = MYNODE
 Comment                        =
 Directory entry type           = LOCAL
 Protocol                       = TCPIP
 Hostname                       = db2
 Service name                   = db2int1
[root@db2 etc]# tail -n 4  services
DB2_db2inst1    60000/tcp
DB2_db2inst1_1  60001/tcp
DB2_db2inst1_2  60002/tcp
DB2_db2inst1_END        60003/tcp
[db2inst1@db2 ~]$ db2 get dbm cfg | grep -i svcename
 TCP/IP Service name                          (SVCENAME) = DB2_db2inst1
 SSL service name                         (SSL_SVCENAME) = 


刪除節點、資料庫目錄資訊,重建後恢復正常:
[db2inst1@db2 ~]$ db2 uncatalog database SAMPLE
DB20000I  The UNCATALOG DATABASE command completed successfully.
DB21056W  Directory changes may not be effective until the directory cache is 
refreshed.
[db2inst1@db2 ~]$ db2 list db directory


 System Database Directory


 Number of entries in the directory = 1


Database 1 entry:


 Database alias                       = MYSAMP
 Database name                        = SAMPLE
 Node name                            = MYNODE
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Remote
 Catalog database partition number    = -1
 Alternate server hostname            =
 Alternate server port number         =


[db2inst1@db2 ~]$ db2 uncatalog node MYNODE
DB20000I  The UNCATALOG NODE command completed successfully.
DB21056W  Directory changes may not be effective until the directory cache is 
refreshed.
[db2inst1@db2 ~]$ db2 list node directory
SQL1037W  The node directory is empty.  SQLSTATE=01606
[db2inst1@db2 ~]$ db2 catalog tcpip node testnode remote 192.168.2.30 server DB2_db2inst1
DB20000I  The CATALOG TCPIP NODE command completed successfully.
DB21056W  Directory changes may not be effective until the directory cache is 
refreshed.
[db2inst1@db2 ~]$ db2 list node directory


 Node Directory


 Number of entries in the directory = 1


Node 1 entry:


 Node name                      = TESTNODE
 Comment                        =
 Directory entry type           = LOCAL
 Protocol                       = TCPIP
 Hostname                       = 192.168.2.30
 Service name                   = DB2_db2inst1


[db2inst1@db2 ~]$ db2 catalog database sample at node TESTNODE
DB20000I  The CATALOG DATABASE command completed successfully.
DB21056W  Directory changes may not be effective until the directory cache is 
refreshed.
[db2inst1@db2 ~]$ db2 list db directory


 System Database Directory


 Number of entries in the directory = 2


Database 1 entry:


 Database alias                       = MYSAMP
 Database name                        = SAMPLE
 Node name                            = MYNODE
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Remote
 Catalog database partition number    = -1
 Alternate server hostname            =
 Alternate server port number         =


Database 2 entry:


 Database alias                       = SAMPLE
 Database name                        = SAMPLE
 Node name                            = TESTNODE
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Remote
 Catalog database partition number    = -1
 Alternate server hostname            =
 Alternate server port number         =

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27015256/viewspace-777296/,如需轉載,請註明出處,否則將追究法律責任。

相關文章