DB2 -TVF my.sql
DB2LEVEL displays the version number of DB2
Display SQL error message
DB2 "? SQL6031"
DB2MTRK
Manage DAS
Generate: root run -Dascrt -u dasuser1
Delete: root run -Dasdrop
Start: DASUSR1 Run -DB2Admin Start
Stop: Dasusr1 Run -DB2Admin Stop
DB2_KILL
ipclean
DB2Start Dbpartitionnum 9 Restart
AIX Start Control Center:
DB2CC
DB2 User Management:
DB2 Use OS to Manage Uses.You CAN Use Following Steps To Add A DB2 User:
1, add a user on os.
2, Grant Rights to User.
Grant CreateTab, Connect On Database to User Fujie;
Grant SELECT, UPDATE, DELETE ON TABLE EMPLOYEE TO USER JOHN with GRANT OPTION
First, instance
produce
DB2icrt -a authtype (Server, Client, Server_Encrypt) -p port_name
Table space prefetchsize setting, Extentsize's relationship, buffer pool monitoring, page clearance procedure how much.
The temporary table space page size is set with other tablespace page size, and the temporary table space and the buffer set.
Example: DB2icrt DB2 -S ESE -P D: / DB2 -U Administrator
Note: You need to generate a username of one and instance names when an instance is generated on UNIX, and the FencedID user.
If DB2IRT -S ESE -U DB2FENC2 DB2InST2 will generate instance DB2Inst2 in DB2Inst2 users.
32-bit instances, create 64-bit instances: DB2icrt -s ese -w 64 -u db2fenc2 db2inst2
delete
DB2IDROP Instance-Name
start up
DB2Start
stop
DB2STOP FORCE
connection
DB2 Attach to TestDB2
DB2 DETACH
List of instances
DB2ILIST
Set the current instance
SET DB2Instance =
Get the current instance
DB2 Get Instance
Set instance automatic restart unix
DB2IAUTO -ON
DB2IAUTO -OFF
Get the configuration parameters of the instance
DB2 GET DBM CFG
Modify configuration parameters
For example: DB2 UPDATE DBM CFG Using Authentication Server_Encrypt
DB2STOP AND DB2START
Second, statement registry and environment variables
DB2SET Note: You need to exit the user after the setting is completed, and then register to enter to take effect.
List all supported variables
DB2SET -LR
List all currently defined variables
DB2SET
To list all the defined registry variables in the profile registry
DB2SET -All
List individual variables
DB2SET registry_variable_name
Change variable
DB2SET registry_variable_name = new_value
Variable reset is default
DB2SET -R registry_variable_name
DB2SET DB2CODEPAGE = 819db2set DB2CODEPAGE = 1386
DB2 -TVF my_sql.sql
Third, create a node configuration file
DB2NODES.CFG
UNIX format: dbPartitionnum (0-999) Hostname [Logical-Port [NetName]]
WIN format: nodenumber hostname computername logical_port netname
Fourth, manage the server
Create DAS
DB2ADMIN CREATE (Windows)
Dascrt -u
Start and stop
DB2ADMIN START
DB2ADMIN STOP
List
DB2Admin
Configuring DAS
DB2 Get Admin CFG
DB2 Update Admin CFG Using
DB2 RESET Admin CFG
Best STOP again start
V. Configure multiple logical nodes
You can use two ways to configure multiple logical nodes:
* Configure the logical node (Database Partition) in the db2nodes.cfg file. Then you can start all logical and remote nodes using DB2Start.
For Windows NT, if there is no database in the system, you must use db2ncrt to add nodes, otherwise, if one or more databases,
The DB2Start AddNode command should be used. In NT, the db2nodes.cfg file cannot be manually edited.
DB2NCRT / N: 1 / U: administrator, yhnu0987 / m: Fujie / P: 1 / h: Fujie
DB2START ADDNODE NODENUM 1 Hostname Guosd Port 1 Computer Guosd User DB2Admin Password DB2Admin
* Restart a logical node on another processor, other logical database partitions (nodes) are running on the processor. This allows coverage
The host name and port number specified for the logical database partition in db2nodes.cfg.
Add logical nodes in Win
DB2NCRT / N: 1 / U: administrator,
# Delete logical node
DB2NDROP
Use DB2Stop Drop Nodenum when there is a database
# Change the logical node
DB2NCHG