Under Windows cmd, you cannot run the DB2 command directly. If you type DB2 directly under CMD, you will get an error, "db21061e not initialized the command-line environment."
The workaround is to type Db2cmd, and then you can type DB2 again.
In fact, a part of the software in the installation of the environment variables to set, but most of the software is automatically add environment variables, for the user is not required additional operations. But there are some that you have to set yourself.
For example, in the installation of JDK, it is necessary to set the environment variables.
and db2,oracle and so on do not need to set their own, we are in the "My Computer----properties----advanced----Environment Variables-----System Variables" can be seen,
Oracle's main bin directory is Oracle_home\ora92\bin, and DB2 's main bin directory is in Db2_home\sqllib\bin.
The difference is that Oracle can run Sqlplus, Sqlldr, and so on directly under CMD, but DB2 must run Db2cmd before it can.
If you want to write the command as a. bat file when running, if you follow Oracle's ideas directly
> Xxx.bat is no good, need
> Db2cmd xxxx.bat That's all I can do.
Otherwise, your DB2 will keep an error.
If you do not want CMD to identify the Db2cmd command, then take the DB2 bin environment variable in path to OK.
CMD Run DB2---db21061e the command-line environment is not initialized