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).
Related
I'm trying to find a tool that will help me to build a documentation for a database.
I need to write comment on column / table and to have a summary of data flow that creates/modifies data and most important, at a conceptual level what data means. I'm also looking for a free tool
After a long search, I found out http://databasenotetaker.com/ which seems to be suitable for my purposes.
My database is Oracle.
From the documentation they say it potentially support every database but I can't connect to Oracle.
I don't know how to specify the driver in the connection window:
According to their documentation
**
Can Database Note Taker connect to other database platforms?
**
Yes and we will add support for other platforms in the future. So long as it's a relational database and there are freely available connectors, then Database Note Taker will be able to work with it. Out of the box you can connect to Microsoft Sql Server, and MySql via ODBC."
Out of the box you can't connect to Oracle, therefore you need a driver. Check with them to understand which driver they mean when they said "freely available connectors". Out-of-the-box in this context refers to the drivers that appear in the selection list.
My advice: Ask them which kind of driver do you need. If standard ODBC is ok, you must download the ODBC driver from Oracle.
https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html
Important Check whether this product supports 64 bits or it is 32, in order to select the right ODBC driver.
i have 3 different databases (oracle , sap,db2) and would like to implement data masking on oracle db , since the data is flowing to sap and db2 how can i solve this issue? data in oracle is compared with db2 and sap and say for example if i mask first name in oracle then the same will not be masked at sap and db2. so is there a way to unmask and send data to downstream systems ?
Generally the task can be solved by vendor's tools like IBM Optim Data Privacy. Such tools provide the capabilities for consistent masking, e.g. same input produce the same masked output, provided equivalent algorithms and parameters.
Probably by saying SAP you mean SAP HANA. This can be a bit tricky, due to missing SQL compatibility and lack of integration, but anyway this is doable too with the very same tools - just a bit more work to implement.
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.
I am trying to submit XQuery queries to an Oracle 11g database through their XQJ API.
When I instantiate an oracle.xquery.xqj.OXQDataSource as explained in http://www.oracle.com/technetwork/articles/oem/xquery-jdbc-325944.html, I can submit queries fine except that I haven't found how I can set up the server connection (server name, port, username, password, ...) info:
This datasource claims that it doesn't support setting any property.
It doesn't implement the data source constructor which takes a JDBC connection.
I don't see any non standard method to set such info.
When I try to access some random collection like collection("oradb:/foo") I just get an empty result set even when no server is running, suggesting that the driver doesn't even try to connect.
What have I missed and how can I set the server connection info?
Thanks,
Eric
Thanks to Charles Foster I can answer to my own question: the XQJ implementation from Oracle is an old standalone version from January 2010 that is pretty useless and doesn't interact with Oracle databases.
Despite all the Oracle statements about XQJ, I haven't been able to find any client/server XQJ implementation (except one from DataDirect of course) and the way to submit XQuery queries to Oracle databases appears to be through JDBC, embedded in PL-SQL statements.
It is possible in 12.
XQJ to run queries in Java:
http://docs.oracle.com/database/121/ADXDK/adx_j_xqj.htm#ADXDK99930
XQJ to run queries against the database:
http://docs.oracle.com/database/121/ADXDK/adx_j_xqjxdb.htm#ADXDK136
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