The db2 tutorial is: DB2 programming skills (8 ). 4.2 create a Database
Create database head using codeset IBM-eucCN territory CN;
In this way, Chinese characters are supported.
4.3 manual remote database (alias) Configuration
Db2 catalog tcpip node node1 remote 172.28.200.200 server 50000
Db2 catalog db head as test1 at node node1
Then you can use:
Db2 connect to test1 user... Using...
Connected to the head Database
4.4 stop starting a database instance
Db2start
Db2stop (force)
4.5 connect to the database and view the currently connected database
Connect to database
Db2 connect to head user db2inst1 using db2inst1
Currently connected database
Db2 connect
4.6 stop starting database head
Db2 activate db head
Db2 deactivate db head
Note that using deactivate db does not work if a connection exists.
If you start a database with activate db, you must use deactivate db to stop the database. (Of course, if it is db2stop, it will also stop ).
Use activate db to reduce the waiting time for the first connection.
If the Database is started by connecting to the Database instead of starting with activate db, the Database will automatically stop when all connections exit.
4.7 view and stop the current database application
View the application:
Db2 list applications show detail
Authorization ID | Application name | application handle | Application ID | serial number # | agent | Coordination Program | status | state change time | DB name | DB path | node number | pid /thread
1. The first part of the Application ID is the IP address of the application, but it is represented in hexadecimal notation.
2. pid/thread is the thread number displayed in unix.
Stop the application:
Db2 "force application (236 )"
Db2 "force application all"
Where: The value 236 indicates the application handle in the view.
<