Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux Use ODBC Connect Oracle

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Because of the need of work, you need to use ODBC to access Oracle. Here is the specific configuration for ODBC to access Oracle.

1. Download unixODBC and Oracle easy client packages

1.1 download address:

Http://www.unixodbc.org/

1.1.1 download file:

UnixODBC-2.3.0.tar.gz

2 Oracle ODBC Driver

2.1 download address:

Http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

2.1.1 download file:

Instantclient-sqlplus-linux.x64-12.2.0.1.0.zipinstantclient-basic-linux.x64-12.2.0.1.0.zipinstantclient-sdk-linux.x64-12.2.0.1.0.zipinstantclient-jdbc-linux.x64-12.2.0.1.0.zipinstantclient-odbc-linux.x64-12.2.0.1.0-2.zipinstantclient-basiclite-linux.x64-12.2.0.1.0.zipinstantclient-tools-linux.x64-12.2.0.1.0.zip

Upload these packages to the / soft directory

3. Install unixODBC (root user)

# cd / soft#tar xvf unixODBC-2.3.0.tar.gz#cd / soft/unixODBC-2.3.0#./configure#make#make install

(default is installed to / usr/local)

4. Install Oracle ODBC (root user)

# 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!

After the update operation is completed, the driver description of the Oracle12C will be added to / usr/local/etc/odbcinst.ini.

[root@dmks etc] # cat odbcinst.ini [DM7 ODBC DRIVER] Description = ODBC DRIVER FOR DM7Driver = / dm_home/dmdbms/bin/ libdodbc.so [Oracle 12c ODBC driver] Description = Oracle ODBC driver for Oracle 12cDriver = / soft/instantclient_12_2/libsqora.so.12.1Setup = FileUsage = CPTimeout = CPReuse =

And in the HOME directory, that is, / root, generate the .odbc.ini file and modify the .odbc.ini file.

[root@dmks ~] # cat .odbc.ini [OracleODBC-12c] Application Attributes = TAttributes = WBatchAutocommitMode = IfAllSuccessfulBindAsFLOAT = FDisableDPM = TDriver = Oracle 12c ODBC driverDSN = OracleODBC-12cEXECSchemaOpt = EXECSyntax = TFailover = 10FailoverRetryCount = 10FetchBufferSize = FLobs = TLongs = TMaxLargeData = 0MetadataIdDefault = FQueryTimeout = TResultSets = TServerName = shardcat is consistent with the server in tnsnames.ora file SQLGetData extensions = FTranslation DLL = Translation Option = 0DisableRULEHint = TUserID = StatementCache=FCacheBufferSize=20UseOCIDescribeAny=FSQLTranslateErrors=FMaxTokenSize=8192AggregateSQLType=FLOAT5. Test ODBC connection Oracle [root@dmks ~] # isql OracleODBC-12c system xxzx7817600-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 | +- -+-+

So far, the operation of connecting to Oracle using odbc is done, and it is still very simple.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report