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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to use Form6i connect Oracle 10gORMOracle 10g
- Python connect zookeeper use the kazoo modulePython
- Linux平臺Oracle ODBC安裝使用LinuxOracle
- GPFS use with OracleOracle
- java.net.bindexception:address already in use: connectJavaIndexException
- Oracle connect byOracle
- oracle hint_use_concat_use_nl_with_indexOracleIndex
- In Oracle,How to use dumpOracle
- Linux下ODBC安裝配置Linux
- Laravel connect oracleLaravelOracle
- Oracle “CONNECT BY” 使用Oracle
- oracle connect by用法Oracle
- Oracle Start with ....Connect ByOracle
- Linux Hugepage ,AMM及 USE_LARGE_PAGES for oracle 11GLinuxOracle
- linux下配置ODBC連線MySqlLinuxMySql
- java 連線oracle (jdbc-odbc橋)JavaOracleJDBC
- oracle連線SQLserver--通過ODBCOracleSQLServer
- START WITH and CONNECT BY in Oracle SQLOracleSQL
- How to use hints in Oracle sql for performanceOracleSQLORM
- oracle hints ? use_hash ? ordered ?Oracle
- Config and Use of Device Mapper Multipathing on Oracle Linux (OL)_555603.1devAPPOracleLinux
- Microsoft? ODBC Driver 11 for SQL Server? - RedHat LinuxROSSQLServerRedhatLinux
- Oracle Hint:USE_NL、USE_MERGE、UESE_HASH(原理)Oracle
- Oracle使用DG4ODBC連線MySQLOracleMySql
- AIX平臺Oracle ODBC安裝手冊AIOracle
- Use xming to xlogin linuxLinux
- oracle中start with connect by priorOracle
- oracle的connect by語句Oracle
- 【函式】Oracle “CONNECT BY” 使用函式Oracle
- Oracle Connect By Prior 詳解Oracle
- DM8 Linux環境下配置ODBCLinux
- Oracle/MySQL透過odbc訪問PostgreSQL for LightDBOracleMySql
- ORACLE資料表匯出成EXCEL格式(ODBC)OracleExcel
- Oracle start with connect by PostgreSQL recursive cteOracleSQL
- Oracle Connect by 單行變多行Oracle
- Oracle Easy Connect Naming methodOracle
- 轉:Oracle 解鎖Record is locked by another useOracle
- Zabbix5.0 配置 ODBC 監控 Oracle 資料庫Oracle資料庫