Search code examples
unixodbcdsnisql

when use isql,i got this: [IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified


when i type fllow command: isql dsnOracle -v
i got :

  [IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
    [ISQL]ERROR: Could not SQLConnect

my config file:

        [root@localhost lib]# cat /etc/odbc.ini 
        [dsnOracle]
        Description = data source to oracle
        Driver = Oracle
        Servername = PARA_ORACLE
        port = 1521
        [root@localhost lib]# cat /etc/odbcinst.ini 
        [Oracle]
        Description = ODBC for Oracle 
        Driver  = /usr/lib/libsqora.so.11.1
        [root@localhost lib]# cat $TNS_ADMIN/tnsnames.ora 
        PARA_ORACLE =    
        (DESCRIPTION =     
            (ADDRESS_LIST =   (ADDRESS = (PROTOCOL = TCP)(HOST = 172.100.2.13)(PORT = 1521))         )    
             (CONNECT_DATA =               
             (SERVER = DEDICATED)      
             (SERVICE_NAME = orcl)        
            )  
        )
[root@localhost lib]# rpm -qa |grep oracle
oracle-instantclient11.2-odbc-11.2.0.1.0-1.x86_64
oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64
[root@localhost lib]# rpm -qa |grep ODBC
unixODBC-2.2.14-12.el6_3.x86_64

i have try for a long time ,but i always get :data source name not found . (it's there any relation with x86 or x64?). any suggestion is fine for me.


Solution

  • finally i change my /etc/odbc.ini like this and it works.

    [dsnOracle]
    Application Attributes=T
    Attributes=W
    BatchAutocommitMode=IfAllSuccessful
    BindAsFLOAT=F
    CloseCursor=F
    DisableDPM=F
    DisableMTS=T
    Driver=Oracle
    DSN=OracleODBC-11g
    EXECSchemaOpt=
    EXECSyntax=T
    Failover=T
    FailoverDelay=10
    FailoverRetryCount=10
    FetchBufferSize=64000
    ForceWCHAR=F
    Lobs=T
    Longs=T
    MaxLargeData=0
    MetadataIdDefault=F
    QueryTimeout=T
    ResultSets=T
    SQLGetData extensions=F
    Translation DLL=
    Translation Option=0
    DisableRULEHint=T
    StatementCache=F
    CacheBufferSize=20
    UseOCIDescribeAny=F
    UserID=userid
    ServerName=PARA_ORACLE
    Password=password