PostgreSQL environment file on Mac OSX? - macos

PostgreSQL seems to have an environment file that allows settings environment variables. On Linux (Kubuntu 11.10 in my case), it is located at e.g. /etc/postgresql/8.4/main/environment and empty by default, apart from a few helpful comments.
On Mac OSX Lion, the file does not seem to exist: I would expect it at e.g. /Library/PostgreSQL/9.0/data/ as that's where all the other configuration files are, but it is not there - and if I create it, it does not seem to be used.
How can I set environment variables for the PostgreSQL server on Mac OSX ?

There is no standard way to specify environment variables for PostgreSQL, I assume that file is Kubuntu specific.
What I did to ease my life was copying approach used by ORACLE:
I have /etc/pgtab file on each server where I run PostgreSQL databases;
I specify each cluster I run on a single line in the /etc/pgtab;
I've created a script pgenv which based on the /etc/pgtab shows the menu of clusters (in case there're more then just one) and initialize all PATHs and variables.
It works on my MacBookPro and on all Linux and HP-UX based servers.

Related

Getting Sqldeveloper working with instantclient on Windows without admin privileges?

I've installed Sqldeveloper Version 19.1 64-bit Version on an enterprise PC with Win10-64bit.
It works fine with embedded jdbc-client, but I need to get it working using the Oracle OCI-client. One reason is the much better support to cancel long running queries.
Using an OCI-client (thick-driver) requires for sure a client like instantclient_12_2.
I have no admin privileges on my workstation and so copied the full instantclient_12_2 to the enterprise PC.
Since I'm not allowed to change the %PATH% myself, I created a start.bat file with required settings, because without, it also won't work (already tried).
PATH="C:\Users\myuser\OneDrive\Oracle\instantclient_12_2";%JAVA_HOME%;%PATH%
C:\Users\myuser\OneDrive\Oracle\sqldeveloper64\sqldeveloper.exe
When I try to configure another Oracle-Client without this change, I get another error, that PATH to instantclient needs to be defined before any others.
Now, starting sqldeveloper with this bat-file works fine. Connections can be established using the internal jdbc client.
Then, I've configured the Oracle Client in SQLdeveloper (Preferences/Database/Advanced) and selected the instantclient directory.
Pressing the "Test" button opens the Messages log "Oracle Client Test Results - Log" and shows an error.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occured, Program will exit.
Unrecognized option: -
Now, I'm lost, because I'm not a Java-Expert. I'm wondering, why sqldeveloper as Java-tool is running, but the instant-client says it can't create the JVM.
The reason for me to use OCI-client is, that it has e.g. better support of User-breaks.
Without admin privileges and no permission to change your %PATH% env permanently, you only need to install the whole directory somewhere and add a .BAT file, that changes environment temporarily before calling SQL-Developer.
Install complete SQL-Developer e.g. in C:\myprogs\sqldeveloper
Install instant-client somewhere, e.g. in C:\myprogs\instantclient_12_2
Create .BAT file, e.g. C:\myprogs\sqldeveloper\startsqldev.bat with following content:
set PATH=C:\myprogs\instantclient_12_2;%PATH%
REM start sqldeveloper
"C:\myprogs\sqldeveloper\sqldeveloper.exe"
It works for versions > 20 as well ;-)
Meanwhile, I've solved it.
Result of testing:
Testing the Instant Client located at C:\Users\myuser\Oracle\instantclient_12_2
Testing client directory ... OK
Testing loading Oracle JDBC driver ... OK
Testing checking Oracle JDBC driver version ... OK
Driver version: 12.2.0.1.0
Testing testing native OCI library load ... OK
Success!
Reason were following mistakes:
Forgot "set" in front of Variable assignment (because I'm usually using Unix)
Used quotation marks during Variable assignment, which are taken as part of the value (also different to UNIX).
Added JAVA_HOME and JRE_PATH
See below my complete bat-file (adapted, because of some secret information within pathnames):
REM Optional: setting of USE_OS_DATETIME_FORMAT changes DATE-Format
set USE_OS_DATETIME_FORMAT=1
set PATH=%USERPROFILE%\OneDrive - myCompany\Oracle\instantclient_12_2;%JAVA_HOME%;%PATH%
REM start your preferred sqldeveloper
"%USERPROFILE%\OneDrive - myCompany\Oracle\sqldeveloperx64.20.2\sqldeveloper.exe"C:\Users\myuser\OneDrive - myCompany\Oracle\sqldeveloperx64.19.1\sqldeveloper.exe"
Additionally, I've added a shortcut to the bat-file and now I can start it simply with CRTL-SHIFT-S ;-)
BTW: Same solution works fine on Win10 as well

Remote debuging with gdbserver for application with X (qt) environment

I have been trying to remotely debug an application which can only be run on a specific server because of hardware limitations. To normally run the program I would login to an ssh shell with X.11 forwarding enabled (-X option of ssh) and its QT interface will show up.
I have been trying to achieve the same but with no success while debugging via gdb with the gdbserver and the integrated gdb client of Eclipse IDE.
Is there a way to achieve this?
I have already tried to copy the settings of the system variables DISPLAY and XDG_RUNTIME_DIR of an ssh -X session (the later being empty) but with no success. Searching for it gives no relatable results (or I may need a hint on what to search).
It's not the cleanest solution, but you can manually set the DISPLAY variable in /etc/environment. Variables set in /etc/environment are available to the entire system. You'll need to reboot the server before gdb will see it.
See: https://help.ubuntu.com/community/EnvironmentVariables#A.2Fetc.2Fenvironment
Here's a one-liner to append your current DISPLAY variable
echo "DISPLAY=$DISPLAY" >> /etc/environment

How to update Windows environment variables after Ansible's win_environment module?

I am using Ansible to configure our Windows Servers 2012.
I am using Ansible's Windows modules: win_xxx. All modules are working fine except for
win_environment
win_path
I think the win_path depends win_environment module in my case.
I am installing
JDK
Apache Ant
Apache Tomcat8.
Installation works fine and setting up the environment variables for
JAVA_HOME
ANT_HOME
is not working as expected. The server is not updated with the new environment variables. I need to sign out and sign in back to the server in order the new variables are updated. Is there any way to update the system in Ansible or in Windows Batch/Powershell without signing in and out?
just to remind that "User level environment" variables will be set, but not available until the user has logged off and on again.
check then either you have selected "user" as level on you win_environment module.

Beginner GWAS topic: virtual box command line can't find .ped file?

I am new to GWAS analysis and I've been trying to run the PLINK tutorial sample datasets (hapmap 80K loci) on gPLINK to do some exclusions. I am currently working on a Mac OSX 10.10. I've applied the threshold settings (high missing rate, low MAF etc.) to my file "hapmap1.ped" and prepared to execute the command through gPLINK, however it keeps giving me the error prompt "can not execute command locally".
Is there something wrong with my library or directory settings?
gPlink runs in two modes a remote mode and a local one. It seems you are running the local one. Please check if you are specifying the correct path where PLINK is installed when cofiguring gPlink. For more details refer to gPlink configuration

Problems with loading native library/missing methods: no ttJdbcCS in java.library.path

Iam facing one problem while connecting the timesten client to the server The SQL Exception which Iam getting is pasted below:-
Problems with loading native library/missing methods: no ttJdbcCS in java.library.path
I am working with MAC OS X 10.7.2 and my timesten client version is 11.2.1.0
I have also changed the Java Preferences from 64-bit to 32-bit but still whenever i tried to connect with the SQL Developer it gives me the above error.
Please help me as it is required for my graduation project!!!!
I don't know OS X. On linux I use next
export LD_LIBRARY_PATH=/opt/TimesTen/timesten/lib/
(directory where ttJdbcCS.so located)
Java must be same "bithes" (32 or 64) as TimesTen installation
I solved the by doing the following:-
The key things you need to be sure to do (in a terminal window) are:
Be sure to . in the TimesTen environment script /bin/ttenv.sh to set the full TT environment.
Change directory to SQLDeveloper.app/Contents/Resources/sqldeveloper
Run 'sh sqldeveloper.sh -J-d32'
and all should be fine.
Thanks all for their help!!!!

Resources