Unable to Install DBD::Oracle for Perl on Windows - perl

When trying to install DBD::Oracle library i received the following error message "Can't load /usr/lib/perl5/site_perl/5.24/x86_64-cygwin-threads/auto/DBD/Oracle/Oracle.dll for module DBD::Oracle: No such file directory at /usr/lib/perl5/5.24/x86_64-cygwin-threads/DynaLoader.pm"
I installed the DBD::Oracle library on windows using the below steps:
instantclient-basic-11.2.0.4.0
instantclient-sqlplus-11.2.0.4.0
instantclient-sdk-11.2.0.4.0
Then, I unzip them all to c:\Oracle.
Next, I included the below directory in my system environmental on windows as shown below
ORACLE_HOME=C:\Oracle\instantclient_11_2
LD_LIBRARY_PATH=C:\Oracle\instantclient_11_2\lib (There is no lib directory in this folder, but i followed the instructions of an online article regardless)
Finally, I opened command prompt and ran and received that error message:
perl -MCPAN -e "install DBD::Oracle"

I resolved the problem by installing the 32-bit Oracle Client 11g version onto the computer in this location c:\oracle. It doesn't work using the instantclient version because the instant client doesn't contain the necessary libraries.
Download "Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (32-bit)" from the below link and install the full administrator verion
http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
Next, create ORACLE_HOME variable in your environmental variables on your computer and add the following path to it: ORACLE_HOME=C:\Oracle\product\11.2.0\client_1
Next, create LD_LIBRARY_PATH variable and add the below path:
LD_LIBRARY_PATH=C:\Oracle\product\11.2.0\client_1\lib
Afterwards, install module using perl without testing it. During the test it will fail, because its trying to connect to your database:
perl -MCPAN -e shell
notest install DBD::Oracle
Open the odbcad32.exe in this location C:\Windows\SysWOW64\ and click Add. Type Oracle for the name and description and click save. The SysWOW64 will connect the 32-bit version of the odbcad32 application to create the reference.
NOTE: The biggest problem you will have is to ensure you are using 32-bit drivers using cygwin, oracle software, and odbcad32. You will receive that can't load library if you mix 64-bit drivers with 32-bit drivers.
Reopen any command prompt window and try running your perl script again.

Related

Install ora2pg [DBD::Oracle] manually on windows machine behind firewall no direct access to internet

I am trying o install ora2pg and followed ora2pg-on-windows
I am stuck at
perl -MCPAN -e "install DBD::Oracle"
as my windows machine is behind a firewall and networking is not allowing this to open to it up to the internet. Is there a way to manually download and install DBD::Oracle. Any help is appreciated.
Thanks
Download the module,
move it to the machine, unpack the archive and follow the instructions in the INSTALL file:
As a last resort, you can manually install it. Download the tarball, untar it,
install configure prerequisites (see below), then build it:
% perl Makefile.PL
% make && make test
Then install it:
% make install
On Windows platforms, you should use dmake or nmake, instead of make.
Of course you'd need the nmake or dmake commands installed, a C compiler etc. It may be simpler to build it on a Windows machine with access to the internet and transfer the files to be installed to the target machine.

How can I install MongoDB 3.X on Windows without admin rights?

