Error when creation PLR extension Postgres - sql

I'm trying to create PLR extension in Postgres 10.4 and it gives me error:
ERROR: could not load library "C:/Program Files/PostgreSQL/10/lib/plr.dll": The specified module could not be found.
SQL state: XX000
I use Windows 10, R 3.4.2. I downloaded PL/R of this version: Win64 plr.dll for Postgres 10.x, R-3.4.2 (plr-8.3.0.17)
I put dll file in the lib folder as required and restarted the psql service. R_HOME is set to C:\Program Files\R\R-3.4.2.
Path variables: C:\Program Files\PostgreSQL\10\lib and C:\Program Files\PostgreSQL\10\bin
What can be wrong?

You need also plr.control and corresponding sql files in share/extension/ folder.
Newer version of PL/R does not require R_HOME anymore on Windows as long as the proper information is in the Windows Registry HKLM\SOFTWARE\R-core\R. Uninstalling older versions of R may remove that!!!

Related

jpype.getDefaultJVMPath() fails when I try accessing JVM from python3

I am currently using Python3, java8, jpype 0.6.3 version on windows10.
jpype.getDefaultJVMPath() fails with an error :
raise JVMNotFoundException("No JVM shared library file ({0}) "
jpype._jvmfinder.JVMNotFoundException: No JVM shared library file (jvm.dll) found. Try setting up the JAVA_HOME environment variable properly.
My JAVA_HOME points to C:\Program Files (x86)\Java\jdk1.8.0_241
If I try starting JVM directly by passing the jvm.dll path("C:\Program Files (x86)\Java\jdk1.8.0_241\jre\bin\client\jvm.dll) python program crashes.
I have already given executable permission to .dll file
Could anyone please help me fix this issue for the above system specifications
It is possible that your JVM architecture (32 bit) does not match your Python (64 bit). This would cause the symptoms you are describing.
It turns out that the shared code I was using required a specific version of one of the drivers. I still don't understand it all enough to explain why that was but with the older driver version (from a colleague) everything works!
from jpype import *
startJVM("/home/user_name/Downloads/ideaIC-2022.2.3/idea-IC- 222.4345.14/jbr/lib/server/libjvm.so", "-ea")
java.lang.System.out.println("hello world")
shutdownJVM()
This works for me
set the path manually
startJVM("/home/user_name/Downloads/ideaIC-2022.2.3/idea-IC- 222.4345.14/jbr/lib/server/libjvm.so", "-ea")
If this path is not correct for you
Search for this file libjvm.so inside partition computer on linux
Then copy the file path

Oracle 12c Release 2: Environment variable: "PATH" Status: Failed

So I am trying to install oracle 12c in my Windows 10 x64 Dell laptop, but I keep getting the following error:
I have tried the following but none of them succeeded:
Deleting directories from Path to shorten it.
Running cmd as an administrator and executing the setup.exe from there.
Renaming Path to PATH.
Restarted laptop several times in order for the changes to apply.
What am I missing here?

where is the "TargetFrameworkSDKToolsDirectory" was defined

I was using msbuild build my sln and get error message "couldn't find 'AxImp.exe' which already exists under %Program files (x86)%\Microsoft sdks\windows\v8.1A. but seems it find sdk from v8.0A, output info point out the error was in Microsoft.Common.targets file(code see below). I didn't found where the "TargetFrameworkSDKToolsDirectory" was defined, anyone can help me?
environment: winblue(4.5.1 sdk v8.1A) without visual studio.
<ResolveComReference
TypeLibNames="#(COMReference)"
TypeLibFiles="#(COMFileReference)"
ResolvedAssemblyReferences="#(ReferencePath)"
WrapperOutputDirectory="$(InteropOutputPath)"
IncludeVersionInInteropName="$(IncludeVersionInInteropName)"
KeyContainer="$(KeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
DelaySign="$(DelaySign)"
StateFile="#(_ResolveComReferenceCache)"
TargetFrameworkVersion="$(TargetFrameworkVersion)"
TargetProcessorArchitecture="$(ProcessorArchitecture)"
NoClassMembers="$(ComReferenceNoClassMembers)"
Silent="$(ResolveComReferenceSilent)"
EnvironmentVariables="$(ResolveComReferenceEnvironment)"
**SdkToolsPath="$(ResolveComReferenceToolPath)"**
ExecuteAsTool="$(ComReferenceExecuteAsTool)"
MSBuildArchitecture="$(ResolveComReferenceMSBuildArchitecture)"
ContinueOnError="$(ContinueOnError)">
<**ResolveComReferenceToolPath** Condition="'$(ResolveComReferenceToolPath)' == ''">$(**TargetFrameworkSDKToolsDirectory**)</ResolveComReferenceToolPath>
Depends on the version and platform you're targeting, but latest is at C:\Program Files (x86)\MSBuild\12.0\Bin\Microsoft.NetFramework.CurrentVersion.props, follow your imports, i.e. <Import Project=".targets" />. To get the values run MSBuild with /v:diag and all evaluated properties will be dumped and the start.
what ended up working for me was installing:
Windows Software Development kit (SDK) for windows 8
even though I'm on widows server 2016
https://developer.microsoft.com/en-us/windows/downloads/windows-8-sdk
I guess the clue was in my error:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2428, 5): error MSB3086: Task could not find "LC.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed

Installing Orafce.sql 3.0 in Windows 7

As mention in Orafce Install.orafunc:
..install Orafce functions in the database, either run the orafce.sql script using the pgAdmin SQL tool..
I tried running the orafce--3.0.sql in pgAdmin sql editor. This give me error
ERROR: could not access file "MODULE_PATHNAME": No such file or directory.
What do you mean by module path?
Installed program:
strawberry perl with DBD::Oracle
postgresql 9.3
pgAdmin III
Not fully installed:
ora2pg
I tried installing ora2pg...with a problem.
H:\PostgreSQL\ora2pg-12.1>perl makefile.pl
Unparsable version '' for prerequisite DBD::Oracle at makefile.pl line 553
Generating a dmake-style Makefile
Writing Makefile for Ora2Pg
Writing MYMETA.yml and MYMETA.json
Done...
H:\PostgreSQL\ora2pg-12.1>dmake && dmake install
"Installing default configuration file (ora2pg_dist.conf) to C:\ora2pg"
Appending installation info to C:\strawberry\perl\lib/perllocal.pod
dmake: Warning: -- Target [install] was made but the time stamp has not been up
dated.
Suggested Solution:
I downloaded a copy of orafce from okbob github
Unzip the file to folder D:/Postgresql/orafce-master
I copy only the following files
orafce--unpackaged--3.0.6.sql
orafce--3.0.6.sql
orafce.control
to folder C:\Program Files\PostgreSQL\9.3\share\extension
Then I try running this command in pgAdmin III sql tools.
CREATE EXTENSION orafce;
I received this Warning and Error.
[WARNING ] CREATE EXTENSION orafce
ERROR: syntax error in file "C:/Program Files/PostgreSQL/9.3/share/extension/orafce.control" line 1, near end of line
I checked orafce.control content. It has this config.
# intarray extension
comment = 'Functions and operators that emulate a subset of functions and packages from the Oracle RDBMS'
default_version = '3.0.6'
module_pathname = '$libdir/orafunc'
relocatable = false`
I can't pass to this wall. What seems the problem?
So, you are working with source raw files. You should to compile these files first - and later you can use it. It is relative simply on Unix like platforms, where C compiler is usually available, and pretty hard on MS Windows, where you have to install C compiler first.
I afraid so we lost pgFoundry archive, where was orafce precompiled and packed.
Almost all Linux distributions support orafce directly - and you can install it without compilation from repositories.
see http://wiki.postgresql.org/wiki/Building_and_Installing_PostgreSQL_Extension_Modules
$libdir is symbol, that is used for PostgreSQL extensions directory. It can be different for any platform - and it is replaced inside compilation stage by actual value. MODULE_PATHNAME has similar meaning. In compilation stage is replaced by valid actual path to library with compiled code.
I am sorry - we don't provide a compiled files - mainly due high risk for MS Windows. We have no forces, and tools to maintain all Win safely. In this moment, you can:
try to contact someone who use orafce for windows for backup of orafce installers
try to compile this extension by self (Microsoft Visual Studio Express edition is free and downloadable on internet).
other possibility is migrate database server to Linux - almost all database maintenance and usage is more simply and more robust there (due missing viruses, antiviruses and less resource requests). The Linux is primary platform for Oracle too.
some tutorials:
http://blog.2ndquadrant.com/compiling-postgresql-extensions-visual-studio-windows/
http://www.scribd.com/doc/40725510/Build-PostgreSQL-C-Functions-on-Windows

install ioncube on windows server 2008 with plesk

I have a problem install ioncube on windows plesk control panel.
I used the thread-safe version of PHP and download Windows VC9 (x86) ioncube.
I Put the Loader files in C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext
I do Edit the file C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php.ini and before any other zend_extension_ts lines ensure that the following is included:
zend_extension_ts = "C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\ioncube_loader_win_5.2.dll"
and Restart the IIS server software.
but not run ioncube. :(
Additional Information:
Loader is at: C:\Program Files
(x86)\Parallels\Plesk\Additional\PleskPHP5\ext\ioncube_loader_win_5.2.dll
Loader OS code: win
Loader architecture: x86
Loader word size: 32
Loader PHP version: 5.2
Loader thread safety: Yes
Loader compiler: VC6
Loader version: 4.0r7
File size is: 475136 bytes.
MD5 sum is: a82aa4dc4ce18ff62ea8faaca97a31be
Loader file: Download loader file
Loader found in ini file: Yes
OS extra security: None
PHPRC is: EMPTY
INI DIR is: EMPTY
Additional INI files: (none)
Server type is: LOCAL
PHP uname: Windows NT EASYSOFT 6.1 build 7600
Server word size is: 32
Disabled functions: EMPTY
Writeable loader locations: C:\inetpub\vhosts\E-touch.ir\httpdocs,
C:\inetpub\vhosts\E-touch.ir\cgi-bin
Find Solve
I do upgrade Plesk and running php in command line mode
php -c "C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php.ini" -v
I using the cammand found Problem in php.ini.
When the problem was resolved. ioncube was Run. :D