Go lang connect to Oracle 9i (using go-oci8) - oracle

I have a 32 bit Oracle DB (version 9i - 9.2.0.7.0), a 64 bit Mac and am trying to connect to it using go-oci8 with Go Lang (version go1.11.1 darwin/amd64).
I used SQL-Developer 4.0.2 to successfully connect to the DB and then enabled InstantClient connection through it using this tutorial. So I've got things running from the Oracle Client's side.
I'm using InstantClient Version 11.2.0.4.0 (32-bit) for MacOS (basic and SDK), I've used mainly this tutorial almost successfully. After everything, the error I'm getting is:
github.com/mattn/go-oci8 ld: warning: ignoring file /Users/myusername/Downloads/instantclient_11_2/libclntsh.dylib, file was built for i386 which is not the architecture being linked (x86_64): /Users/myusername/Downloads/instantclient_11_2/libclntsh.dylib Undefined symbols for architecture x86_64:
And then a long stack of symbols. Basically the Go oci8 library is trying to use C (which is 64 bit) and tries to build 64 bit files, which will then be used by Go. If I try with the 64 bit version of InstantClient, I have no problems, but I get a "driver: bad connection" error which is because 64bit won't work to connect some reason.
I have no idea what to do to resole this issue - can I somehow force the build of 32 bit files while using go get -u -v github.com/mattn/go-oci8? Or somehow make the 64 bit InstantClient version connect to the old 32 bit Oracle DB?
Any kind of help on how to get this running would be much appreciated.
Edit: I've tried 10.2 Oracle Client, but I can't connect it with go-oci8 (I'm assuming it doesn't support it). The error I get is ../github.com/mattn/go-oci8/oci8.go:113:25: could not determine kind of name for C.OCI_SYSASM
Final edit for people who have the same problem (coming on to a very old Oracle Database) - you can't interface with the readily provided solutions using Go. The libraries listed to work with Oracle operate with Client versions 11.2 and up.

The architecture of the Oracle Client have to match so architecture of your application. I.e. if your Go Lang is 64-bit then the Oracle Client have to be also 64-bit. It does not matter whether the database is 32 or 64-bit.
I think the main problem is, you cannot connect with an Oracle 11.2 Client to a (20 years old!) Oracle 9i database.
Check Client / Server Interoperability Support Matrix for Different Oracle Versions (Doc ID 207303.1) for details.
It says:
For connections between 10.2 (or higher) and 9.2 the 9.2 end MUST be
at 9.2.0.4 or higher. Connections between 10.2 (or higher) and
9.2.0.1, 9.2.0.2 or 9.2.0.3 have never been supported.
You did not tell us which version of "Oracle 9i" your ar using.

Related

How to connect to an Oracle database installed on a Windows 11 virtual machine (Parallels) using a computer with Apple Silicon (M1)?

Since Oracle Database cannot be installed on Apple Silicon, I decided to take a workaround, but now I do not understand how to connect to the Oracle Database, which I installed on a Windows 11 virtual machine through Parallels.
I understand that this makes little sense, since in fact you can use Oracle from Windows 11 and do whatever you want with it.
But as an experiment, I wanted to try connecting to an already deployed HR database in my Windows 11 virtual machine using DataGrip on my Apple Silicon (M1) computer.
I know that there are other ways to use Oracle on a Mac (using Docker for example) but maybe we can come up with some other alternative, or maybe there already is, but I don't know about it.
I hope I wrote as clear as possible. Sorry, I'm using a translator.
I used this instruction to install Instant Client (as I understand it, this tool helps us connect to the Database server, be it a virtual machine or a remote server), I spent several hours installing everything. In Datagrip, when connecting, I specified different settings, wrote the path to the installed instantclient, however, I constantly get an error when connecting (whatever settings I choose), I googled this error, but I still did not understand how I can apply them It is for M1 and not Windows computers.
The error looked like this:
Failed DBMS: Oracle (no ver.) Case sensitivity: plain=mixed, delimited=exact Native library cannot be loaded. no ocijdbc21 in java.library.path: /Users/malkhaz/instantclient_19_8:/Users/malkhaz/lib:/Users/malkhaz/instantclient_19_8.

Oracle client tools 11g for mac, imp command

Do you happen to now if imp oracle command is included in the oracle client tools 11g for MAC OS?
Actually I have download the packages but I can't seem to find it and I am wondering if there is a trick for this.
Thank you
What you have downloaded is the 'Instant Client'. This is basically a sub-set of the Oracle client, just for connecting to the database. Find out more.
The Instant Client does not include admin utilities such as IMP. For that you need the standard client, which is basically the full database software. However, 10g was the only version ever available for MAC OS. I guess the demand wasn't there. How many MAC OS servers are there?

