DB2 programming skills (10)

Source: Internet
Author: User

The db2 tutorial is: DB2 programming skills (10 ). 4.11 db2 Environment Variables
After db2 is reinstalled, set the environmental variables of db2 in the following way to ensure that the sp can be compiled.
Put set_cpl on AIX, chmod + x set_cpl, and then run

Set_cpl content
Db2set DB2_SQLROUTINE_COMPILE_COMMAND = "xlc_r-g \
-I $ HOME/sqllib/include SQLROUTINE_FILENAME.c \
-BE: SQLROUTINE_FILENAME.exp-e SQLROUTINE_ENTRY \
-O SQLROUTINE_FILENAME-L $ HOME/sqllib/lib-lc-ldb2"

Db2set DB2_SQLROUTINE_KEEP_FILES = 1
4.12 db2 command environment settings
Db2 => list command options
Db2 => update command options using C off -- or on, only temporary changes
Db2 => db2set db2options = + c -- or-c, permanent change

4.13 change isolation level
DB2SET DB2_SQLROUTINE_PREPOPTS = CS | RR | RS | UR

The interaction environment changes the isolation level of the session,
Db2 change isolation to UR
Note that the isolation level can be changed only when the database is not connected.

4.14 manage db \ instance Parameters
Get db cfg for head (db)
Get dbm cfg (instance)

4.15 remove version issues after upgrade
Db2 bind @ db2ubind. lst
Db2 bind @ db2cli. lst

4.16 view database table deadlocks
When using the command center to query data, note that if interactive data query is used, the command center will apply the s lock to the queried records. at this time, if you want to update the record, because update requires the x lock, the exclusive lock will be in the lock wait.

First, enable the monitoring switch.
Db2 update dbm cfg using dft_mon_lock on
Snapshots
Db2 get snapshot for Locks on cleardb> snap. log
Tables
Bufferpools
Tablespaces
Database
Then let's look at the content in snap. log.
You can view the locks of each Application based on Application handle.
After monitoring, do not forget to disable the monitor.
Db2 update dbm cfg using dft_mon_lock off


<

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.