2012-10-18 3 views
1

Je suis coincé avec un problème qui survient parfois autour de unixODBC et freeTDS. J'ai un serveur Web CentOS où je suis installé les fichiers de configuration que:Parfois isql ne se connecte pas et tsql le fait

odbc.ini:

[XYZ] 
Driver = FreeTDS 
Server = X.X.X.X 
Port = 1433 
Database = mydatabase 
TDS_Version = 8.0 

odbcinst.ini

[PostgreSQL] 
Description = ODBC for PostgreSQL 
Driver = /usr/lib/libodbcpsql.so 
Setup = /usr/lib/libodbcpsqlS.so 
FileUsage = 1 

[FreeTDS] 
Description = v0.82 with protocol v8.0 
Driver = /usr/local/lib/libtdsodbc.so 
Setup = /usr/local/lib/libtdsodbc.so 
UsageCount = 1 
Trace  = Yes 
TraceFile = /tmp/freetds.log 
ForceTrace = Yes 
FileUsage = 1 

[ODBC] 
;Trace = Yes 
;TraceFile = /tmp/freetds.log 
;ForceTrace = Yes 
;Pooling = No 

freetds.conf

# $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $ 
# 
# This file is installed by FreeTDS if no file by the same 
# name is found in the installation directory. 
# 
# For information about the layout of this file and its settings, 
# see the freetds.conf manpage "man freetds.conf". 

# Global settings are overridden by those in a database 
# server specific section 
[global] 
    # TDS protocol version 
    tds version = 8.0 

    # Whether to write a TDSDUMP file for diagnostic purposes 
    # (setting this to /tmp is insecure on a multi-user system) 
; dump file = /tmp/freetds.log 
; debug flags = 0xffff 

    # Command and connection timeouts 
; timeout = 10 
; connect timeout = 10 

# If you get out-of-memory errors, it may mean that your client 
    # is trying to allocate a huge buffer for a TEXT field. 
    # Try setting 'text size' to a more reasonable limit 
    text size = 64512 

# A typical Sybase server 
[egServer50] 
    host = symachine.domain.com 
    port = 5000 
    tds version = 5.0 

# A typical Microsoft server 
[egServer70] 
    host = ntmachine.domain.com 
    port = 1433 
    tds version = 7.0 

[XYZ] 
host = X.X.X.X 
port = 1433 
tds version = 8.0 

et faire isql -v XYZ nom d'utilisateur mot de passe quand il ne se connectera pas il donne ce journal de suivi:

[ODBC][22870][__handles.c][444] 
     Exit:[SQL_SUCCESS] 
      Environment = 0x938ab58 
[ODBC][22870][SQLAllocHandle.c][345] 
     Entry: 
      Handle Type = 2 
      Input Handle = 0x938ab58 
[ODBC][22870][SQLAllocHandle.c][463] 
     Exit:[SQL_SUCCESS] 
      Output Handle = 0x938b130 
[ODBC][22870][SQLConnect.c][3549] 
     Entry:    
      Connection = 0x938b130    
      Server Name = [XYZ][length = 14 (SQL_NTS)]    
      User Name = [username][length = 11 (SQL_NTS)]    
      Authentication = [*************][length = 13 (SQL_NTS)] 
     UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE 'UCS-2LE' 

     DIAG [42000] [FreeTDS][SQL Server]Login failed for user 'username'. 

     DIAG [42000] [FreeTDS][SQL Server]Cannot open database "mydatabase" requested by the login. The login failed. 

     DIAG [S1000] [FreeTDS][SQL Server]Unable to connect to data source 

[ODBC][22870][SQLConnect.c][3917] 
     Exit:[SQL_ERROR] 
[ODBC][22870][SQLError.c][424] 
     Entry:     
      Connection = 0x938b130     
      SQLState = 0xbf8ba54e     
      Native = 0xbf8ba350     
      Message Text = 0xbf8ba359     
      Buffer Length = 500     
      Text Len Ptr = 0xbf8ba356 
[ODBC][22870][SQLError.c][461] 
     Exit:[SQL_SUCCESS]      
      SQLState = S1000      
      Native = 0xbf8ba350 -> 0      
      Message Text = [[unixODBC][FreeTDS][SQL Server]Unable to connect to data source] 
[ODBC][22870][SQLError.c][424] 
     Entry:     
      Connection = 0x938b130     
      SQLState = 0xbf8ba54e     
      Native = 0xbf8ba350     
      Message Text = 0xbf8ba359     
      Buffer Length = 500     
      Text Len Ptr = 0xbf8ba356 
[ODBC][22870][SQLError.c][461] 
     Exit:[SQL_SUCCESS]      
      SQLState = 37000      
      Native = 0xbf8ba350 -> 4060      
      Message Text = [[unixODBC][FreeTDS][SQL Server]Cannot open database "mydatabase" requested by the login. The login failed.] 
[ODBC][22870][SQLError.c][424] 
     Entry:     
      Connection = 0x938b130     
      SQLState = 0xbf8ba54e     
      Native = 0xbf8ba350     
      Message Text = 0xbf8ba359     
      Buffer Length = 500     
      Text Len Ptr = 0xbf8ba356 
[ODBC][22870][SQLError.c][461] 
     Exit:[SQL_SUCCESS]      
      SQLState = 37000      
      Native = 0xbf8ba350 -> 18456      
      Message Text = [[unixODBC][FreeTDS][SQL Server]Login failed for user 'username'.] 
[ODBC][22870][SQLError.c][424] 
     Entry:     
      Connection = 0x938b130     
      SQLState = 0xbf8ba54e     
      Native = 0xbf8ba350     
      Message Text = 0xbf8ba359     
      Buffer Length = 500     
      Text Len Ptr = 0xbf8ba356 
[ODBC][22870][SQLError.c][461] 
     Exit:[SQL_NO_DATA] 
[ODBC][22870][SQLError.c][504] 
     Entry:     
      Environment = 0x938ab58     
      SQLState = 0xbf8ba54e     
      Native = 0xbf8ba350     
      Message Text = 0xbf8ba359     
      Buffer Length = 500     
      Text Len Ptr = 0xbf8ba356 
[ODBC][22870][SQLError.c][541] 
     Exit:[SQL_NO_DATA] 
[ODBC][22870][SQLFreeHandle.c][268] 
     Entry: 
      Handle Type = 2 
      Input Handle = 0x938b130 
[ODBC][22870][SQLFreeHandle.c][317] 
     Exit:[SQL_SUCCESS] 
[ODBC][22870][SQLFreeHandle.c][203] 
     Entry: 
      Handle Type = 1 
      Input Handle = 0x938ab58 

lorsque la commande tsql fonctionne ... que pourrait-on faire?

la version unixODBC est 2.2.11-7.1 et FreeTDS ne semble pas installé, mais il y est car il y a libtdsodbc.so présent dans/usr/local/lib ..

Je dois aussi dire que avec un redémarrage complet de la machine CentOS isql fonctionne bien ...

Que puis-je faire ou vérifier? Merci beaucoup d'avance!

Cheers, Luigi

Répondre

0

vous devez fixer odbc.ini d'avoir un nomserveur tel que configuré à freetds.conf

instead of "Server = x.x.x.x" put "servername = XYZ"