Some daily practical operations of DB2 database

Source: Internet
Author: User
Tags id3

The following articles mainly describe some of the daily practical operations of the DB2 database. If you are curious about some of the daily practical operations of the DB2 database, the following articles will unveil its secrets. I hope you will gain some benefits after browsing. The following articles describe the relevant content.

1. Load data:

Export to tempfile of del select * from TABLENAME where not clearing condition;

 
 
  1. load from tempfile of del modified by delprioritychar replace into TABLENAME nonrecoverable; 

Note:

When the export data of unrelated data tables is export, it can be in the form of concurrency to improve efficiency;

TABLENAME indicates the name of the table to be cleared;

Modified by delprioritychar prevents line breaks in DB2 database records and data cannot be loaded;

Replace into replaces the content in the current database with the content of the current data file;

Nonrecoverable load without logs;

2. Search for the current application: db2 list application | grep BTPDBS;

3. Delete the application currently in use:

 
 
  1. db2 "force application (Id1,Id2,Id3)" 

Id1, Id2, and Id3 are the application numbers displayed in the List;

4. view the execution status of the current application number:

 
 
  1. db2 get snapshot for application agentid 299 |grep Row 

5. view database parameters:

Db2 get db cfg for // The current DB2 database can be omitted

6. Modify the Database Log Data:

Db2 update db cfg using <Parameter Name> <parameter value>

7. Usage of Db2Stop Force:

The following error occurs during Bind:

 
 
  1. SQL0082CAn error has occurred which has terminated processing.  
  2. SQL0092NNo package was created because of previous errors.  
  3. SQL0091NBinding was ended with "3" errors and "0" warnings.  

The table file is locked and cannot be used any more;

When the stop operation is performed, the following error occurs: db2stop.

 
 
  1. 8/03/2005 21:46:530 0 SQL1025NThe database manager was not stopped because databases are still active.  
  2. SQL1025NThe database manager was not stopped because databases are still active.  

Run the following command to solve the problem: db2stop force

 
 
  1. 08/03/2005 21:47:49 0 0 SQL1064NDB2STOP processing was successful.  
  2. SQL1064NDB2STOP processing was successful.  

Start the database db2start, connect to the DB2 database db2s, and re-run the bind.

8. Modify the buffer pool parameters:

 
 
  1. db2 alter bufferpool ibmdefaultbp size 10240 

View the data in this table as follows: db2 "select * from syscat. bufferpools ";

9. DB2 log processing:

DB2 logs are stored in the file system in the form of files. There are two modes: cyclic logs and archive logs. When creating a new database, the default log mode is circular log. In this mode, you can only back up and restore the database offline. To implement online backup and recovery, you must set the log archiving mode.

Currently, the archive log mode is set in the integrated business system. Other systems (such as post-event monitoring, business decision-making, and intermediate business) are generally set to the circular log mode. As for the mode used, you can modify the database configuration parameters (LOGRETAIN) to achieve: archive log mode: db2 update db cfg for using logretain on note: After changing to on, when you view the value of the Database Configuration Parameter logretain, the recovery is displayed.

After this parameter is changed, the DB2 database is in the backup pending status when you connect to the database again. In this case, an offline database backup (db2 backup db) is required to make the database status normal.

Cyclic log mode: db2 update db cfg for using logretain 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.