I'm on a Windows 7 (64-bit) box and do not have admin rights.
It appears from the MongoDB download page (see http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/) that the latest version only an MSI install is available (no zip version).
I tried running the 3.0.4 MSI. I clicked custom so I could change the directory to install to. I used %USERPROFILE%\MyProgs\MongoDB-3.0.4, so no admin rights would be needed. It ran for a bit but then prompted me to enter admin credentials. I hit escape (like clicking on X at top right) to close the window. On other MSI installs this has worked. I tried it again and clicked "No" but in both cases received the message
MongoDB 3.0.4 2008R2Plus SSL (64 bit) setup was interrupted.
Your system has not been modified. [...]
This article does a GREAT job going through how to install MongoDB on Windows:
How to install mongoDB on windows?
My observation is that v2.4.14 is the last version that is available via the ZIP format. So for now, I'm using that version.
Is there any other way to install the MongoDB version 3.X MSI without admin rights?
NOTE: On the MongoDB Download page https://www.mongodb.org/downloads there is a link titled View Build Archive (it sends you here https://www.mongodb.org/dl/win32/x86_64-2008plus-ssl, and that site lists *.zip formatted files). I thought I had found my own solution to the question, but when I unzipped the files, and added the "bin" to my path and ran the programs (mongo, and mongod) I received an Windows Dialog that says:
mongod.exe - System Error
The program can't start because LIBEAY32.dll is missing from your
computer. Try reinstalling the program to fix the problem
I stopped here and posted this question. Thanks for any help.
For now I'm using the version that supported the zip format (v2.4.14) and that version does work.
NOTE2: The v2.4.14 zip formatted install doesn't have a file named LIBEAY32.dll), or I might have tried using that file with the newer version.
Yes, it is possible to install the latest MSI (including the one with SSL) without admin rights via command line.
msiexec /a mongodb-win32-x64-3.2.5.msi /qb TARGETDIR="C:\MongoDB"
This will copy the binaries into C:\MongoDB\MongoDB\Server\3.2\bin
I dislike long paths like that, so I create a symlink inside the folder:
cd C:\MongoDB
mklink /j bin C:\MongoDB\MongoDB\Server\3.2\bin
That will create a soft link as C:\MongoDB\bin (which you can add to your PATH environment variable).
mongo --version
mongod --version
Both should return version 3.2.5.
You can do this with most packages, we have to do similar with Python 2.7 and Node 4.4.3 MSI packages on work computers that do not have admin rights.
You can download the "legacy" version which is the unsigned non msi version as a zip. The disclaimer is listed as
The 64-bit legacy build does not include SSL encryption and lacks
newer features of Windows that enhance performance. Use this build for
Windows Server 2003, 2008, or Windows Vista
The 3.0.5 version is https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-3.0.5.zip
The latest version is available as zip download.
[https://www.mongodb.com/dr/fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.6.zip/download][1]
Download and Unzip into folder where user has permissions e.g c:\users\xxx\mongodb.
Enter the path to bin folder (e..g c:\users\xxx\mongodb\bin) into the
environment variable 'PATH'. To access path variable press Win + R
and then enter rundll32 sysdm.cpl,EditEnvironmentVariables.
Select Path and click edit. Then enter new and there enter the path
to bin folder. Click OK and OK to save and exit.
Check Mongo version from command line using command mongo --version.
Note: Don't forget to create db folder in C drive that is required for mongo to work locally. All set.

Active State Perl : Unable to download modules using ppm

I have downloaded active state perl on a windows 32 bit machine. I have perl file which uses CGI Lite module. So I tried installing it from the command prompt. But its giving me an error. How can I download the desired modules in active state perl using the ppm?
P:\>ppm install CGI-Lite
ppm install failed: Can't find any package that provides CGI-Lite
I got the solution from the following document:
http://community.activestate.com/forum-topic/using-ppm-thru-proxy
By the way the ActiveState's Perl contain cpan utility allowing you to install modules which have no versions in the Repositories. Just type in cmd.exe:
C:\users\roman> cpan CGI::Lite
When you are working under a proxy, run these commands from command prompt:
SET HTTP_proxy=http://proxy:port #for this check your proxy setting
SET HTTP_proxy_user=<your user name> #system user
SET HTTP_proxy_pass=<your password> #password for same user
Read this document for details.

How I can connect to Oracle from Perl?

We have Oracle Server " Oracle Version: 10.2.0.4.0 - 64bit". I like to connect to this server with Perl from my RHEL machine. I am able to connect via sqlplus successfully. I can use 32-bit or 64-bit Perl. I have few questions.
Which files I should download from Oracle.com and where should I install them?
What are the environment settings or path that I should set?
What are the configuration changes or Makefile arguments changes I should make to install DBD::Oracle module properly?
Thanks.
Please ignore the previous answer as it is woefully out of date.
All you need to download is the oracle "instant client" for Linux:
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
This gives you what you need to build the Perl module.
A quick google brought up the following for an install guide:
http://duberga.net/dbd_oracle_instantclient_linux/
(I'm sure there are others)

Where do I get libpq source?

I want to write application which uses Postgresql as DBMS.
To write client application do I need libpq library and header files?
If yes where I would get libpq library and header files.
Libpq is included in the full PostgreSQL source code. You can use just libpq without the rest of PostgreSQL, but must download the full package.
You can download it from the PostgreSQL Downloads page.
Once you extract the full package it is inside src\interfaces\libpq.
The PostgreSQL installation guide details how to install only the client libraries in the Installation section, under Client-only installation.
Libpq documentation is also available.
In postgresql sources, src\interfaces\libpq.
And yes, it is possible to compile only the libpq.
get the lipq from repo, {for debian} :
sudo apt-get install libpq-dev
I was also facing this issue but didn't got a clear answer:
This issue clearly states that while installing diesel-cli system is not able to locate libpq.lib
First of all you should have a Postgres installed on your machine.
Also diesel require visual c++, thus download and install it if not already, the size of setup will be ~5gb.
Once above installations are done you need to setup environment variables:
In my case path of Postgres installation is C:\Program Files\PostgreSQL thus add 2 environment variable path under User variables add new in Path where your libpq.lib is located in my case it is available in both C:\Program Files\PostgreSQL\12\lib and C:\Program Files\PostgreSQL\12\bin
Once this is added create one more environment variable PQ_LIB_DIR and set path as shown below
Note: Once done re-trigger the installation command in a new cmd window
Source: pq-sys and github-solution
For Windows users, it's in (version may be different)
C:\Program Files\PostgreSQL\11\lib
There you find libpq.lib. Provide this directory to Linker input.
Don't forget to include C:\Program Files\PostgreSQL\11\include directory for include directories.
I fix this problem reccently. This is a solution if you don't want to install Postgres in you windows.
At first, you need download Postgres Binaries. The version I download is 13.6, but it's seems like any version is fine.
Unzip the zip file.Copy libpq.lib from pgsql\lib to shomewhere like C:\Program Files\Postgres\lib.
Execute the following command in cmd window.
setx PQ_LIB_DIR "{where_you_copy_to}"
Open a new cmd windows and install diesel_cli
cargo install diesel_cli --no-default-features --features postgres
In linux vertify you get the libpq.
1st, there is an app: pg_config: https://www.postgresql.org/docs/current/app-pgconfig.html
after you found out the pg_config absolute bin path.(if you installed multi version of postgressql) Then You can get
--includedir
Print the location of C header files of the client interfaces.
--libdir
Print the location of object code libraries.
Then try to compile/build some example code: https://www.postgresql.org/docs/current/libpq-example.html
Some common failure example: https://www.postgresql.org/docs/current/libpq-build.html
You can install Postgres locally from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads but select only "Command line tools" for install.
After that, you can found libpq.dll in C:\Program Files\PostgreSQL\15\bin