在打开dbcc连接数据库查看数据库配置参数时提示SQL1337错误

在打开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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/27015256/viewspace-777296/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值