How do I fix a broken connection to DB2 from a web application? - vb6

I support some old web applications, VBScript-based ASP for the UI and VB6 COM modules for the business and data access layers. Last weekend, I installed DB2 Connect Enterprise Edition v8 fixpack 14 on several Windows 2000 servers, and one of the web apps errors out on null data when it calls the built in VBScript function FormatNumber. This numeric data is retrieved by a SQL Server query, but the only way the SQL Server column is populated is with the calculated results returned from a DB2 query earlier in a progression through several pages.
When I installed DB2 Connect EE, one of the components loaded was MDAC 2.7. I followed corporate instructions and had the installation save an ODBC System Data Source, which reported a good connection when I tested it after the install.
For what it's worth, the project references in the production VB6 modules pointed to MDAC 2.5. I have tried recompiling and deploying to COM on my test server new versions of the VB6 modules referencing MDAC 2.7. My development environment is Windows XP Pro, with MDAC 2.8 and DB2 Connect EE v9.5 installed. When I deployed the updated VB6 dlls, the CreateObject fails to instantiate the classes with the error message that "The class does not support automation or the requested interface".
I've rolled the DB2 Connect install back and have reinstall v8 of the DB2 runtime client, which was the previous environment. The problem, however, persists.

I don't really get the picture for how things are connected together - where is the SQL Server and where is the DB2.
There are forums on IBM's site for helping out specifically with DB2 Connect EE, wwhich I think is a pretty pricey product (not sure tho).
One way I have seen people do it is configure a SQL server as the data gateway. You can define DB2 as a linked server, and then perform SQL queries through the SQL server in order to get to DB2. Apps need only to be able to connect to SQL Server, not directly to DB2. They get to DB2 indirectly. Depending on the load on the system this may or may not be feasible for you. You can even do joins across data stored separately in DB2 and SQL with this approach.
It's one more option in the toolbox, along with replication, data federation, and so on. I found that it reduces the variability in connectivity.

Related

Unable to connect to Oracle using SSMA for Oracle

I'm trying use Microsoft SSMA for Oracle to migrate a database onto Azure SQL, but I can't get it going. I've double checked the server name, server port, Oracle SID, password... everything. No matter the type of entry screen I use, I can't get it to connect to the on-premise Oracle instance.
I'm pretty sure the login information is all correct, and I should have a working connector to Oracle since I connect to it from TOAD on a daily basis. I tried installing Oracle libraries per previous posts but not sure if I did it successfully because the issues still remains.
What are the troubleshooting steps I should take in order to make this work?
Log in screen:
      
Error 1:
Unable to find specified provider.
Compatible Oracle Data Access Connectivity libraries were not found on the machine. You can install them from Oracle product media or download it from Oracle web site.
Error 2:
Connection to Oracle failed.
ORA-01017: invalid username/password; logon denied
Error 3:
Connection to Oracle failed.
Network Naming: No LDAP server detected or configured
After a few more days of debugging, I was finally able to get SSMA to work. This answer helps to document my solution for personal use, as well as hopefully answer anyone else's question in the future.
After looking at the list of prerequisites to have SSMA running, I saw that I needed to have a correct Oracle client running. After some internal discussion, it was likely that the Oracle client SSMA needed was different than the one my computer already had for TOAD. The .Net provider for the TOAD connectors was probably not useful for SSMA.
We run Oracle 11g but I had to install Oracle 12c because 11g did not support Windows 10 apparently. Not too much of a roadblock here.
I found this guide to install Oracle client 12c pretty helpful. Shoutout to my alma mater.
Unfortunately the installer kept freezer, but using this former post, I was able to bypass it with the windows command:
setup.exe -ignoreprereq -J"-Doracle.install.client.validate.clientSupportedOSCheck=false"
After that, I saw different error messages when trying to connect SSMA. I kept trying different options with my logins until it worked. Provider: OLEDB Provider, Mode: Standard.
After being granted the appropriate permissions, I was finally able to access our internal tables and objects.
It was a pretty annoying question with a lot of rabbit holes along the way, but it was definitely worth it, being able to translate all our Oracle schemas to Azure SQL with a few clicks. Hope this helps!
Make sure to validate all steps mentioned below before going to install Microsoft SQL Server Migration Assistant for Oracle.
Make sure you have already installed SQL Server instance that will host the migrated database. Also keep in mind that you are not installing SQL Server Express edition to host the migrated database.
You must have sysadmin account to install SQL Server Migration Assistant for Oracle.
Make sure to install SSMA for Oracle on the server that will host newly migrated database on SQL Server.
It is recommended to install Oracle client software on your target system where SQL Server Instance is running.
Make sure your windows server has Microsoft Windows Installer 3.1 or a later version. Port 1434 should be open.
For more details, You can reference: How to Install SSMA for Oracle to Migrate Oracle Database to SQL Server.
Here's the Azure Database Migration Guide: Migrate Oracle to Azure SQL Database. As you prepare for migrating to the cloud, verify that your source environment is supported and that you have addressed any prerequisites. This will help to ensure an efficient and successful migration.
Connect to Oracle with Oracle Client Provider.
Azure also has other way can help you migrate Oracle database to Azure SQL database, such as with Azure Data Factory. If you still has the connect error. I think you can try to use it. Please reference this tutorial: Copy data from and to Oracle by using Azure Data Factory.
Hope this helps.

