The following articles mainly describe how to correctly use the DB2 Configuration Wizard to configure parameters. DB2 database version 8 provides a tool for automatic parameter configuration, that is, the Configuration Wizard. You can start the graphical interface configuration wizard in the control center or use the autoconfigure command to configure your database.
The Configuration Wizard allows you to configure the database controller, database configuration parameters, and buffer pool size.
Note: You must connect to the database to use the DB2 Configuration Wizard. In the case of a partitioned database, the Database Configuration Wizard only configures one partition you connect. In a partitioned database environment, you can use the db2_all command to configure parameters for All Database partitions.
If you use the graphical Configuration Wizard, you need to answer a series of questions, which are equivalent to parameters in the AUTOCONFIGURE command (as shown in Table 1 ). First, let's take a look at the AUTOCONFIGURE Command Format:>-
- AUTOCONFIGURE--+---------------------------------------+----->
- | .----------------------------. |
- | V | |
- '-USING----input-keyword--param-value-+-'
- >--APPLY--+-DB ONLY----+---------------------------------------><
- +-DB AND DBM-+
'-NONE -------' table 1 shows the keyword and value range of the option. Table 1 default values of key words and value ranges
Mem_percent 1-100 80 sets the memory usage of DB2. For other applications, select a value smaller than 100.
- workload_type simple, mixed,
Complex mixed specifies the workload type. The simple type mainly refers to the concentrated IO access. For most OLTP systems, select the simple type. The Complex type mainly refers to Complex query systems that occupy a large amount of CPU, such as OLAP systems. If your system is between the two, select the mixed type.
Num_transaction TS 1-1 000 000 000 Number of SQL statements contained in each transaction in 10 Systems
Tpm 1-200 000 60 transactions per minute.
Admin_priority performance, recovery, both select your governance policy, which can be better performance or faster database recovery time.
Is_populated yes, no yes, the database already has data
Num_local_apps 0-5 000 0 local connections
Num_remote_apps 0-5 000 10 remote connections
Isolation level of isolation RR, RS, CS, ur rr applications
Bp_resizeable yes, no yes, whether the buffer pool can be adjusted
Apply db only displays the recommended database and buffer pool parameters under the DB2 configuration parameters of the current database controller, and applies the parameters to the database and buffer pool.
Apply db and dbm displays AND applies the recommended database controller parameters, database parameters, AND buffer pool parameters.
Apply none only displays the recommended values, but does not change the configuration parameters.
Use this command to configure the database. Select the appropriate parameters (see Table 1 to select your Parameter options ). The following example shows how to use the AUTOCONFIGURE command to configure the database. Assume that in a partitioned database environment, there is only one database instance db2inst1 and the Data Warehouse TESTDW, and data has been loaded. Use the following command to adjust the parameters of the database:
- db2_all “db2 connect to testdw; db2 autoconfigure using mem_percent 80
workload_type complex num_stmts 10 tpm 20 admin_priority both num_local_apps 5 num_remote_apps 50 isolation cs apply db and dbm; db2 connect reset;”
You can also create a script autoconfigure. db2, which is stored in the shared directory of the DB2 instance, for example,/home/db2inst1. The content is as follows: connect to testdw; autoconfigure using mem_percent 80 workload_type complex num_0000ts 10 tpm 20 admin_priority both num_local_apps 5 num_remote_apps 50 isolation cs apply db and dbm; connect reset;
Then run the db2_all command to execute this command on all database partitions. Assume that the directory of the script is/home/db2inst1/autoconfigure. db2: db2_all "" db2-tvf/home/db2inst1/autoconfigure. db2> autoconfigure ##. log"
After the command is executed, you can use autoconfigure *. log to view the execution of the command on each database partition. Then restart the DB2 instance to make these parameters take effect. Run some benchmark test query statements to test the configuration results of the DB2 Configuration Wizard.
You can also use the graphical interface of the Configuration Wizard to configure your database. You can select your database in the control center, right-click it, and select "Configuration Wizard" to start the Configuration Wizard. If you need to configure the partition database using the graphic interface, remember to save the result as a task and export the configuration result to a script file, such as/home/db2inst1/autoconfigure. db2. In this way, you can use the db2_all command to execute this script to configure all database partitions: db2_all "" db2-tvf/home/db2inst1/autoconfigure. db2> autoconfigure #. log"
If you are very familiar with DB2, you can make appropriate modifications to the DB2 configuration file generated by DB2 automatic configuration. In short, the DB2 Configuration Wizard is a very easy-to-use tool that can greatly reduce the workload of DBAs.