DB2 programming skills (8)

Source: Internet
Author: User
Tags db2 connect db2 connect to

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.


<

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.