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