OCISessionBegin hangs in multithreaded COM+ applications [Delphi + ODAC + Oracle]

We have here a application that uses ODAC components inside COM+ dlls to connect to Oracle Server 11g.
Lately we are facing a problem that we cannot find the solution.
For some reason, when the concurrency of the application server at some of our clients is too high, some dlls starts to hang and they have to kill the process to restore the usability of our product. Trying to reproduce the error here at our office, we created a test environment to stress an application server. We start 30-50 programs that make calls to application and after some time the problem appears.
Debugging our DLL after the server hangs, shows that any subsequent call to OCISessionBegin cannot complete. No error is generated. No other symptoms are visible.
The last line that the we try to execute is: Check(OCISessionBegin(...)); on OraClasses.pas
We checked the database no contention, no lock.
We are using ODAC 6 on our clients, but we upgraded it to the last version and the problem persists. We have to use the Oracle Client 10 to connect to the database 11g because the are using the version 6 of ODAC.
Thanks a lot
AFAIK you need to create your environment with both OCI_EVENTS + OCI_THREADED attributes sets, in such a configuration.
For instance, here is how it is initialized in our Open Source direct Oracle access unit:
fEnvironmentInitializationMode := OCI_EVENTS or OCI_THREADED;
...
with OCI do
try
if fEnv=nil then
// will use UTF-8 encoding by default, in a multi-threaded context
// OCI_EVENTS is needed to support Oracle RAC Connection Load Balancing
EnvNlsCreate(fEnv,Props.EnvironmentInitializationMode,
nil,nil,nil,nil,0,nil,OCI_UTF8,OCI_UTF8);
I suspect you have to check how your OCI environment is created in ODAC.

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.

Connecting to different database versions

I maintain a set of applications that use Pro*C to connect to Oracle 10g databases. These applications are generally involved with moving data from one database to another. In each case a connection is made to the source database and a separate connection is made to the target database. For reasons that are out of my control the target databases are to be upgraded to 11g whilst the source databases are not. I have searched the internet unsuccessfully, well I have posed the problem as many different ways as I can think of in google, in order to determine whether connecting to different versions of the database is acceptable .The only, almost relevant, documentation I can find is this Can anyone point me to any other documentation that would allay my clients fears?
The official client/ server compatibility matrix for Oracle is My Oracle Support 207303.1 "Client/ Server/ Interoperability Support Between Different Oracle Versions". That is probably the documentation that your clients would want to see.
The quick version is that if your application were to use, say, the 10.2 Oracle client, you would be able to connect to databases from 9.2.0.4 to 11.2.0.x. If your application were to use the 9.2 Oracle client, you'd be able to connect to databases from 8.1.7.x to 11.2.0.x. If you used an earlier version of the Oracle client, you would not be able to connect to an 11.1 or an 11.2 database.

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.

Resources