Integrated backup/restore scenarios
Chapter 4. Database and recovery log
4.5 Setting the expansion trigger
Tivoli Storage Manager lets you fully automate the process of increasing the database and recovery log. For example, assume that you have a 200 MB database and a 100 MB recovery log. You want to increase the size of the database by 25% when 85% is in use, but not to more than 1 GB. You also want to increase the recovery log by 30% when 75% is in use, but not to more than 500 MB.
tsm: TSM010> define dbbackuptrigger devclass=3570 logfullpct=75 numincr=6 ANR2282I Database backup trigger defined and enabled.
tsm: TSM010> query dbbackuptrigger format=detail Full Device Class: 3570
Incremental Device Class: 3570 Log Full Percentage: 75 Incrementals Between Fulls: 6 Last Update by (administrator): ADMIN
Last Update Date/Time: 02/08/00 17:40:53
4.5.1 Database space trigger
To define a new space trigger for the database in the/tsm/database/primary directory (Tivoli Storage Manager generates the volume names), issue thedefine spacetrigger db command. Theexpansionprefixparameter allows you to specify where you want the created volumes to be stored in the filesystem.
The MAXIMUMSIZE limit for the database is 9,999,999 MB. A value of zero, (0) or omitting this parameter disables checking for maximum size. If later on, you need to change the trigger definition, you can use the update spacetrigger command.
Whenever the system detects that the database needs extra space, it triggers the expansion as shown in the query actlogcommand:
Setting a space trigger does not mean that the percentage used in the
database and recovery log will always be less than the value specified with the FULLPCT parameter. Tivoli Storage Manager checks utilization when
database and recovery log activity results in a “commit”. Deleting database volumes and reducing the database does not cause the trigger to activate.
Therefore, the utilization percentage can exceed the set value before new Note:
Database expansion triggering is not fully supported in Tivoli Storage Manager MVS. In the MVS environment, thedefine spacetriggercommand does not cause new volumes to be created. It causes the database and recovery log to be extended if space is available. Event logging allows messages to display the amount of new space that is needed to satisfy the space trigger utilization parameter. You can use these messages to initiate automatic expansion or to complete an allocation job (refer to ANRFMT1 and ANRFMT, sample jobs that are located in the ASAMPLIB library).
MVS Users:
tsm: TSM010> define spacetrigger db fullpct=85 spaceexpansion=25 \ cont> expansionprefix=/tsm/database/primary/ maximumsize=1000 ANR2274I Data Base Space trigger defined and enabled.
tsm: TSM010> query actlog ...
02/08/00 17:58:30 ANR4414I Data Base Space expansion Is Needed, 4 Megabytes needed.
02/08/00 17:58:30 ANR4412I Data Base and Recovery Log Space expansion triggered.
02/08/00 17:58:31 ANR2240I Database volume /tsm/database/primary/D0151600.DBV defined.
02/08/00 17:58:31 ANR2240I Database volume /tsm/database/primary/D0151600.DBV defined.
02/08/00 17:58:31 ANR2248I Database assigned capacity has been extended.
02/08/00 17:58:31 ANR4415I Data Base and Recovery Log Space Expansion Completed.
..
4.5.2 Recovery log space trigger
To define a new space trigger for the recovery log in the/tsm/log/primary directory (Tivoli Storage Manager generates the volume names), issue the following define spacetrigger log command. Theexpansionprefixparameter allows you to specify where you want the created volumes to be stored in the filesystem.:
You can use a MAXIMUMSIZE from 9 MB through 5000 MB (5GB) for the recovery log. A value of zero, (0) or omitting this parameter disables checking for maximum size. If later on, you need to change the trigger definition, you can use theupdate spacetriggercommand.
Whenever the system detects that the recovery log needs extra space, it triggers the expansion as shown in thequery actlogcommand:
4.5.3 When SPACETRIGGER fails
Although Tivoli Storage Manager can expand either the database or the recovery log space or both if needed, you must pay special attention when using mirroring, because you can only give one directory location for theexpansionprefix
parameter in thedefine spacetrigger command. Therefore, if you are running Tivoli Storage Manager with software mirrored volumes (DB or LOG), you may get undesirable volumes in a single disk (making mirroring ineffective). To correct this, you must reallocate the mirror copies in the correct place.
Here is an example of database triggering, which leads to an allocation of both image and copy to the same location (/tsm/database/primary). In this case, the database volume,/tsm/database/primary/C02372600.DBV, must be reallocated to another filesystem, so that mirroring is still adequate:
tsm: TSM010> define spacetrigger log fullpct=75 spaceexpansion=30 \ cont> expansionprefix=/tsm/log/primary/ maximumsize=500
ANR2279I Recovery Log Space trigger defined and enabled.
tsm: TSM010> query actlog ...
02/08/00 18:06:48 ANR4413I Recovery Log Space expansion Is Needed, 4 Megabytes needed.
02/08/00 18:06:48 ANR4412I Data Base and Recovery Log Space expansiontriggered.
02/08/00 18:06:50 ANR2260I Recovery log volume /tsm/log/primary/L8002600.LOG defined.
02/08/00 18:06:50 ANR2260I Recovery log volume /tsm/log/primary/L8002600.LOG defined.
02/08/00 18:06:50 ANR0984I Process 22 for EXTEND LOG started in the BACKGROUND 02/08/00 18:06:50 ANR2268I Recovery log assigned capacity has been extended.
02/08/00 18:06:50 ANR4415I Data Base and Recovery Log Space Expansion Completed.
..
02/08/00 18:18:51 ANR4414I Data Base Space expansion Is Needed, 4 Megabytes needed.
02/08/00 18:18:51 ANR4412I Data Base and Recovery Log Space expansion triggered.
02/08/00 18:18:52 ANR2240I Database volume /tsm/database/primary/D1372600.DBV defined.
02/08/00 18:18:52 ANR2240I Database volume /tsm/database/primary/D1372600.DBV defined.
02/08/00 18:18:53 ANR2241I Database volume copy /tsm/database/primary/C2372600.DBV defined.
02/08/00 18:18:54 ANR2248I Database assigned capacity has been extended.
02/08/00 18:18:54 ANR4415I Data Base and Recovery Log Space Expansion Completed.
4.6 Mirroring
The following scenario shows the importance of mirroring in the recovery
process. As the result of a sudden power outage, a partial page write occurs. The recovery log is now corrupted and not completely readable. Without mirroring, transaction recovery operations cannot complete when the server is restarted and the database would need to restored from its most recent backup. However, if the recovery log is mirrored and a partial write is detected, a mirror volume can be used to construct valid images of the missing pages.
Although you can mirror either the database or the recovery log, we recommend that you mirror both. This gives better availability should you need to recover from a failing disk, as you can see in Figure 5.
In this example, the Tivoli Storage Manager database volumes are split into two different disks, so if a system failure occurs on one, Tivoli Storage Manager can still function. The same thing happens for the recovery log, with each volume duplicated. Note that Tivoli Storage Manager still has one database object and one recovery log object (with a mirrored copy).
Figure 5. Tivoli Storage Manager mirror view
Although we have used the directories primary and copy for our mirrored volumes, this nomenclature is irrelevant to Tivoli Storage Manager. That is, all copies of a volume are equal and the server can continue operating in the event of failure of any member of the mirrored set.
Tivoli Storage Manager mirrored volumes must have at least the same capacity as the original volumes. This means that if your Tivoli Storage Manager database is made of two volumes of 100 MB each, then you will need at least two extra 100 MB allocated volumes for the mirrored volumes. If you create volumes larger than necessary, Tivoli Storage Manager gives you a warning message (ANR2253W for
M i r r o r v i e w
d a t a b a s e v o l u m e s
l o g v o l u m e s
D i s k 1 : / t s m / d a t a b a s e / p r i m a r y
D i s k 3 : / t s m / l o g / p r i m a r y
m i r r o r e d d a t a b a s e
v o l u m e s
m i r r o r e d l o g v o l u m e s
D i s k 2 : / t s m / d a t a b a s e / c o p y
D i s k 4 : / t s m / l o g / c o p y
database and ANR2273W for the log), but it still allows you to use the allocated volume (although the extra capacity will be wasted).
You must separate each of the mirrored volumes onto separate disks so that you do not lose data if the disk fails. We recommend that you use four disks for the database and recovery log volumes to keep each set of volumes on a separate disk. For example, on UNIX, you have all primary database volumes on one disk, /tsm/database/primary, and their mirrored volumes on another disk,
/tsm/database/copy, and the similar distribution for the recovery log volumes and their mirrored copies. Table 28 shows a sample database and recovery log allocation for UNIX and Windows, respectively.
Table 28. Database and recovery log volumes allocation
4.6.1 Database mirroring
When you first install Tivoli Storage Manager, it does not mirror the database. In our example, thequery dbvolume command shows the default database
(/usr/tivoli/tsm/server/bin/db.dsm) and one additional volume
(/tsm/database/primary/file01) created in the previous sections without any mirror images in place:
To mirror the database, you must first create all of the new database volumes by using the DSMFMT utility. We create the new copy in/tsm/database/copy.
UNIX location Windows location Database volumes /tsm/database/primary D:\tsm\database Mirrored database volumes /tsm/database/copy E:\tsm\database
Log volumes /tsm/log/primary F:\tsm\log
Mirrored log volumes /tsm/log/copy G:\tsm\log
We recommend that you use Tivoli Storage Manager mirroring rather than AIX mirroring. If you use AIX mirroring, you may have a problem with raw volumes, but not with Journaled File System (JFS) files. AIX tracks mirroring activity by writing control information to the first 512 bytes of the USER area in a raw volume. This is not a problem for database and recovery log volumes, but Tivoli Storage Manager control information is also written in this area. If AIX overwrites Tivoli Storage Manager control information when raw volumes are mirrored, Tivoli Storage Manager may not be able to vary the volume online.
AIX Users:
tsm: TSM010> query dbvol
Volume Name Copy Volume Name Copy Volume Name Copy
(Copy 1) Status (Copy 2) Status (Copy 3) Status
--- --- --- --- ---
---/tsm/database/p- Sync'd Undef-
Undef-rimary/file01 ined ined
/usr/tivoli/tsm- Sync'd Undef-
Undef-/server/bin/db- ined ined
.dsm
The next step is to define all database volumes in Tivoli Storage Manager, using the define dbcopy command:
After a database volume copy is defined, Tivoli Storage Manager synchronizes the volume copy with the original volume. This process can range from minutes to hours, depending on the size of the volumes and performance of your system.
After synchronization is complete, the volume copies are mirror images of each other.
You can request information about mirrored database volumes by using thequery dbvolumecommand. The next screen shows you the database volume
synchronized (Sync’d) with its mirrored volume copy:
4.6.2 Recovery log mirroring
When you first install Tivoli Storage Manager, it does not mirror the recovery log.
In our example, the commandquery logvolumeshows the default recovery log (/usr/tivoli/tsm/server/bin/log.dsm) and one additional volume
(/tsm/log/primary/file01), created in the previous sections, with no mirror in place:
root@ /tsm/database > dsmfmt -db /tsm/database/copy/file01 201 AIX Server DSMFMT Extent/Volume Formatting Program
Licensed Materials - Property of IBM
5697-TSM (C) Copyright IBM Corporation 1990, 1997. All rights reserved.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corporation.
Allocated space for /tsm/database/copy/file01: 210763776 bytes
tsm: TSM010> define dbcopy /tsm/database/primary/file01 /tsm/database/copy/file01 ANR2241I Database volume copy /tsm/database/copy/file01 defined.
tsm: TSM010> query dbvolume
Volume Name Copy Volume Name Copy Volume Name Copy
(Copy 1) Status (Copy 2) Status (Copy 3) Status
--- --- --- --- --- ---/tsm/database/p- Sync'd /tsm/database/c- Sync'd
Undef-rimary/file01 opy/file01 ined
/usr/tivoli/tsm- Sync'd Undef-
Undef-/server/bin/db- ined ined
.dsm
To mirror the recovery log, you must first create all of the new recovery log volumes by using the DSMFMT utility. Because we want to mirror the /tsm/log/primary/file01volume, we allocate a new copy for it under /tsm/log/copy/file01:
The next step is to define all recovery log volumes in Tivoli Storage Manager, using thedefine logcopycommand:
After a volume copy is defined, Tivoli Storage Manager synchronizes the volume copy with the original volume. This process can range from minutes to hours, depending on the size of the volumes and performance of your system. After synchronization is complete, the volume copies are mirror images of each other.
You can request information about mirrored recovery log volumes by using the query logvolumecommand. For example, the next screen shows a recovery log with its mirrored images. The recovery log volume is synchronized (Sync’d) with its mirrored volume copy:
tsm: TSM010> query logvol
Volume Name Copy Volume Name Copy Volume Name Copy
(Copy 1) Status (Copy 2) Status (Copy 3) Status
--- --- --- --- ---
---/tsm/log/primar- Sync'd Undef-
Undef-y/file01 ined ined
/usr/tivoli/tsm- Sync'd Undef-
Undef-/server/bin/lo- ined ined
g.dsm
root@ /tsm/log/primary > dsmfmt -log /tsm/log/copy/file01 101 AIX Server DSMFMT Extent/Volume Formatting Program
Licensed Materials - Property of IBM
5697-TSM (C) Copyright IBM Corporation 1990, 1997. All rights reserved.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corporation.
Allocated space for /tsm/log/copy/file01: 105906176 bytes
tsm: TSM010> define logcopy /tsm/log/primary/file01 /tsm/log/copy/file01 ANR2261I Recovery log volume copy /tsm/log/copy/file01 defined.
tsm: TSM010> query logvol
Volume Name Copy Volume Name Copy Volume Name Copy
(Copy 1) Status (Copy 2) Status (Copy 3) Status
--- --- --- --- --- ---/tsm/log/primar- Sync'd /tsm/log/copy/f- Sync'd
Undef-y/file01 ile01 ined
/usr/tivoli/tsm- Sync'd Undef-
Undef-/server/bin/lo- ined ined
g.dsm
Because our recommended configuration removes the default recovery log volume (/usr/tivoli/tsm/server/bin/log.dsm), there is no need to mirror it. For further details, see 4.7.2, “Removing the default recovery log volume” on page 71.