Want to use an Oracle-ODBC connection in Visual Studio 2017/ SSIS as it's much faster than OLE DB during tests.
Problem:
I follow Oracle's steps to the letter.
Install instant client (v18, also tried v12).
Download/ extract ODBC download in same library. Run odbc_install.exe.
See the Driver in 'ODBC Data Sources/ Admin' in Windows 10.
Add new User Data Source. TNS Service names pull up fine. Test
Connection (User/ Pass) -- it works!! The Connection works!!
I tried this with 64 bit in Oracle, their instant client v18.3 or 12.2 both. All works in Window's "Oracle Source Administrator" via test connections.
I tried this with 32 bit downloads as well. All is good.
Now, open Visual Studio. First tried 64 bit (my Windows OS is 64 bit, but Visual Studio Data Tools is only 32 bit). Had a hunch it wouldn't work.
Error message "system architecture and client is not the same" or such. Gotcha.
Tried the 32 bit Oracle ODBC driver (User Source). I keep getting the same message (tried 18_3 and 12_2 versions).
Now .... SQLORA32.dll is in the very file path it named. It's right there! Why can't it be found? The test connection in ODBC Source Admin works! What is going on here?
And I'm unsure if I have to "register" something via the command line, I had to do that once before, maybe it was an unrelated issue.
To boot, when I tried a 3rd party "Devart Oracle ODBC connector" -- it's a simple 5-second install wizard that works flawlessly instantly. Problem is it's a 30-day trial and costs $150 at least. How can I can get an Oracle-created ODBC connector (Oracle being world-renowned for janky-azz products) to actually work?
Devart, and probably Attunity Oracle ODBC: 5 second installs
Oracle's own: Harder to install than breaking into Fort Knox/ learning Mandarin Chinese. Please advise.
I am answering my own question.
Unfortunately some of us ETL/ BI guys need to go so wide on problems that there's no time to figure out every little detail/ glitch of Oracle's ... whatever they're doing now.
But here's a fix. In Visual Studio 2017/ Data Tools/ the SSIS IDE .... if you want an Oracle ODBC connection (Faster than OLE Db for some reason) --- when you're setting it up, instead of selecting a NAMED "user or system data source" that you created in ODBC Source Administrator, simply using the "Builder" option (to the left of Use Connection String) for a connection string. It does the exact same steps as the ODBC Source Admin, but within Visual Studio. I don't know what the difference is here, but some wizardry/// who knows what is different, and the connection somehow, suddenly, for some reason, works.
Related
All.
I have used a DLL approach explained on How to securely store Connection String details in VBA
This code is running very well on windows 10 64 bit and MS Office 64 bit. But same copy of the files i am not able to use on Wndows 8.1 Pro and MS Office 64 bit.
DLL generated is converted to host machnines environment by using
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\regasm c:\windows\syswow64\OraConnection.dll /tlb /codebase
But still same error i am facing. About environment variables care has been taken.
My Connection string is
"Provider=OraOLEDB.Oracle; Data Source = ; User ID =; Password=";
In the Succesfull machine i was using Release 12.2.0.1.0 for ODAC 12.2c Release 1 as oracle client.
But saw a latest version of the oracle client as 64-bit ODAC 12.2c Release 1 (12.2.0.1.0) for Windows x64 which was released on 1st June 2017.
Installed the same. And my error was resolved. When i observed system environment variables i saw few things added into it.
E:\app\client\Admin\product\12.2.0\client_1;E:\app\client\Admin\product\12.2.0\client_1\bin;C:\Users\Admin\Oracle\;
I dont know actually what they did. But error was resolved.
Can anybody throw highlight on this?
I'm not sure what the DLL buys you beyond simple obfuscation. All you're doing is making it a bit harder to get to but not actually protecting the privacy of it in any meaningful sense. My normal advice for management of connection strings is to simply don't save user/password. Instead, require the users to input the username/password at runtime and ensure that you have Persist Security Info=false in your OLEDB connection. That way, once it's opened, the full connection string is now inaccessible and there's no reference to a password. That's much more secure than sticking it in a variable in a DLL and crossing your fingers nobody knows how to read a memory dump or attach a debugger.
That said, that's not germane to your question, not able to the use the provider. First thing I'd do is to rule out whether the DLL is causing a problem that you didn't expect by removing it and using the provider directly. If it likewise fails, then you know the DLL has nothing to do with it and you need to work out with Oracle's provider documentation to get to the bottom of the issue.
We have a number of applications written in VB6 (not .NET) that have been running for almost 20 years.
These applications are running on Windows 2007 64bit servers and connecting to Oracle-11 with a 32bit client.
The connection string contains "Provider=OraOLEDB.Oracle"
So far, so good.
The problem is that we need to convert, for reasons that go beyond the scope of this thread) to Oracle-12 64bit.
After having installed the Oracle 12-client (and disinstalled the Oracle-11 client), we get the following error when trying to open the connection:
"Provider cannot be found. It may not be properly installed."
I'm sure we did install the client and am therefore afraid that VB6 cannot connect to Oracle using the 64bit client.
Apparently easy solutions are unfortunately out of the question:
- Convert to .NET or whatsoever and compile under 64 bit
- Keep the 32bit oracle client.
Any idea how to risolve this?
OLE-DB
Good news and bad; because Visual Basic 6.0 is a 32 bit program with no 64 bit compiler, the 32 bit Oracle Data Access Components software must be installed, even if the database itself is running on a 64 bit server in a 64 bit Oracle Database install, specifically you need the 32 bit Oracle Provider for OLE DB rather than the whole client.
The driver can be found here (Download the ODAC XCopy version):
http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html
The following thread describes your exact problem and instructions on fixing it:
https://hoopercharles.wordpress.com/2012/11/25/connecting-to-an-oracle-database-with-visual-basic-6-0-on-windows-8-64-bit/
ODBC drivers
Another way to connect is to use ODBC drivers instead, there are pros and cons to each method so google to find them.
First you'll need to install the SQORA32 ODBC driver which comes with the 64 bit client or with the ODAC linked above.
Next, you'll need to create an ODBC connection, instructions can be found here:
https://tensix.com/2012/06/setting-up-an-oracle-odbc-driver-and-data-source/
Finally you need to change your connections strings in VB6 to use the newly created ODBC connections. Something along the lines of the following should work nicely (obviously nameOfDatabase is the name given to your odbc connection):
Provider=MSDASQL;Dsn=nameOfDatabase;Uid=usernameHere;Pwd=passwordHere
Be careful when you set up your DSN, make sure you use the 32 bit ODBC connection manager which can be found in the following location:
c:\windows\sysWOW64\odbcad32.exe
The same program can be found in the system32 folder but that's the 64 bit version....not confusing at all!
(If you can't follow the solution of twoleggedhorse, which is way better.)
You can write a small DLL in .NET 32bit, and make it COM visible so it will be usable by your 32 bits application.
I said in my comment that it seems to be possible in .NET to talk with the DB without an installed client.
To make it through the least painful, you can write it ADO-like (ie a class to replace RecordSet, another for Connection, and so on). Then add it as a reference to your projects and perform a search/replace.
We have set up Data Source to Oracle on our SSRS 2008 reporting manager as simply:
Data Source: Oracle (from drop down list) Connection string: Data
Source=SERVERNAME;Unicode=True
And it all works fine until something happens - we assumed after windows updates.
This connection doesn't work. The error is:
"Attempt to load Oracle client libraries threw
BadImageFormatException. This problem will occur when running in 64
bit mode with the 32 bit Oracle client components installed."
We do have 32bit Oracle driver on this server. I don't know if there is a 64bit one already.
Then we have created another one to ORacle but is ODBC:
Data Source: ODBC (from drop down list) Connection string:
DSN=SERVERNAME;
After this one is tested for connection (with the button in the properties window) the first one starts working.
And then we continue with the Oracle Data Source as usual and until the next failure. It happened couple of times so far and the solution is just to open the ODBC connection, hit "Test Connection", that works fine. Then go back to Oracle data source and that one works.
It is very unreliable to operate reporting service for the users and also annoying for staff as we don't have a solution.
Any ideas for what we might be looking on that server to have it working 100% of time?
You are running your SSIS package in 64 bit mode but attempting to access a 32 bit driver.
Either (a) switch to 32 bit mode or (b) uninstall your 32 bit driver and install the 64 bit one. You really do not want both 32 and 64 bit on the same server :-)
As to why it is happening infrequently? Hard to tell because there is insufficient information in your question.
If your windows is is 64 bit, and oracle client is 32 bit,
install both clients (32 and 64 bit) in separate folder path with same tnsname file and restart SQL Server Reporting Server service. It get solved for me.
I'm trying to install Oracle BIEE 11g on my computer, but something wiered happend.
I've tried on a x86 computer with 2GB memory and a x64 computer with 4GB memory. Both of them are running Windows OS. I want to connect a MS-SQLSERVER database, and I've finished creating related DEV_ tables using RCU.
I followed the tutorial from the doc.oracle.com, but then I stopped at the 14th step, it says "设置数据库连接失败". I can continue install, but another error occurs, service obisch1 cannot start. I can open localhost:9704 after installation, but it will return a 500-error after I restart my computer.
I searched the internet, it says I should set my database source using "Net Manager" Tool, but I don't know how. And after install I got a database source using driver "MERANT OEM 5.3 32-BIT SQL Server Wired Protocol", but I can't make change to it, cause the system says can't find the driver...
I don't know what to do now... Anybody can help me? Thanks very much.
Well, I've kind of solved it.
I still don't know why my computer cannot find the odbc drier "MERANT OEM 5.3 32-BIT SQL Server Wired Protocol", which seems to be the reason why I can't connect to the database at the 14th step while I install OBIEE.
However, I add an odbc-connect through the system's function, I found it in the control panel.
On the other hand, the url http://localhost:7001/em and http://localhost:7001/analytics can be still accessed(after a long time, it can be accessed).
So, then I create a rpd file use my own odbc-connect, and it seems work fine.
Thanks everybody, anyway, and hopes can help
I have installed Cognos BI 8.3 on my machine, which has a Windows 7 OS 64-bit. In IBM's supported environment list for Cognos 8.3, Windows 7 is not listed. On top of that, it says the product will only integrate with 32-bit 3rd party libraries. So, you can already see that I'm already starting on a bad foot. But anyways, this is the machine I have and that is the software I got, so I decided to see if they would work together..
I installed Oracle 10g Express database also in my machine and Apache 2.2 server. Up to there no problems.
Before moving further, I copied ojdbc14.jar to cognos/.../webapps/p2pd/WEB-INF/lib and added the Oracle database in Cognos Configuration. Tested, passed.
With the database started, the Apache server started, and Cognos started, I was successfully able to start Cognos Connection on the computer. So, it looks like the OS is not an issue.
(You can see everything I did by following the steps on this site, which since two days ago seems to be down but I'm thinking will eventually come back up)
Then I decided to try the samples, so I tried to create a data source connection from Cognos to the Oracle database. So, in the admin config console (i.e. Administer Cognos Contents > Configuration), I decided to create a new Oracle data source. I put the credentials, but BAM.. testing fails.
Fail Message:
QE-DEF-0285 The logon failed.
QE-DEF-0323 The DSN(ODBC)/ServiceName is invalid. Either the DSN is missing or the host is inaccessible.
RQP-DEF-0068 Unable to connect to at least one database during a multi-database attach to 1 database(s) in:
testDateSourceConnection
UDA-SQL-0031 Unable to access the "testDataSourceConnection" database.
UDA-SQL-0532 Data Source is not accessible: "XE".
ORA-12154: TNS:could not resolve the connect identifier specified
RSV-SRV-0042 Trace back:
...
From what I have researched, it could be a number of things, but nothing seems to work. Here is what I tried:
Adding ODBC driver. Added the Oracle XE driver, even making sure it was done in the 32-bit ODBC manager (i.e. Windows\SysWOW64\odbcad32.exe). That didn't work.
Added ORACLE_HOME, LD_LIBRARY_PATH, and TNS_ADMIN to my environment variables.
tnsping'ed the XE database and it the ping returned ok.
There are no tnsnames.ora duplicates in the computer.
I tried and I am able to connect to the database via sqlplus. Did I mention that Cognos Config database test also passed?
Installed Oracle XE client. But didn't do much with it because the Oracle server is installed in the computer and also has a client component.
Has anyone come across this problem? I haven't been able to diagnose the problem or make even the slight progress for days. If you would like me to provide more information on any of the solutions I tried, please do ask. If you have a potential solution or, even better, if you have been able to solve this problem before, please let me know how!
Thanks!
One thing to keep in mind : certain portions of Cognos BI are implemented via Java and other portions are implemented via native C++ processes (the BI Bus processes)
Cognos connects to the content store database from the Java process using JDBC.
The BI Bus processes will connect to Oracle using a native oracle client.
So based on your description, I'd say that the problem area is in the native oracle client configuration (or the Cognos service's perspective of it).
You mentioned adding the ORACLE_HOME, LD_LIBRARY_PATH, and TNS_ADMIN environment variables in windows, and the fact that Oracle Utilities like SQLPlus and TNSPing are working for you.
When you added the environment variables, did you add them to the SYSTEM area for environment variables or the User area...?
If you're running Cognos as a service, its going to be a child process of SERVICES.EXE, which is run as system (this process is also not restarted unless you reboot the machine).
I'd try this :
make sure the above environment variables are defined for the SYSTEM user (in the system area, not the user area)
once you've done this, reboot the machine
See if you can create the database connection now.
If that doesn't work, I'd suggest doing a "run as" of SQLPlus or TNSPING as the SYSTEM user (and see if that works).
In order to use oracle as data source, you must install 32 bit client.
64 bit client will not work.
So if you installed oracle express 64 bit, and you don't want to uninstall it,
you can just install additional 32 bit client, and make sure to set it as your default home.