Run db2 under cmd --- DB21061E without initializing the command line Environment

Source: Internet
Author: User

 

In windows cmd, you cannot directly run the db2 command. If you type db2 directly under cmd, an error is returned, "DB21061E has not initialized the command line environment ".

 

The solution is to type db2cmd, and then you can type db2.

 

 

 

In fact, some software must set environment variables during installation, but most of them are automatically added to the environment variables, which does not require additional operations for users. However, some of them must be set by yourself.

 

For example, when installing jdk, you need to set the environment variable yourself.

 

Db2 and oracle do not need to be set by ourselves. We can see in "My Computer ---- properties ---- advanced ---- environment variable ----- system variable,

 

The main bin directory of oracle is in ORACLE_HOME \ ora92 \ bin, while the main bin directory of db2 is in DB2_HOME \ SQLLIB \ BIN.

 

The difference is that oracle can directly run commands such as sqlplus and sqlldr in cmd, but db2 must first run db2cmd.

 

If you want to write the command as a. bat file and run it

 

> Xxx. bat is not acceptable.

 

> Db2cmd xxxx. bat.

 

Otherwise, your db2 will always report errors.

 

If you do not want cmd to identify the db2cmd command, you can remove the bin environment variable of db2 in path.

 

From Uncle Mao's rations

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.