当使用isql时,我得到了这个:[IM002] [unixODBC] [驱动程序管理器]找不到数据源名称,并且没有指定默认驱动程序

时间:2017-01-04 03:26:33

标签: unixodbc dsn isql

当我键入fllow命令时:isql dsnOracle -v
 我得到了:

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

我的配置文件:

        [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

我已经尝试了很长时间,但我总是得到:找不到数据源名称。 (它与x86或x64有什么关系?)。 任何建议都适合我。

1 个答案:

答案 0 :(得分:0)

最后我改变了我的/etc/odbc.ini,这样就行了。

[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