Shanghai Tengke Education Dameng database training dry goods sharing how to manage the data buffer

1. Summary of data buffer

 

The data buffer is where DMServer stores the data page before writing the data page to the disk and after reading the data page from the disk. This is one of the most important memory areas of DM Server. Setting it too small will result in low buffer page hit rate and frequent disk IO; setting it too large will cause insufficient operating system memory itself. .

 

There are four types of data buffers in the Dameng database, namely NORMAL, KEEP, FAST and RECYCLE.

The NORMAL buffer is mainly provided for some data pages processed by the system. If there is no specific designated buffer, the default buffer is NORMAL;

 

The feature of KEEP is that the data pages in the buffer are rarely or rarely eliminated. It is mainly aimed at whether the user's application needs to be in the memory frequently. If this is the case, the buffer can be designated as KEEP.

 

 

Users can create a table space or modify a table space, specify that the table space belongs to the NORMAL or KEEP buffer.

 

The RECYCLE buffer is used for temporary table space. The FAST buffer is automatically managed by the system according to the size of FAST_POOL_PAGES specified by the user. The user cannot specify the table or table space that uses the RECYCLE and FAST buffer.

 

2. Modify data buffer related parameters

 

The size of each buffer in the data buffer is controlled by the DM.INI file

 

 

If you need to modify it, you can directly change the value in DM.INI (not recommended), or use the Dameng console tool to modify it (recommended). It should be noted that the BUFFER related parameters listed above are all static parameters. After modification, the server needs to be restarted to take effect.

 

 

Use console tools to modify parameters

 

3. How to view the data buffer usage

 

Dameng database provides dynamic performance view V$BUFFERPOOL to monitor the usage of data buffer. The view structure is as follows

 

Column

type of data

Description

ID

INTEGER

Buffer ID

NAME

VARCHAR(20)

Buffer name NORMAL/KEEP/RECYCLE/FAST

PAGE_SIZE

INTEGER

Base buffer page size, excluding extended pool pages

N_PAGES

INTEGER

Number of pages

N_FIXED

INTEGER

The number of times the data page is referenced

FREE

INTEGER

Number of free pages

N_DIRTY

INTEGER

Number of dirty pages

Here, we can combine several fields to find out the buffer usage of the current database.

 

The specific SQL is as follows

 

select name,page_size*n_pages/1024/1024  as size_mb ,page_size*free/1024/1024 as free_mb from V$BUFFERPOOL;

 

search result

 

 

It should be noted that the default unit of page_size in the original view is bytes, so we need to do a numerical calculation to get the conclusion in MB.

Guess you like

Origin blog.csdn.net/qq_42726883/article/details/108463742