473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Backup using prefetch size for reading.

Hi,

I have a quick question, when one sets the prefetch size = extent size, then
when doing a backup we will have 1 agent (db2bm) doing the reads. If we have
prefetch size a multiple of extent size AND we have multiple containers
and/or PARALLEL_IO set then not db2bm but the db2 prefetchers will read the
data.
Now no matter which one reads the data, it will still be read in 1 extent
size. Wouldn't it thus be much more efficient to always use the the
prefetchers to read the data?

For example,
A) 2 containers, prefetch = extent: db2bm will read extent size from
container 1, then extent size from container 2, .....

B) 2 containers, prefetch > extent: 2 prefetchers will read 1 extent
size, 1 from container 1 and the other one from container 2.

Seems to me that B is more efficient. But since this is a OLTP database, we
have prefetch size = extent size. Would the logic then be better to state:

A) 1 container, prefetch = extent: db2bm will read extent size from
container 1
B) 2 containers, prefetch = extent: 2 prefetchers will read 1 extent
size, one from container 1 and the other one from container 2.

The limit could then maybe set as follow for DB2_PARALLEL_IO, 1 container:
# of extent prefetching = # IO servers / backup PARALLELISM

i.e.:
10 IO servers, PARALLELISM 2, 1 container: Each db2bm will request 5
extents
The limit could then maybe set as follow for DB2_PARALLEL_IO, 2 containers:
# of extent prefetching = # containers

i.e.:
10 IO servers, PARALLELISM 2, 2 container: Each db2bm will request 2
extents
Or, instead of having the db2bm use pread to get the data, to use
asynchronous IO to read the data (just like for example the log writer in V8
uses asynchronous IO to write log pages).

Thanks.
Nov 12 '05 #1
4 3659
A few parameters need to be clarified here:
1) DB2_PARALLEL_IO {ALL or tbspaceid, tbspaceid, ...} is an environment
profile variable set with the db2set command. It is effective only for
environments where your data is on a RAID type device and a single container
has been dfined for the tblspc.; nowhere else. It does not specifies the
number of containers or extents. When you look at the command, it
identifies which tablespace is defined on a RAID type device. If the
tablespace is not defined on a RAID and ALL is used, the variable is ignored
for that tbspace.
2) For backup purposes, I don't believe that prefetchers are used (set with
the dbh cfg parm. num_ioservers), I may be wrong here, I don't quite
remember. There's a PARALLELISM parm. with the backup command that
specifies the number of tblspcs. to be backed up in parallel.. Default is
one by one, starting with tblspaceid 0.
3) When running queries, the optimizer will look at your tblspc. defs. to
find out EXTENT size, PREFETCH size and no. of containers. If you run an
explain on the query, it will show prefetch enabled.
So, if extent size is 32 pages, containers=3, then your DB2 Admin. Guide
recommends that prefetch size should be set to: nmuber of containers *
extent size. So set to 96 pages.
Given that, then your three extents could be read in parallel on a table
scan. This is what enables DB2 to pre-load the required rows in the buffer
pool.
If prefetch is not enabled and/or your IO request is a single page, as in
OLTP, then your agent does the IO, not db2 and prefetchers (or IO_SERVERS).
4) As each query that is prefetch enabled issues itsIO request, it is queued
and the num_ioservers specifies the number of processes that can be
dispatched in parallel to service any or all IO requests from any or all
queries. The service is FIFO.
HTH, Pierre.

"Erik Hendrix" <he**********@hotmail.com> a écrit dans le message de
news:2d******************************@news.teranew s.com...
Hi,

I have a quick question, when one sets the prefetch size = extent size, then when doing a backup we will have 1 agent (db2bm) doing the reads. If we have prefetch size a multiple of extent size AND we have multiple containers
and/or PARALLEL_IO set then not db2bm but the db2 prefetchers will read the data.
Now no matter which one reads the data, it will still be read in 1 extent
size. Wouldn't it thus be much more efficient to always use the the
prefetchers to read the data?

For example,
A) 2 containers, prefetch = extent: db2bm will read extent size from
container 1, then extent size from container 2, .....

B) 2 containers, prefetch > extent: 2 prefetchers will read 1 extent
size, 1 from container 1 and the other one from container 2.

Seems to me that B is more efficient. But since this is a OLTP database, we have prefetch size = extent size. Would the logic then be better to state:

A) 1 container, prefetch = extent: db2bm will read extent size from
container 1
B) 2 containers, prefetch = extent: 2 prefetchers will read 1 extent
size, one from container 1 and the other one from container 2.

The limit could then maybe set as follow for DB2_PARALLEL_IO, 1 container:
# of extent prefetching = # IO servers / backup PARALLELISM

i.e.:
10 IO servers, PARALLELISM 2, 1 container: Each db2bm will request 5
extents
The limit could then maybe set as follow for DB2_PARALLEL_IO, 2 containers: # of extent prefetching = # containers

i.e.:
10 IO servers, PARALLELISM 2, 2 container: Each db2bm will request 2
extents
Or, instead of having the db2bm use pread to get the data, to use
asynchronous IO to read the data (just like for example the log writer in V8 uses asynchronous IO to write log pages).

Thanks.

