OCI & Instant Client SDK & Oracle Database - oracle

Sorry for being the question very naive but the same is true for my experience with the subject.
From the googling what i understood i just want to confirm that the understanding is correct. Everyone is welcome to pin point where i am wrong.
OCI is basically a set of APIs which the C/C++ programmers can use to write C/C++
applications to access Oracle Database.
a) Oracle instant client SDK is a (DLL/Shared library) which USES OCI (???). The C/C++
code written by C/C++ programmers links to the Oracle instant client libraries &
hence uses OCI as well.
b) The benefit of instant client is that it eases the programmers pain to write some
complex code(??).
c) Even if C/C++ programmer doesn't use Instant Client libraries, they can still use OCI
& get the work done (Is this correct??)
d) Is this true? C/C++ programmers just need OCI library to write an application which
connects to Remote Oracle database & does table operations? Do we need any ODBC
drivers also? If yes, why? Won't oci.lib be enough?
What is the difference between FULL Oracle Client & Instant Oracle Client? Is it true
that Instant Oracle client is just a subset of FULL Oracle client?
I am not able to obtain the interoperatibility matrix of Instant Client will various
Oracle databases. Searched alot on Oracle website. The only thing i could find is link
to Oracle support site which i can't access.
Please clarify my doubts. Many thanks in advance.

Briefly:
OCI is C API libary. There is also C++ library called OCCI, but I do not recommend it(you can have problems with C++ ABI changes/dialects on various compilers)
Both Instant and "thick" Oracle client contain OCI library (OCI.DLL or linclntsh.so). The one provided by Instant client is more-or-less self-contained. e.i. it does not depend on other libs provided with Oracle client (compare output from ldd on Linux or depwalk on Windows).
Both also contain necessary headers
The C API in both clients is practically identical. The only exception I recall is a set of supported database native characters sets. InstantClient supports only UTF8, ISO Latin1 and ASCII.
"thick" client also contains a library named "libxml.a" which is needed when you want to use datatype SYS.XMLTYPE. This library is not (for some unknown reason) bundled with InstantClient
"thick" client also contains some handy diagnostic tools like tnsping
InstantClient is very easy to "setup". Users simply unpack a single .zip file. Do not have to set ORACLE_HOME PATH LD_LIBRARY_PATH env. variables. You simply dlopen() one library file and that's all.
InstanctClient can work without tnsnames.ora (although it supports it) instead of that you can use jdbc-like EZCONNECT
Both types of clients may not be re-distributed, unless you're Oracle businesses partner. So you must not embed these driver's lib in your application. Each user must download then separately.
So far I have not found a C API way how to distinguish InstantClient OCI.DLL libary.
There is InstantClient specific section in Oracle Call Interface Programmer's Guide
I recall there might be some problems with InstantClient when you set ORACLE_HOME env. variable and it's values ends (?or does not end?) with slash '/'

Oracle instant client is a small subset of the full/"thick" client. It includes the OCI C-libraries, JDBC and ODBC which makes is possible for programs written in C, Perl, Python, Java, Scala and so on to connect to an Oracle database server. Instant client dont include familiar Oracle tools like sqlplus, sqlldr, exp, imp and more. However, sqlplus can be installed separately to work with instant client without needing a full client.

Related

Can I connect to Oracle database without Oracle JDBC driver?

