ODP.NET and OLEDB with Multiple Oracle Homes - oracle

For legacy reasons, our .NET 4.0 application currently uses both the Oracle OLEDB and ODP.NET providers to connect to an Oracle instance. We have standardized on the 11.2.0.3.0 Oracle client. Both data providers work as expected when one Oracle client is installed.
Issues have been reported on computers that already had the 11.2.0.1.0 client installed. A second client, 11.2.0.3.0, was installed for our application. The installation looks like this:
c:\oracle
\product
\11.2.0
\client_1 <-- (existing) 11.2.0.1.0
\bin <-- OraOLEDB11.dll registered here
\network
\admin <-- TNSNAMES does NOT contain ORACLESVR
\client_2 <-- (new) 11.2.0.3.0
\bin
\network
\admin <-- TNSNAMES contains ORACLESVR
Due to a bug in the 11.2.0.3.0 installer, the OLEDB driver is not registered in the second home, meaning the 11.2.0.1.0 driver remains registered.
This leads to some interesting/odd behavior that I cannot explain:
if the "ODP.NET from 11.2.0.3.0" part of the application is used first, both providers can connect, meaning the "OLEDB from 11.2.0.1.0" is using the tnsnames.ora from the _2 home.
if the "OLEDB from 11.2.0.1.0" part of the application is used first, neither provider will connect, presumably because both are using the tnsnames.ora from the _1 home.
So, once the Oracle home is determined for the application, both clients attempt to use that home, causing complete success or complete failure.
To work around this, we can do things like: register the 11.2.0.3.0 OLEDB provider, add the TNS_ADMIN environment variable, or add ORACLESVR the tnsnames.ora from the _1 home.
However, I want to know WHY this is happening? I cannot find, in the Oracle documentation for each provider, how the tnsnames.ora file is located when two clients are present and TNS_ADMIN is not specified.
How does one provider affect the other?

OLEDB is based on Microsoft COM and each DLL you register has to have a distinct name. Thus you cannot register OraOLEDB11.dll several times from different locations, i.e. OLEDB can be installed only once (per architecture).
In case you try to install several OLEDB on one machine the Oracle Installer creates a mess. It is always a challenge to have several Oracle Clients installed.
These locations are searched for tnsnames.ora, resp. sqlnet.ora:
current path (associated with the running client application)
Environment variable TNS_ADMIN defined for the session
Environment variable TNS_ADMIN defined for the system
Windows Registry Key HKLM\SOFTWARE\ORACLE\KEY_{ORACLE_HOME_NAME}\TNS_ADMIN (for x64) or HKLM\SOFTWARE\Wow6432Node\ORACLE\KEY_{ORACLE_HOME_NAME}\TNS_ADMIN (for x86)
%ORACLE_HOME%\network\admin
I got this list from Oracle Metalink 111942.1 (referring to Oracle 9.x and Windows NT/2000)
I don't know whether it applies for each individual Oracle Provider/Driver you may use. When you trace your application with Process Monitor you can get a different order.

Related

Data Pump export using cloud shell

I am trying to export schema using data pump on Oracle Cloud Autonomous database.
I am using cloud shell to export schema.
When I tried to do the final step:
expdp admin/password#DB_HIGH schemas=SCHEMA_NAME directory=data_pump_dir dumpfile=exp%U.dmp filesize=1G logfile=expot.log
I got
UDE-12154: operation generated ORACLE error 12154 ORA-12154:
TNS:could not resolve the connect identifier specified
Do I need Oracle instant client to do export?
The Oracle client code uses one of three ways to look up connect data:
A flat file named tnsnames.ora
Oracle Names service
LDAP
When the complete ORA-12154 error appears with the text line, your program has found a working Oracle client install. However, the specified Oracle service is not listed in tnsnames.ora, Oracle Names or LDAP.
The first step in the troubleshooting process is to determine which name resolution method is deployed at your site. Most sites use tnsnames.ora, but enough use Oracle Names and LDAP, so it’s best to confirm this information.
If you are not the database administrator, get in touch with the people managing your Oracle systems and find out which method you should be using. They may be able to guide you in fixing the problem in accordance with your site’s standards.
The client code decides which mechanism to use based on the file sqlnet.ora. This file and tnsnames can usually both be found in the Oracle install directory (“ORACLE_HOME”), under network/admin/. This location may be overridden with the environment variable TNS_ADMIN.
If the sqlnet.ora file does not exist or does not specify a resolution method, then Oracle Net uses tnsnames.ora.
Example locations of Oracle networking files include:
Windows
ORANTNET80ADMIN
ORACLEORA81NETWORKADMIN
ORAWIN95NETWORKADMIN
ORAWINNETWORKADMIN
UNIX / Linux
$ORACLE_HOME/network/admin/
/etc/
/var/opt/oracle/
If you fix the naming issues, but you still see the ORA-12154 error, check the Oracle service to confirm that it’s available for connections. A power outage, server failure, or network connectivity issue will make this resource inaccessible. It’s also possible that scheduled maintenance or repairs of an unrelated Oracle issue may take that resource temporarily offline.
Thanks

