Copyright Notice: This article can be reproduced, please be sure to indicate the original source and author information in hyperlink when reprint. Original Source: http://www.aiview.com/notes/db2_note_3.htm Author: Zhang Yang Alex_doesAThotmail.com Last updated: 2004-8-5
table of Contents
Reference resource
DB2IDrop -f instance_name enforces disconnected, stop the instance and delete. DB2Imigr instance_name is used to migrate instances under UNIX. DB2IUPDT Instance_Name Update instance, used for access to some new product options or revisions. DB2 GET Instance Gets the instance of the current location. Once the instance level or the database level is updated, some can take effect immediately, and some need to restart the instance to take effect. Immediate explicitly indicated changes to the change immediately, and DeferRed explicitly indicates that the change will take effect after the instance is restarted. When you need to configure a plurality of clients to connect to the DB2 server, you can use the Configuration Assistant to export the server's profile, and then import the profile using the Configuration Assistant using the Configuration Assistant. If the client is only installed a runtime client, you can import a profile using DB2CFIMP Access_profile_name. Doubt: Should a profile is exported by a configured client? DB2 List Applications lists all database connections DB2 Force Application (2) Terminate the specified connection handle, the transaction is interrupted and rolled back. At the same time, the plurality of handles can be separated by commas, or specify the keyword ALL. This command only terminates the specified connection and does not block new applications from connecting to the database. When you create a database, you can specify a sort mode: The Collate Using Identity system mode set is created with each database, and they are placed in the syscatspace tablespace: SYSIBM: Basic system directory recommends not to directly access Syscat: public is granted to this mode SELECT Permissions Catalog This is a recommended way to get directory information SysStat: Update Directory View - Impact Optimizer Sysfun: User-defined Functions If the existing row in the table does not satisfy the constraint, the constraint cannot be defined. The constraint check can be closed to speed up the addition of large amounts of data, but the table is at the check pending state. When you create a table, you can use the option to specify one or more tablespaces, tables, and indexes will be placed in it: Create Table Test (Column 2 Definition, Column 2 Definition, ...) in Index IN INDEX IN INDEX SPACE NAME> This command provides you with an option: Specify the location of the creation table and index. If you do not specify a separate index table space, you will create an index in the same table space in the table. After creating a table, there is no chance to create an index in different tablespaces. Create an index to plan ahead! Crete Index on
(Column 1 , Column 2 ...) UNIQUE property tells DB2, index must force all insert values uniqueness. If the result set is sorted in ascending and descending, Allow Reverse Scans will tell DB2 Include additional pointers in the index to allow forward and reverse links to be effectively performed in the record. DB2 is capable of adding additional columns to the index being created. The create index command allows the user to specify the columns that are not saved in the index record because of the actual index but because of performance reasons.
CREATE UNIQUE INDEX ON EMPLOYEE (Empno) include (lastname, firstname) The index must be unique for the column included in the index. When the index is created, the additional columns are added to the index value. Indexes do not use these values to sort or determine uniqueness, but they can use them when meeting SQL queries. For example, the following SELECT statement will not read the actual data line: select lastname, firstname from Employee WHERE Empno <'000300' To create a cluster index on the table, attach the cluster key to the end of the create index command, for example: CREATE INDEX DEPTS-IX ON Employee (WorkDept) Cluster uses the following general rules to determine the classic quantity of the index defined. The number of indexes depends on the main purpose of the database: Announces one to two indexes for the online transaction processing (OLTP) environment. To create two to five indexes for mixed queries and OLTP environments. For read-only query environments, create more than five indexes. In the command line mode of the DB2 on the Windows platform, or under the class UNIX platform, use the command DB2CC to start the control center. DB2MOVE provides the ability to batch mobile data between the database, you can specify a table or specify a table for the entire database. DB2MOVE DBNAME ACTION Action can be specified as: export, import or load Use the -l parameter specified by the LOB object stored folder Perform incremental backup requirements Set the value of the database configuration parameter "TRACKMOD" "YES" Execute an online backup request Setting the database configuration parameters "Logretain" is "YES", online backup syntax: DB2 Backup DB DBNAME ONLINE TO PATH When the DAS user's Home directory is deleted, the DASDROP is not successful, then execute DASDROP, prompt: DB2Admin command cannot be It is found because the db2admin command is saved in the home directory of the DAS. You can delete the Home directory of a clean DAS user, restart the server to resolve this issue. DASUPDT DASNAME Upgrade DAS DB2IUPDT Instname Upgrade Executive DB2LICD END STD License daemon After installation DB2 V8.1 installed in Linux system, the DB2FMCD process will start automatically, even if instances and DAS are not launched, the DB2 database service is installed in the Chinese Linux environment, and Create a database using the GBK code page (CODEPAGE), can be connected normally. If you change the operating system code page as English, you will report an error when you use "DB2 Connect". You cannot convert the code page when connecting. Reference resource