Question & Answer
Question
Why does not db2 command execute any statement?
Cause
The cause of this can be:
1- The PATH environment variable is not set up correctly
2- There is another db2 executable file in your environment
Answer
1- Check the PATH environment variable and make sure the "<instance_home>/sqllib/bin" directory is set up as follows:
- echo $PATH
This is an example of the output:
echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc:/home/db2inst1/sqllib/db2tss/bin:/home/db2inst1/bin
2- Check which db2 executable is being executed on the system by running the command below:
- which db2
the expected output should be "<instance_home>/sqllib/bin/db2"
Here are examples of the output:
which db2
/home/db2inst1/db2 (this shows a wrong db2 executable file)
which db2
/home/db2inst1/sqllib/bin/db2 (this shows an expected output)
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21683516