Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/
1. Create a database
DB2 create databaseDb_name
2. delete a database
DB2 DROP DATABASE DB
3. Connect to the database
DB2 connect to sample
4. Disconnect the database
Connect Reset
Terminate)
(The above two can be disconnected during work)
Disconnect
(A task cannot be disconnected)
5. Back up the database
Check the activity: DB2 list active databases
Back up DB2 backup database sample if no activity exists
For more information about the operations, see document 16-regular backup.
6. Restore the database
DB2 Restore database sample
7. Change the size of DB2 log Space
Note: The following command is used only for DB2 on the developer's own machine to prevent the DB2 database from using hard disk space excessively. If it is a server, the parameter needs to be modified.
DB2 update dB CFG for using logretain off logprimary 3 logsecond 2 logfilsiz 25600;
If the page size is 4 kb, the preceding command creates three 100 MB log files, occupying 300 MB of hard disk space. 25600 * 4kb = 102400kb.
8. database administration server (DAS)
It is a background process used for remote graphical management.
In Linux and UNIX, you need to create a das user. The db2adminserver variable contains the user value.
The command is as follows:
Db2admin start starts the DAS.
Db2admin stop stops the DAS.
Dascrt creates the DAS in Linux and UNIX.
Dasdrop drops the DAS in Linux and UNIX.
Db2admin create creates the DAS in windows.
Db2admin drop drops the DAS in windows.
Get admin CFG displays the DAS admin configuration file.
Update admin CFG updates the DAS admin configuration file.
Reset admin CFG resets the DAS admin configuration file to its default values.
9. Use db2governor for record
The command db2govd can be used to record almost all behaviors and events. This is an advanced management command and is not described yet ~
Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/