Setting enviorment variables in Informix database to start - informix

i have installed Informix database server(11.70) successfully.but get problems in starting the DB server.when i run it give me error.
Warning: could not access INFORMIXSQLHOSTS /opt/IBM/informix1/etc/sqlhosts.
How to create this sqlhosts file and what is the exact content of this file.in my etc directory i have some similar files named :
sqlhosts.cmsm.sample
sqlhosts.cmsm.sample.all
sqlhosts.cmsm.sample.client
sqlhosts.cmsm.sample.er
sqlhosts.demo
sqlhosts.ol_informix1170_1
sqlhosts.std
but there is no file named sqlhosts in /etc/ folder.please guideline how to prepare this file ??

I suppose you created the instance during the install process. From your file list I suspect that the name was "ol_informix1170_1". I'd say, but I cannot be 100% sure that in order to setup the environment for your Informix instance, you need (as a minimum) set the following:
INFORMIXDIR=/opt/IBM/informix1
INFORMIXSQLHOSTS=/opt/IBM/informix1/etc/sqlhosts.ol_informix1170_1
ONCONFIG=onconfig.ol_informix1170_1 #check if this file exists (in $INFORMIXDIR/etc)
INFORMIXSERVER=ol_informix1170_1 #check that this is the value of the SERVERNAME in the previous file
PATH=$PATH:$INFORMIXDIR/bin
export INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXSQLHOSTS PATH
Regards

Related

Why isn't telegraf reading environmental variables?