oracle 12c sqlplus login error subscriber

I am facing below error/warning when I login to oracle 12 using sqlplus client.
Details :
SQL*Plus: Release 12.1.0.2.0 Production on Fri Nov 8 05:38:11 2019
Copyright (c) 1982, 2014, Oracle. All rights reserved.
subscriber -1581956048 create failed: Last Successful login time: Fri
Nov 08 2019 05:36:31 -05:00
Connected to: Oracle Database 12c Enterprise Edition Release
12.1.0.2.0 - 64bit Production
Not sure what is subscriber -1581956048 create failed not getting much info on Google.
is anything need to worry about?
Regards
Laks
Issue caused by Fast Application Notification (FAN) for OCI client.
FAN uses Oracle Notification Services (ONS) to publish and subscribe
service for communicating information about all Fast Application Notification (FAN) events.
ONS uses port 6200 by default. If there is a firewall between the
client and the server and port 6200 port is closed then this behavior
is expected
You can use OCI to access Oracle TimesTen In-Memory Database and Oracle TimesTen Application-Tier Database Cache. OCI is an API that provides functions you can use to access the database and control SQL execution. OCI supports the data types, calling conventions, syntax, and semantics of the C and C++ programming languages.
TimesTen and TimesTen Cache support the Oracle Call Interface (OCI) for C or C++ programs.
Starting with Oracle Database Release 12c Release 1 (12.1), Oracle provides an oraaccess.xml file, a client-side configuration file. You can use the oraaccess.xml file to configure selected OCI parameters (some of which are accepted programatically in various OCI API calls), thereby allowing OCI behavior to be changed during deployment without modifying the source code that calls OCI.
Updates to the oraaccess.xml file will not affect already running clients. In order to pick up any updates to the oraaccess.xml file, already running clients need to be restarted.
The oraaccess.xml file is read from the directory specified by the TNS_ADMIN environment variable in regular and instant client installations.
This is the $ORACLE_HOME/network/admin directory on UNIX operating systems and the %ORACLE_HOME%\NETWORK\ADMIN directory on Microsoft Windows operating systems, if TNS_ADMIN is not set in regular client installations.
The oraaccess.xml file has a top-level node with the three elements. One of them is . the tag allows specifying default values for various OCI parameters. Some parameters can only be specified once and hence apply to all connections. These global parameters are described using by some tags. One of them is <events> tag.
Ref .
If you already have an oraaccess.xml file, then convert the part
<events>true</events> to <events>false</events>.
Otherwise create an oraaccess.xml file with the following information in the default_parameters section:
<?xml version="1.0" encoding="ASCII" ?>
<oraaccess xmlns="http://xmlns.oracle.com/oci/oraaccess"
xmlns:oci="http://xmlns.oracle.com/oci/oraaccess"
schemaLocation="http://xmlns.oracle.com/oci/oraaccess
http://xmlns.oracle.com/oci/oraaccess.xsd">
<default_parameters>
<events>false</events>
</default_parameters>
</oraaccess>
put this file under TNS_ADMIN directory, and then restart the SQL*Plus Client.

Issue with Oracle Client Data Source in SQL Server 2012 SSIS

I am having an issue with Oracle connectivity from an SSIS project, and have been Googling around to try to find a solution for over a week, now, and haven't found anything.
I have the following configuration in my dev environment:
O/S: Windows Server 2008 R2 Datacenter, 64-bit
SQL Server Data Tools, 2010
I need to configure an SSIS Data Flow Task to pull data from four different Oracle Data Sources (among others). One is Oracle version 11.1.0.7, two are version 9.2.0.4.0 and one is 9.2.0.8.0.
We use local TNSNAMES and SQLNET.ora files for our configuration.
I have tried this with many different Oracle clients, and basically get the same result, so will highlight one that I did:
Installed the Oracle Client 11gR2 64 bit.
Installed the Oracle Client 11gR2 32 bit (that order is recommended).
Copied my TNSNAMES and SQLNET.ora files into both network/admin configuration folders.
Did a successful TNSPING on each of the 4 databases named above. Successful.
Opened up SQL Server Data Tools and opened a new project
Did a "Create new Connection Manager", picked ADO.NET
Selected "Oracle Client Data Provider", enter the details of the 11g database
Did a "test Connection". Success.
Repeat the procedure for one of the 9.0 databases. When I do the "Test Connection" I get a "Test Connection failed because of an error in initializing provider. ORA-12645: Parameter does not exist".
I get this same result for all three of the 9.x databases.
Oracle "help" says that this error is caused by a missing parameter in the SQLNET.ora file, and that the solution is to add the missing parameter. Trouble is, nowhere does it say what is missing.
I have tried this same procedure with other Oracle client installs other than the two clients - ODTwithODAC1120320_32 bit, ODAC1120320_x64 and get exactly the same result. I can't go to a version 12 client because as I understand it, it won't work with a 9 database. I can't go to a 10 client because that won't work with an 11 database.
I have a feeling that it's very specific to the 64-bit O/S and version of SQL server, but that is our target platform, so need to make it work.
Can anyone help me with this, please?