Using Oracle Driver in TSQLConnection

I am using Delphi XE2 and dbExpress in my application. While developing I come to know that I need to install SQL Native client to use MSSQL as driver in dbExpress connection setup (as client machine don’t have SQL installed on it)
Could you please let me know which client I need to install if I want to use Oracle as a Driver in dbExpress (as client machine don’t have any Oracle component installed)?
You need the Oracle Client corresponding to the bitness of your application.
For XE2, if your application is 64 bit, you need the x64 client.
If your application is 32 bit, you need the x86 client.
Installing the Oracle Client is a huge process - win32_11gR2_client.zip is around 700 MB - not bad just for a client! During installation, for DBExpress to work, you just need to select the OCI libraries, not ODBC nor OleDB providers, nor JDBC (unless other Java or .Net clients expect them).
You can install the Oracle Instant Client, which is a set of OCI libraries files - here . Get the latest version, even if your server is older. But there is not installer: you have to uncompress them in your path, or in the executable folder. If you put it in the path, be aware that it may break any installation of other "full clients". The Instant Client Package - Basic Lite: is the smallest (20 MB), works very well, but only with English error messages and Unicode, ASCII, and Western European character set support.
Oracle Instantclient is sufficient.

Selection of jdbc driver for oracle 8i

Which jdbc driver should be used for connecting with oracle 8i? I am using jdk 1.6 and tomcat.
The choices would be (in the decreasing order of preference):
The JDBC driver that is provided with the database itself. This is typically found in the jdbc/lib directory of your Oracle database home.
The most recent driver for the 8i platform. You can get this from Oracle Technology Network. Use this if are encountering any issues (that are typically not patched in the driver supplied by the database).
The JDBC driver that ships with the application server. This is listed as the last preference, for the 8i platform is quite old, and the drivers supplied would have better characteristics for newer releases like the 10g and 11g platforms.
If you are on Java 1.4 or newer, i.e. Java 1.4/5/6, then use the driver within ojdbc_14.jar instead of classes12.zip. The driver within classes12.zip is meant to be used on versions of Java after 1.2 and before 1.4.
If you do have ojdbc5.jar or ojdbc6.jar (unlikely to be the case for the 8i drivers), then they'll need to used in preference over ojdbc14.jar, in the Java 5 and Java 6 platforms respectively. Use these drivers (meant for the Java 5 and Java 6 platforms) with caution though, as the some of these driver versions will simply not be supported when used against an 8i database. For example, the Oracle® Database JDBC Developer's Guide and Reference for 11g R1 states the following:
Backward Compatibility
The JDBC drivers are certified to work
with the currently supported versions
of Oracle Database. For example, the
JDBC Thin drivers in Oracle Database
11g Release 1 (11.1) are certified to
work with the 10.2.x, 10.1.x, 9.2.x,
and 9.0.1.x Oracle Database releases.
However, they are not certified to
work with older, unsupported database
releases, such as 8.0.x and 7.x.
The JDBC developer's guide for 10g R1/R2 might state the same, but you'll need to verify this if you intend to proceed with a driver version that works against a newer database release. In practice, ensure that you know the version of the driver in use, and that it is supported for use against 8i.

64-bit Oracle Client for v8 database

Okay, here's the deal: I have a C#/.NET app accessing an Oracle 8 database, that works well on our 32-bit machines. It works using a v.8 ODBC client, a 9i client, or a 10g XE client. However, nothing seems to work on a 64-bit windows machine. I did successfully install a 64-bit 11g client, only to find it refuses to talk to a v8 database, so I guess what I need is a 64-bit 10g, 9i or 8i client. I tried 9i and 10g XE with no luck. I have not yet tried the full 10g client.
I installed MDAC 2.8, but in the Admin Tools -> ODBC Data Source manager tool, none of those ODBC drivers show up, presumably because they are not 64 bit. Ony MS SQL shows up.
The weird thing is that there is an old program, Impromptu by Cognos, that works fine - it seems quite able to find and use the 32-bit v8 client that is installed on the system, but my app can't.
I found that I could see and create/edit ODBC data sources by making a copy of the ODBC Data Source tool shortcut, changing it to point to a different path (replace system32 with SYSWOW64), but data sources I create there are somehow hidden from my app. Is there a way to point my .NET app to a specific Data Source, maybe by creating a File DSN and specifying a full local path, for example?
This is driving me nuts. Help!
I finally got a client to work:
http://download.oracle.com/otn/nt/instantclient/10203/instantclient-basiclite-win-x86-64-10.2.0.3.0.zip
Thanks all for the comments and help.
Did you try the 11g ODP.NET 64 bit client? The ODP.NET client has no problems connecting to Oracle 8/9/10 databases.

Resources