How to install IBM db2 cli drivers on mac osx mojave - macos

In order to use db2 with node.js on my mac. I have installed the db2 drivers - DB2 v11.1.4.5.
I also configured my environment paths so that the correct config files will be used by unixODBC
I configured the odbcinst.ini, ODBC.ini , db2cli.ini, and the db2dsdriver.cfg files
The issue is that I get the error below when I run the iqsl command or the db2cli validate command
My Error
[S1000][unixODBC][IBM][CLI Driver] SQL10007N Message "0" could not be retrieved. Reason code: "3".
unixODBC isql command syntax
isql usrProd userid password
db2cli validate command syntax
db2cli validate -dsn alias -connect -user userid -passwd password
Environment path stored in file ~/.bash_profile
export PATH=$PATH:/usr/local/share/odbc_db2/clidriver/bin/
export DB2CLIINIPATH=/usr/local/share/odbc_db2/clidriver/cfg/
export DB2DSDRIVER_CFG_PATH=/usr/local/share/odbc_db2/clidriver/cfg/
I have been documenting the steps that I took to install the db2 command line drivers.
My documentation
locations of the IBM DB2 Drivers I have installed:
Client Version (level/bit): DB2 v11.1.4.5 (special_39510/64-bit)
Client Version (level/bit): DB2 v11.1.1.1 (s1703232000/64-bit)
UPDATE --- 20200413----
I got it to work on my Mac. I did get it to work with Node.js
I contacted a few IBM developers who are working directly on this project, and they gave me access to the proper "IBM i Access ODBC Driver" to connect to the as400 from the mac.
It is being beta tested now. At some point, it should be released. to the general public.
db2cli drivers are not needed, db2cli.ini is not needed:
IBM has specific odbc drivers for the iseries. I dont have permission
to share the drivers with the public, but do know that it will be
possible soon for everyone to connect to db2 installed on the iseries

I got it to work on my Mac and I did get it to work with Node.js
I contacted a few IBM developers who are working directly on this project, and they gave me access to the proper "IBM i Access ODBC Driver" to connect to the as400 from the mac. It is being beta tested now, i assume that at some point, it should be released to the general public.
Note : db2cli drivers are not needed, db2cli.ini is not needed, and setting environment paths are not needed:
IBM has specific odbc drivers for the iseries. I don't have permission
to share the drivers with the public, but do know that it will be
possible soon for everyone to connect to db2 installed on the iseries

For IBM DB2 Warehouse on the IBM CLoud you can go to this url
https://your_tenant.cloud.ibm.com/console/#connection/overview
In above replace your_tenant with your tenant id.

Related

Connect to Oracle 19C Cloud from sqlplus

I am not able to connect to my Oracle 19C Cloud DB, I have downloaded the wallet and placed it in a secured place in my machine(windows).
I have installed Oracle 19C Client in my machine,
and updated tnsnames.ora(network/admin) with connection strings from wallet zip,
Not sure how whether I have missed any config like Environment variables
Getting below error from sqlplus
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Note: I am able to connect to Cloud from Sql developer using the wallet file.
And I have Oracle 18c XE running in my machine.
Any help will be appreciated, thanks in advance.
Your problem seems to be related with the issue that you have an Oracle XE database version installed in your own laptop.
When you run sqlplus or any other OCI tool to connect to Oracle, no matter whether the database is a remote host or in the cloud, sqlplus evaluates the TNS_ADMIN environment variable to identify where your sqlnet and tnsnames files are located. If there is no variable, it uses the default values of your main Oracle registry entries, that for sure point to your XE version, as it was installed before.
When you get ORA-12154: TNS:could not resolve the connect identifier specified , your session is not finding any information regarding the target in your configuration files, probably because the session is evaluating the files in your XE installation
Try to do the following
Copy the wallet files provided by your Oracle Cloud to a location different to your XE installation.
Export the TNS_ADMIN variable in your sqlplus cmd session to this new path
Run sqlplus using wallet
Example ( I believe you did points 1 and 2 )
Install Oracle Client software on your computer. Use either the full
Oracle Database Client 11.2.0.4 (or higher) or the Oracle Instant
Client 12.1.0.2 (or higher). The Instant Client contains the minimal
software needed to make an Oracle Call Interface connection. The
Instant Client 12.1.0.2 (or higher) is sufficient for most
applications.
Download client credentials and store the file in a secure folder on
your client computer. See Download Client Credentials (Wallets).
Unzip/uncompress the credentials file into a secure folder on your client computer.
Edit the sqlnet.ora file in the folder where you unzip the
credentials file, replacing "?/network/admin" with the name of the
folder containing the client credentials.
Example
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/my_new_path")))
SSL_SERVER_DN_MATCH=yes
cmd> set tns_admin = my_new_path
cmd> sqlplus /#yourtnsentry
I don't know whether your cloud database is using a Public IP address or not, or if you want to use SSH tunneling to connect to the database. Take a look here, because then you might want to use SQLcl ( Sql Developer Command Line )
https://docs.cloud.oracle.com/en-us/iaas/Content/Database/Tasks/connectingDB.htm

Oracle 11g XE - Can't login and database is down