TL;DR:
Is there a way to connect to an Oracle DB via JDBC without the Oracle JDBC driver? Or any other way (e.g. hibernate)?
Full story:
We have an existing Spring Boot app, which connects to an Oracle 11c database instance using OJDBC driver. Spring Boot internally uses JdbcTemplate to execute a few inserts and selects, basically 5 or 6 type of statements. Technically it is working fine.
However we are in an interesting situation, the code we built has to pass through a series of checks (we are working as subcontractors under a larger international company), and part of these checks is a license inspection. BlackDuck (https://www.blackducksoftware.com) is used to report every single library which is linked in the solution (around 280 in our case), and we had to manually add the copyright statement to each (for example: "Copyright © 2005-2019 The Apache Software Foundation. All Rights Reserved."). We added the Oracle Technology Network license to the Oracle Driver, and it was rejected by the legal team of the international company:
"Unless we are actually licensed to use an Oracle database (which you are not), we cannot allow the use and distribution of the Oracle JDBC drivers. Those drivers are licensed under the Oracle Technology network license and it obligates XXX [company name] to designate Oracle as a 3rd party beneficiary, which is not something our legal department allows. You must therefore find a compatible replacement that is licensed under open source."
Now, we are obviously trying to get around this thing (seeing as the end client who is receiving the solution has a licensed Oracle DB installed, and we can see earlier versions of the OJDBC driver in the company's Nexus repository), but I wanted to ask, is there a way to connect to an Oracle DB via JDBC without the Oracle JDBC driver? Or any other way (e.g. hibernate)? To my knowledge, Oracle DB communication protocol is not fully standard, that's why you need the Oracle drivers. Is there an open source alternative that I don't know of?
Oracle DB communication protocol is not only "not fully standard", there is simply no SQL or JDBC standard for any on-the-wire communication protocol for SQL databases, they are all proprietary.
There is no open-source alternative that I'm aware of, and there couldn't be without Oracle's help as the protocol is not publicly specified as far as I know. We solved a similar problem by having our customers with an Oracle license add the driver to their deployment of our app, that way we didn't redistribute it, and they were the ones who used it.
Yes, use someone else's driver. Progress makes one for example.
I'm not speaking on behalf of Oracle in terms of the quality of THIS driver or the legal terms concerning your decision to not use our driver. However, there are alternatives to our driver for Java applications, and this is one of them.

Independence though ODBC drivers

Can an application developed with oracle queries in DB layer
Be run on an SQLServer Database with the help of an ODBC driver
Maybe, if you used only ANSI SQL statements. ODBC will happily send the text of the query to the query parser on the server and as long as the server can parse it, it will run.
If, however, you have used anything that's specific to Oracle (and that's a long, long list), then it won't work so well.
All that ODBC provides you is abstraction from the connection details -- the driver, the server name, the port numbers etc.
So, how do you get true independence? Generally, you'll use a query generation library like Hibernate which knows how to translate a query language of some kind (HQL) to the specifics for that particular database (PL/SQL or Transact/SQL).
Short answer: Not reliably.
Longer answer: Not through ODBC, but using a JDBC driver for Microsoft SQL Server then perhaps if the application was developed only with ANSI standard SQL. Usually, that is not the case and some PL/SQL code will have been used. If an equivalent piece of T-SQL can be written then it is possible to port the application. But, to your question, this is largely immaterial to the database connection mechanism.
Addendum: Object Relational Mapping tools usually use dialects to generate database independent queries. Other options include using configuration to select the correct queries at run-time (if you need to support both database types).

What is a importance of Hive ODBC Connector

I like understand the 'Hive ODBC Connector' concept. means What is a use of Hive ODBC Connector in the architecture.
Does it require to set-up the DSN (data source Name ). Can we go for DSN-less configuration ?
Please explain in details
If you have one of the distributions from Cloudera, Hortonworks, MapR, Intel, Microsoft or DataStax, they already come with an ODBC driver in the distribution. The driver is created by Simba Technologies (http://www.simba.com/connectors/apache-hadoop-hive-odbc).
If you're using the Apache version of Hadoop, you can still trial the version of the ODBC driver on the above link for 30 days, however you will need to pay for it to continue use.
I only mention the above as this ODBC driver is a more complete implementation of the ODBC specification than the open source one, and it can also do SQL-HiveQL translation which essentially means that you can plug it into Excel or Tableau or the like and have them issue standard SQL. As mc110 mentioned, you can make DSN or DSN-less connections and there is also a Windows configuration dialog available should you wish to use that.
Also, in the interests of full disclosure, I work for Simba Technologies.
As explained at https://cwiki.apache.org/confluence/display/Hive/HiveODBC, the Hive ODBC connector implements the ODBC API for Hive, potentially allowing a lot of existing well-written ODBC applications to seamlessly use Hive as they would any other database. The link also explains what API calls are and are not supported.
SQLDriverConnect is supported, which implies you can make DSN-less connections. I suggest you read the information from the link for more information. Also, http://www.cloudera.com/content/cloudera-content/cloudera-docs/Connectors/PDF/Cloudera-ODBC-Driver-for-Apache-Hive-Install-Guide.pdf has a section on configuring DSN-less authentication.

Oracle with Clients: I must install oracle for client?

I'm very newbie for Oracle and very not sure about Oracle.
one question I want to know.
if I want develop oracle windows application. first I must install oracle on server for database server but I'm not sure if I don't want install oracle on client. I must install oracle for client YES or NO !?
thank for help.
Yes. The Oracle client must be installed on any machine wishing to access the database. The components of the client you need to install will depend on the method your application using. eg. OLEDB, ODBC, etc.
The answer is 'it depends' - your software will need some kind of client-side driver or library for communicating with Oracle, but there are many ways you can do this.
1) Compiling Oracle's SDK libraries directing into your application.
2) Using a locally installed SQL*Net client (which can be shared between different local applications, so that things like TNS_NAMES setup can be shared).
3) Using third-party libraries embedded in your application.
Also the different kinds of clients can expose or restrict different levels of functionality.
You can install Oracle DB and Oracle Client on same Machine. In below order:
Oracle DB
Oracle Client
Do not forget to do an ADMIN Share prior to install Oracle DB.
To Answer the general question; You have to install Oracle Client on any machine needed to connect to the Oracle Database.

What is an Oracle Client?

I'm from MySQL background and am new to Oracle. I want to know
What is meant by Oracle Client?
What is its use?
What is its equivalent in MySQL ?
Thanks
What is meant by Oracle Client?
and
What is its use?
In this context, a client is a class library (DLL) that allows you to connect remotely to the underlying database of an application. A client, always within the same context, can also be called a .NET Data Provider.
You may have multiple data providers based on the underlying database engine with which you're working.
There was System.Data.OracleClient (deprecated), provided by Microsoft.
There is Oracle.Data.Client, which is actually the best ever built Oracle Client, or Oracle .NET Data Provider. You may also download the latest Oracle 11g Data Provider for .NET.
So, when accessing the Oracle underlying database, make sure your work with this provider, proper for your version of Oracle, and start doing ADO.NET with your favorite database! =P
There are also some other tools that you can work with that will ease your data access code pain, such as Enterprise Library or NHibernate, both are frameworks to basically accessing databases.
Enterprise Library can do even more then that!
And NHibernate is an ORM (Object/Relation Mapping) tool that can work just very fine with Oracle.
Remember though, always use Oracle.Data.Client namespace in the Oracle.DataAccess.dll assembly.
What is its equivalent in MySQL ?
As the equivalence for MySQL, I guess it would be MySQL Connector/NET.
It is the Oracle binaries installed that allow communication with the Oracle database. It can be using SQL*Plus, JDBC (type II or IV) or OCI (Oracle Call Interface).
Its a piece of software that allows a remote computer to talk to Oracle. If you were to write a piece of software that communicated with the database, you would use the Oracle Client to facilitate that communication

Resources