Linux Use ODBC Connect Oracle
因為工作需要,需要使用ODBC訪問Oracle,下面是ODBC訪問Oracle的具體配置
1.下載unixODBC和Oracle簡易客戶端軟體包
1.1下載地址:
1.1.1下載檔案:
unixODBC-2.3.0.tar.gz
2 Oracle ODBC Driver
2.1下載地址:
2.1.1下載檔案:
instantclient-sqlplus-linux.x64-12.2.0.1.0.zip instantclient-basic-linux.x64-12.2.0.1.0.zip instantclient-sdk-linux.x64-12.2.0.1.0.zip instantclient-jdbc-linux.x64-12.2.0.1.0.zip instantclient-odbc-linux.x64-12.2.0.1.0-2.zip instantclient-basiclite-linux.x64-12.2.0.1.0.zip instantclient-tools-linux.x64-12.2.0.1.0.zip
將這些軟體包上傳到/soft目錄
3.安裝unixODBC(root使用者)
#cd /soft #tar xvf unixODBC-2.3.0.tar.gz #cd /soft/unixODBC-2.3.0 #./configure #make #make install
(預設是被安裝到/usr/local)
4.安裝Oracle ODBC(root使用者)
#cd /soft/ #unzip instantclient-sqlplus-linux.x64-12.2.0.1.0.zip #unzip instantclient-basic-linux.x64-12.2.0.1.0.zip #unzip instantclient-sdk-linux.x64-12.2.0.1.0.zip #unzip instantclient-jdbc-linux.x64-12.2.0.1.0.zip #unzip instantclient-odbc-linux.x64-12.2.0.1.0-2.zip #unzip instantclient-basiclite-linux.x64-12.2.0.1.0.zip #unzip instantclient-tools-linux.x64-12.2.0.1.0.zip
[root@dmks instantclient_12_2]# ./odbc_update_ini.sh /usr/local *** ODBCINI environment variable not set,defaulting it to HOME directory!
更新操作完成後,會在/usr/local/etc/odbcinst.ini增加Oracle12C的驅動描述資訊。
[root@dmks etc]# cat odbcinst.ini [DM7 ODBC DRIVER] Description = ODBC DRIVER FOR DM7 Driver = /dm_home/dmdbms/bin/libdodbc.so [Oracle 12c ODBC driver] Description = Oracle ODBC driver for Oracle 12c Driver = /soft/instantclient_12_2/libsqora.so.12.1 Setup = FileUsage = CPTimeout = CPReuse =
並且會在HOME目錄下也就是/root,生成.odbc.ini檔案,修改.odbc.ini檔案
[root@dmks ~]# cat .odbc.ini [OracleODBC-12c] Application Attributes = T Attributes = W BatchAutocommitMode = IfAllSuccessful BindAsFLOAT = F CloseCursor = F DisableDPM = F DisableMTS = T Driver = Oracle 12c ODBC driver DSN = OracleODBC-12c 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 ServerName = shardcat 與tnsnames.ora檔案中的伺服器一致 SQLGetData extensions = F Translation DLL = Translation Option = 0 DisableRULEHint = T UserID = StatementCache=F CacheBufferSize=20 UseOCIDescribeAny=F SQLTranslateErrors=F MaxTokenSize=8192 AggregateSQLType=FLOAT
5.測試ODBC連線Oracle
[root@dmks ~]# isql OracleODBC-12c system xxzx7817600 -v +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> select * from v$version; +---------------------------------------------------------------------------------+-----------------------------------------+ | BANNER | CON_ID | +---------------------------------------------------------------------------------+-----------------------------------------+ | Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production | 0 | | PL/SQL Release 12.2.0.1.0 - Production | 0 | | CORE 12.2.0.1.0 Production | 0 | TNS for Linux: Version 12.2.0.1.0 - Production | 0 | | NLSRTL Version 12.2.0.1.0 - Production | 0 | +---------------------------------------------------------------------------------+-----------------------------------------+
到此使用odbc連線Oracle的操作完成,還是很簡單的。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2682753/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Python connect zookeeper use the kazoo modulePython
- Laravel connect oracleLaravelOracle
- Linux下ODBC安裝配置Linux
- Oracle/MySQL透過odbc訪問PostgreSQL for LightDBOracleMySql
- Oracle start with connect by PostgreSQL recursive cteOracleSQL
- [20181224]使用odbc連線oracle資料庫.txtOracle資料庫
- PostgreSQL Oracle 相容性 - connect by 2SQLOracle
- DM8 Linux環境下配置ODBCLinux
- Zabbix5.0 配置 ODBC 監控 Oracle 資料庫Oracle資料庫
- use azure data studio to create external table for oracleOracle
- Oracle的SYS_CONNECT_BY_PATH函式Oracle函式
- [轉載] Oracle:start with...connect by子句的用法Oracle
- C#/C++ 透過ODBC連線OceanBase Oracle租戶C#C++Oracle
- Ubuntu 16.04下安裝Oracle資料庫的ODBC驅動UbuntuOracle資料庫
- 64位win10新增oracle odbc驅動時提示無法載入oracle怎麼辦Win10Oracle
- Oracle透過ODBC連線SQL Server資料庫後ORA-12514OracleSQLServer資料庫
- Linux下ODBC連線HGDB報Could not SQLConnect錯解決方法LinuxSQL
- Oracle案例09——ORA-12154: TNS:could not resolve the connect identifier specifiedOracleIDE
- 【Linux】curl: (35) SSL connect error問題處理LinuxError
- 【轉載】Kano Model — Ways to use it and NOT use it
- Connect SQL Server from Linux Client using Windows Authentication and troubleshoot stepsSQLServerLinuxclientWindows
- 從Linux原始碼看Socket(TCP)Client端的ConnectLinux原始碼TCPclient
- openGauss ODBC介面參考
- nginx useNginx
- ubuntu wps odbc 連線sqliteUbuntuSQLite
- 【CONNECT】Oracle連線方式詳細介紹(專用/共享伺服器)Oracle伺服器
- Linux安裝oracleLinuxOracle
- Laravel 通過 ODBC 連線 VerticaLaravel
- mysql odbc delphi連線問題MySql
- Be better to use NPMNPM
- WireGuard Use Notes
- plsql use skillsSQL
- database的connectDatabase
- AUTO START ORACLE ON LINUX(zt)OracleLinux
- win10怎麼修改odbc預設5.1 win10配置odbc為5.1方法Win10
- Oracle優化案例-定位start with connect by遞迴死迴圈資料(二十二)Oracle優化遞迴
- Oracle Linux 6.5 安裝Oracle 10gR2LinuxOracle 10g
- Use PHP7PHP