Just installed Oracle 11g XE (Windows), but can't connect in SQL Developer or run any command in CLI.
When try to connect in CLI using SYS or SYSTEM with password defined during the install, get the following error:
ORA-12638: credential retrieval failed
When I tray to connect via SQL Developer (tried via SID and Service Name, hostname=localhost, port=1521, SID=xe), get this error:
Status : Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in
connect descriptor
Already tried change SQLNET.AUTHENTICATION_SERVICES = (NTS) to (NONE) in sqlnet.ora file. When I do this, get the following error when try to connect with the SYS or SYSTEM user and password:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Already tried every solution in Google results, like reinstall, stop and start services... Mostly ask for first connect in CLI to make some changes, but even this I can't accomplish.
Any suggestions on how connect to the database?
Found the solution:
I was installing in my company Windows user domain.
First uninstall any instance of Oracle XE 11g.
Switch to a local administrator Windows user and install Oracle XE 11g.
Sign off and back to company Windows user.
Edit the file C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\sqlnet.ora (or equivalent to your installation path). Change SQLNET.AUTHENTICATION_SERVICES = (TNS) to SQLNET.AUTHENTICATION_SERVICES = (NONE).
This change will allow you connect to database from you company Windows user.
As seen here: Error ORA-12638 in Oracle Database 11g
Try the following: Open command window, cd to Oracle bin directory, enter sqlplus /nolog. If you get a prompt enter connect / as sysdba. If you get connected then you can try "startup".
- -
Did you try to start the Oracle RDBMS service via Services (services.msc)?
Do you use an spfile? Check the registry for ORA_SID_NAME_PFILE that is different from default location of $ORACLE_HOME/dbs. Also check the default location. Use only the default location or the registry entry removing either the registry entry or the file in the default location depending on which you want to use.

How to connect to Pervasive SQL server in Ruby Application?

I am trying to connect to a Pervasive Sql Server which is running on Windows machine from my Ruby application which is on Ubuntu Machine. Can Someone please help me on same. Thanks in advance
Below is my configuration on linux machine
/etc/freetds/freetds.conf
[pserver]
host = XXX.XXX.XX.XXX
port = 1583
tds version = 8.0
Under /etc/odbcinst.ini, I have saved the driver info like below
[freetds]
Description=freetds Driver
Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
Trace=Yes
TraceFile=/tmp/freetds.log
ForceTrave=Yes
UsageCount=10
fileusage=1
dontdlclose=1
TDS_Version = 8.0
In /etc/odbc.ini, client and database details
[pclient]
Description = Pervasive SQL Server
Driver = freetds
Trace = Yes
Servername = pserver
Port = 1583
Database = "MyDatabasename"
TDS_Version = 8.0
tsql -S pserver -U db_username -P db_password -d MyDatabasename
above cmd gives error saying
Error 20009 (severity 9):
Unable to connect: Adaptive Server is unavailable or does not exist
OS error 111, "Connection refused"
There was a problem connecting to the server
iodbctest ["DSN=pclient;UID=db_username;PWD=db_password"]
this results in
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0812.0326
(iodbctest:6672): Gtk-WARNING **: 20:40:38.693: cannot open display:
Not able to understand the above result and how to handle this. Please help
As far as I know, the only way to access Pervasive PSQL from Ruby would be through ODBC. You need to use the Pervasive Client ODBC driver. Don't use the FreeTDS driver. I've never heard of using the FreeTDS driver to connect to Pervasive PSQL. In fact, this question mentions that FreeTDS doesn't work to Pervasive PSQL. Pervasive PSQL and Microsoft SQL Server are not the same product and the client for one cannot connect to the server of the other.
The short answer would be to install the Pervasive PSQL client on the Ubuntu machine, create the ODBC Datasource name pointing to the database on the Windows machine and then use ODBC from within Ruby to access the data.
You'll want to be on at least Pervasive PSQL v11.30, preferably Actian PSQL v13 (current version as of December 2018). You'll need to download and install the client appropriate for the application. If the Ruby application is 32 bit, you need the 32 bit ODBC driver. If the application is 64 bit, you'll need the 64 bit driver. The 'bitness' of the OS is not as important. You need to use the same PSQL client version as server version. You cannot use the v13 client with a v11 server.

Oracle BigData Lite with Windows Active Directory

I am currently trying to use Oracle BigData Lite VM to simulate connectivity with Windows Active Directory(Windows Server 2012) on another VM.
Both VMs are on Oracle VBox. However it kept giving me this error when i used cloudera manager in the Lite VM to enable kerberos:
/usr/share/cmf/bin/import_credentials.sh: line 84: ldapsearch: command not found
echo 'ldapsearch did not work with SASL authentication. Trying with simple authentication'
echo 'Failed to do ldapsearch.'
echo 'Please make sure Active Directory configuration is correctly specified and LDAP over SSL is enabled.'
I am guessing that I need to configure the SSL portion before enabling kerberos? Btw, I am able to telnet over to Windows AD. If so, how do I go about doing it? Any help would be greatly appreciated.

Oracle tns listener error

I've just installed Oracle 10g When I try to connect to oracle db i get an error:
could not start OracleOraHome92TNSListener
when i got to services and try to start it, it says that the file doesnt exist. the service file is C:\oracle\ora92\BIN\TNSLSNR (TNSLSNR is a file not a directory)
C:\oracle\ora92\BIN\TNSLSNR doesn't exist on my machine at all. do you know how to get it?
Could not start the Oracle Ora92 Listener service on Local Computer.Error 2: The system cannot find the file specified
Here's a couple of issues I see. You say you installed 10g but the error is a 9.2 error. It could be that your computer already had an Oracle 9i on it that was mis-configured or uninstalled and that is leading to the error.
You need to check your disk and find the ORACLE_HOME (directory) where Oracle 10g was installed. Once you find that you can adjust the PATH and ORACLE_HOME and TNS_ADMIN environment variables to point to the right place. This should allow you to start the database and the listener.
If you need to install the Oracle Client for 10g then this information below will be helpful as well.
The Oracle client can be installed separately. Just go to this address, download the client and unzip it into a subdirectory and then run the Oracle Universal Installer by running setup.exe from the directory.
Oracle Downloads Page

Resources