Can OracleXE's APEX access another Oracle Database (10g) on the same Server, or is it Restricted to those Users/Tablespaces in the XE Database?

My work uses Oracle 10G and is planning on installing Apex. In the meantime, I have downloaded Oracle XE and have taught myself APEX on it; however, I can only access users/tablespaces that I have made in the XE database. What I would like to do is use the XE's Apex to access the users/tablespaces in the production databases of my work.
My colleague says that this should be possible because my workstation is connected to the server, and that there should be a way to configure access from my XE's Apex to the 10g's databases, such as by setting up an appropriate DAD.
I see nothing in the Apex user interface to allow this. I've read every word of the Apex documentation but nothing registered.
XE uses the embedded PL/SQL gateway, as opposed to 10/11G which uses either an Apex Listener or an HTTP Server with the mod_plsql plugin.
Thank you,
Matthew Moisen
I have done this before where we didn't have access to the actual database hosting the data to be worked with save for the standard port 1521 listener access. Apex at the time was new enough to the organization that the DBA's also had a voodoo taboo on using their database server as a webserver gateway as well. You can use your database instance with APEX installed as a "middle tier" or app server with the following steps:
Set up an account on your 10g database that is accessible remotely via dblink.
Set up dblinks to your 10g database table on your workstation with XE installed, use the account and connection information for the 10g database as set up in (1). Note, you may have to update a TNS names file or explicitly indicate your host/networking settings within the dblink itself.
For simple sanity and simplicity in coding your apex projects, set up synonyms for all your dblinked objects (i.e., table1 for table1#dblink) so you're not referencing the dblinks directly in your apex code. Making changes later will be easier if you adhere to this.
That's it. One proviso is that you need to know that LOBs will not work with the out-of-the-box functionality of APEX driven DML operations while using dblinks. This may have changed with the newest version. One workaround you may consider is trying to use a stored procedure which passes your LOB data as a input parameter which will do your DML operation for you.
Otherwise, this approach works nicely. The place where I implemented this model has several production level apps, a test and a development tier all using servers hosting APEX separately from the actual data sources. We used Oracle Standard Edition One (for the support), but Oracle XE should work as well since APEX is the platform in common between either Oracle version.

TNS,can not handle the service name when two different version installed together

In our server,we publish a asp.net application,which use the oracle11g as the database.
We just set the connection string in the web.config,it works.
However someone install the oracle8 in the same server since they need them in other client application.
But after that,our web applcation can not work,we get the error:
ora-12154 TNS an not handle the service name
Then I found that the path environment has been changed. The "C:/app/oracle81/bin" is added at first. But even I change the "D:/app/oracle11g/bin" first,it does not work also.
Any idea to make the both work?
You might investigate what drivers are being used within .NET ... Microsoft's deprecated Oracle provider or Oracle's own provider or some kind of ODBC provider sitting on top of several kinds of possible drivers in a DSN. Each might be remedied in a different way.
But it sounds like the Oracle 8 installation has stolen priority over the Oracle 11 installation in some way that is not just the "PATH" environment variable. My guess would be the registry.
In ascending order of inconvenience and effectiveness you could try:
1) Run the Oracle 11 installer and see if it knows about the Oracle 8 home. (Unlikely if it's 8.0). Set it as default or top of the list; exit; then go back and set Oracle 11 as the default/top of the list.
2) Configure the TNS entries in your Oracle 8 home to connect to your Oracle 11 database. Live with the fact you're using a very out of date client.
3) Uninstall and reinstall Oracle 11 to get it to steal back the priority.
By default the .net framework uses the FIRST oracle directory it comes to the in the path statement. There have been some discussions on how to get around this - but your best bet is to run one client per machine.

Resources