Nov 12 '05 #2
Pierre Saint-Jacques <se*****@invalid.net> wrote:
2) For backup purposes, I don't believe that prefetchers are used (set with
the dbh cfg parm. num_ioservers), I may be wrong here, I don't quite
remember. There's a PARALLELISM parm. with the backup command that
specifies the number of tblspcs. to be backed up in parallel..
The Backup utility will use the prefetchers if doing so is appropriate
for the tablespace in question. (The PARALLELISM parameter will determine
how many db2bm processes run simultaneously, and the actual I/Os to the
database will be done either by db2bm or the prefetchers.) We have seen
cases where users would increase the backup parallelism to a large
number and have their backup performance go down because they were starved
for prefetchers, fwiw.
Default is one by one, starting with tblspaceid 0.


This will change in v81FP4. When PARALLELISM > 1, tablespaces will be
backed up in order of largest to smallest.

dave
Nov 12 '05 #3
Thanks very much for bringing me up to date.
These are extremely useful as I've had quite a few questions from other
people on this.
Merci, Pierre.
"David Mooney" <dm*@vnet.ibm.com> a écrit dans le message de
news:bu**********@hanover.torolab.ibm.com...
Pierre Saint-Jacques <se*****@invalid.net> wrote:
2) For backup purposes, I don't believe that prefetchers are used (set with the dbh cfg parm. num_ioservers), I may be wrong here, I don't quite
remember. There's a PARALLELISM parm. with the backup command that
specifies the number of tblspcs. to be backed up in parallel..


The Backup utility will use the prefetchers if doing so is appropriate
for the tablespace in question. (The PARALLELISM parameter will determine
how many db2bm processes run simultaneously, and the actual I/Os to the
database will be done either by db2bm or the prefetchers.) We have seen
cases where users would increase the backup parallelism to a large
number and have their backup performance go down because they were starved
for prefetchers, fwiw.
Default is one by one, starting with tblspaceid 0.


This will change in v81FP4. When PARALLELISM > 1, tablespaces will be
backed up in order of largest to smallest.

dave


Nov 12 '05 #4
Hey David,

Thanks for the information on the order. When tuning/monitoring my backups I
did feel that it would be so much better to go from biggest to smallest
since the parallelism works on a tablespace level. It's nice to know this is
in FP4 now.
"David Mooney" <dm*@vnet.ibm.com> wrote in message
news:bu**********@hanover.torolab.ibm.com...
Pierre Saint-Jacques <se*****@invalid.net> wrote:
2) For backup purposes, I don't believe that prefetchers are used (set with the dbh cfg parm. num_ioservers), I may be wrong here, I don't quite
remember. There's a PARALLELISM parm. with the backup command that
specifies the number of tblspcs. to be backed up in parallel..


The Backup utility will use the prefetchers if doing so is appropriate
for the tablespace in question. (The PARALLELISM parameter will determine
how many db2bm processes run simultaneously, and the actual I/Os to the
database will be done either by db2bm or the prefetchers.) We have seen
cases where users would increase the backup parallelism to a large
number and have their backup performance go down because they were starved
for prefetchers, fwiw.
Default is one by one, starting with tblspaceid 0.


This will change in v81FP4. When PARALLELISM > 1, tablespaces will be
backed up in order of largest to smallest.

dave

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: nt | last post by:
I am having a problem with a regular backup of an SQL Server (MSDE 2000) database to a local drive. I initiate the backup once a week, by issuing the required T-SQL, via ADO. In this case, the...
6
by: Eric Herber | last post by:
I've a question regarding db2 (V8.1) and database backups going to a storage manager like TSM for example. As I can see in the storage manager if I backup the complete database over the TSM API...
9
by: Stanley Sinclair | last post by:
I just brought a new small server online. It has two disks in RAID1 (mirrored) for the operating system and logs and DB2 DBMS. DB2 data on a separate RAID 5EE array on four disks. (IBM ServeRAID...
6
by: Uthuras | last post by:
Greetings, We have DB2 V 8.1 with FP 4 on AIX 5.2. Our database backup is done using TSM v 4.1.2. However, we notice TSM make use of only one session even though we defined 4 sessions for...
4
by: Hardy | last post by:
hi gurus, now I have to backup and restore a 8 T size db2 database. from two s85 to two 670. the partitions,tablespaces of the db should be redesigned then I plan to use redirected restore. but...
4
by: uthuras | last post by:
Hi all, I have DB2ESE version 8.1 with FP 4 on AIX 5.2. My database used to be 1.1TB. When the DB size is 1.1TB, it takes approximately 7 hours to backup the entire database (online backup). The...
2
by: rdemyan via AccessMonster.com | last post by:
For some of my really important tables, I have backup tables in the backend file. The idea is that if a user accidentally screws up data, they can go to a form and restore from the backup table...
1
by: James Yang | last post by:
Sirs, We are using DB2 UDB 8.2.5 for AIX 5.3. Everytime when we perform a online incremental backup to Tivoli, the system will hang for about 10 mins or more at the begining of backup due to no...
7
by: yellr | last post by:
Hi, i've spent all resources, except this one. Hopefully anyone there out could help me with a idea for this problem. We have a db2 8.2 Enterprise Edition, on AIX 5.3 Platform, this is our...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.