My goal is to put my telegraf config into source control. To do so, I have a repo in my user's home directory with the appropriate config file which has already been tested and proven working.
I have added the path to the new config file in the "default" environment variables file:
/etc/default/telegraf
like this:
TELEGRAF_CONFIG_PATH="/home/ubuntu/some_repo/telegraf.conf"
... as well as other required variables such as passwords.
However, when I attempt to run
telegraf --test
It says No config file specified, and could not find one in $TELEGRAF_CONFIG_PATH etc.
Further, if I force it by
telegraf --test --config /home/ubuntu/some_repo/telegraf.conf
Then the process fails because it is missing the other required variables.
Questions:
What am I doing wrong?
Is there not also a way of specifying a config directory too (I would like to break my file down into separate input files)?
Perhaps as an alternative to all of this... is there not a way of specifying additional configuration files to be included from within the default /etc/telegraf/telegraf.conf file? (I've been unable to find any mention of this in documentation).
What am I doing wrong?
See what user:group owns /etc/default/telegraf. This file is better used when running telegraf as a service via systemd. Additionally, if you run env do you see the TELEGRAF_CONFIG_PATH variable? What about your other variables? If not, then you probably need to source the file first.
Is there not also a way of specifying a config directory too (I would like to break my file down into separate input files)?
Yes! Take a look at all the options of telegraf with telegraf --help and you will find:
--config-directory <directory> directory containing additional *.conf files
Perhaps as an alternative to all of this... is there not a way of specifying additional configuration files to be included from within the default /etc/telegraf/telegraf.conf file? (I've been unable to find any mention of this in documentation).
That is not the method I would suggest going down. Check out the config directory option above I mentioned.
Ok, after a LOT of trial and error, I figured everything out. For those facing similar issues, here is your shortcut to the answer:
Firstly, remember that when adding variables to the /etc/default/telegraf file, it must effectively be reloaded. So for example using ubuntu systemctl, that requires a restart.
You can verify that the variables have been loaded successfully using this:
$ sudo strings /proc/<pid>/environ
where <pid> is the "Main PID" from the telegraf status output
Secondly, when testing (eg telegraf --test) then (this is the part that is not necessarily intuitive and isn't documented) you will have to ALSO load the same environmental variables into the current user (eg: SET var=value) such that running
$ env
shows the same results as the previous command.
Hint: This is a good method for loading the current env file directly rather than doing it manually.

Need Help understanding how PATH works with Windows 7

I am trying to add to the PATH via the Environment Variable settings windows for python.exe.
I have read the instructions using SetX from the March 3, 2012 discussion about this issue and am worried I will make a mess of my machine, so want to stick with the GUI process.
The directory path is C:\Users\Paul\AppData\Local\Programs\Python\Python37\python.exe.
That is a copy from the addition I made in the System Variables section of the Environment Variables window.
I have labelled the Variable Name as "Python", no quotation marks.
I have checked the path, and it looks good to me, and have rebooted the computer. But I still get the
'python.exe' is not recognized as an internal or external command, operable program or batch file.' error in every directory expect if I am specifically in the Python37 directory.
Any idea what I am doing wrong?
The path environment variable contains one or more paths, separated by semicolons. When you try to execute a command in cmd.exe it checks each path listed in the path variable in order of first to last until it finds the executable or runs out of paths to check.
You can experiment without making permanent changes to your system first. Run cmd.exe and type
set path=%path%;C:\Users\Paul\AppData\Local\Programs\Python\Python37
Running python.exe should now work in any directory in this cmd.exe window.
Unlike other environment variables, path is special and is a merged value from the system and user variables. Since you installed python just for yourself you might as well just use a user variable.
In the system properties where you edit environment variables, if there is no path user variable, create one and set it to C:\Users\Paul\AppData\Local\Programs\Python\Python37 or if it already exists, append ;C:\Users\Paul\AppData\Local\Programs\Python\Python37.
In newer versions of Windows 10 the UI is different and you don't have to add the semicolon because it lets you edit them as separate entries.

Neo4j Dump: How to specify the database?

Having successfully created and populated a database with 200,000+ nodes, I would like to create a dump as a backup.
The instructions in the documentation are simple:
neo4j-admin dump --database=<database> --to=<destination-path>
But it's not clear what to use for <database>. If I use graph.db (or leave out the option) I get an error. I know the location of the database folder.
If I put the path to the database I get the following error:
unexpected error: 'database' should be a name but you seem to have specified a path
OS: Windows 10
Partial answer:
The database parameter refers to databases that are located in neo4jFolder/data/databases folder, where neo4jFolder is the folder of the unzipped install of Neo4j.
For example: I unzipped the neo4j install zip into E:\Program Files\neo4j-community-3.3.2. My database was elsewhere on the drive. So I copied the database to E:\Program Files\neo4j-community-3.3.2\data\databases\MyDatabase. Then I was able to run neo4j-admin dump --database=MyDatabase --to=backup5.dmp successfully.
I don't know if it's possible to run dump on databases that are not found under /data/databases. I also don't know how to run a dump when Neo4j is installed with the exe installer. My solution is for the zip file installation.

Not able to start Informix server

I am new to Informix. I installed Informix in the folder - /opt/Informix_Software_Bundle.
I am using the following command to start Informix server.
cd /opt/Informix_Software_Bundle
sudo ./oninit -i
And I am getting the following error message.
Unable to read $INFORMIXDIR (/usr/informix).
So I tried to set the environment variable INFORMIXDIR in ~/.profile as given below:
export INFORMIXDIR="/opt/Informix_Software_Bundle"
I also tried the following command:
INFORMIXDIR=/opt/Informix_Software_Bundle;export INFORMIXDIR
I tried logging out and in again. But nothing helped.
I will greatly appreciate if somebody can help me with this. Thanks for reading.
System - Mac OS Sierra
Informix version - 12.10
There are a number of environment variables used by the Informix server which include:
INFORMIXDIR : points to the directory where the product is installed. Add $INFORMIXDIR/bin to $PATH.
ONCONFIG : indicates the name of the main server configuration file in $INFORMIXDIR/etc. If not specified this will default to "onconfig."
INFORMIXSERVER : indicates the name of the Informix instance to connect to and refers to the DBSERVERNAME or a DBSERVERALIAS entry in the onconfig file referenced by $ONCONFIG.
INFORMIXSQLHOSTS : indicates the full path name of the communications configuration file used by Informix clients and servers. This will include an entry for the name specified by $INFORMIXSERVER. If this environment variable is not specified it defaults to $INFORMIXDIR/etc/sqlhosts.
Just having some or all of these environment variables set is not sufficient for starting an Informix server from scratch. There are setup tasks such as editing the onconfig file to specify the location of the root chunk - this is the initial location where the server stores its data. For more details you might like to refer to the Informix online documentation:
Getting started with IBM Informix
Overview of database server configuration and administration
One of the most straightforward ways to get started is to use the demonstration server instance that may be created during installation. I'm not directly familiar with the Mac OS installation but for all other platforms the Informix installation process includes an option to configure and initialize a demonstration server, and I suspect Mac OS will be the same. This will create an environment file in $INFORMIXDIR which will include settings for the variables named above.
One word of caution: the oninit command is used to both start the Informix server and initialize the chunks where the data is stored. The -i argument will perform the complete disk initialization which is precisely what you want for the first time the Informix server is started. On subsequent restarts you would not normally use this argument or else all the data stored by the server may be lost.
As sudo by default resets environment variables it is usual to have
A) A script to set the required environment variables for a given server.
B) Another wrapper script to start/stop the server.

Copying a local database from one computer to another ne04j

I created a database Neo4j on a PC, with many relationships, node, etc
how to move/ copy the database from this pc to another?
thanks for the help
francesco
update1: I have tried to found conf/neo4j-server.properties but i don't have...
this is a screenshot of my folder ne04j (It is in Windows document Folder)
http://s12.postimg.org/vn4e22s3x/fold.jpg
Neo4J databases live in your filesystem, you can simply make a copy of the folder in which your Neo4J data is stored. If you are running standalone this folder will be configured in conf/neo4j-server.properties and the line will look something like this:
org.neo4j.server.database.location=data/graph.db
Copy the content of that folder to the graph database folder on your other machine. I'd recommend that your databases are not running when you do this.
I believe you're looking for the dump shell command which you can use to export a database into a single Cypher create statement, you'd "dump" the database and then import it on your new machine.
Information on using the command is outlined here: Neo4j docs
A Neo4j database can be dumped and loaded using the following commands:
neo4j-admin dump --database=<database> --to=<destination-path>
neo4j-admin load --from=<archive-path> --database=<database> [--force]
Limitations
The database should be shutdown before running the dump and load commands.
https://neo4j.com/docs/operations-manual/current/tools/dump-load/
i used the above solution, but the file name was different.
in the folder of the neo4j data, look for folder called conf and inside the configuration file called neo4j.conf
inside this file you will see a line that direct to the folder that contain the data.
its called "graph.db"
replace it with the same folder from your backup of the DB that you want to clone.

Resources