DB2 commands on AIX

Source: Internet
Author: User

This article describes several common commands for DB2 databases under AIX. DB2 is installed in the default/opt/IBM/db2/V9.5 directory and the instance is db2inst1. For your reference, I hope to enlighten you.

1. set-o vi
Similar to the doskey command on AIX, the input command history is stored, and then you can press the Esc key and then press the k key.
Forward. If you want to edit the command content, use the vi command.

2. su db2inst1
Switch to the DB2 instance user. Most DB2 commands must be performed under the instance user.

3. db2start
Start DB2. Before executing this command, you must first switch to the instance user and then enter the/opt/IBM/db2/V9.5/adm directory,
Set db2start to executable through chmod 777 db2start.

$ Su db2inst1
$ Cd/opt/IBM/db2/V9.5/adm
$ Chmod 777 db2start
$./Db2start

4. db2stop
Stop DB2, similar to db2start.

5. db2
Enter command interaction mode, which is equivalent to db2cmd on windows. Before executing this command, you must first switch to the instance user,
Then go to the/opt/IBM/db2/V9.5/bin directory.

6. db2level
Check the DB2 version, which is also in the/opt/IBM/db2/V9.5/bin directory like the db2 command.

7. db2profile

To avoid switching to the command path every time, such as/opt/IBM/db2/V9.5/adm, run db2profile first.

$ Cd/home/db2inst1/sqllib

$ ../Db2profile

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.