Skip to main content

Estimate Backup Size Using ^DBSIZE

Estimate Backup Size Using ^DBSIZE

Immediately before performing an InterSystems IRIS backup, you can estimate the size of its output using the ^DBSIZE utility. It is only an estimate, since there is no way of knowing how many blocks will be modified once the backup starts. You can obtain a more accurate estimate by preventing global updates while running ^DBSIZE, and then running your backup before resuming global updates.

You can estimate the size of backups in two ways:

Note:

A database must be in the database backup list before you can evaluate it with ^DBSIZE. See Define Database Backup List for details.

Run ^DBSIZE Interactively

The following procedure describes the steps necessary to run ^DBSIZE interactively:

  1. Open the Terminal and run the utility from the %SYS namespace:

    %SYS>Do ^DBSIZE
    
    
  2. InterSystems IRIS displays the ^DBSIZE main menu:

                   Incremental Backup Size Estimator
     
     
    What kind of backup:
       1. Full backup of all in-use blocks
       2. Incremental since last backup
       3. Cumulative incremental since last full backup
       4. Exit the backup program
    1 => 
    
    
  3. Enter the appropriate menu option to select the type of backup for which you want an estimate: full, incremental, or cumulative. The prompts are the same for each type.

  4. At the following prompt either press Enter to suspend updates so that you get a more accurate estimate or enter No to allow updates:

    Suspend Updates?  Yes=>
    

    If you choose to suspend updates, you receive the following message:

    WARNING: Switch is set and may affect production for up to 30 seconds.
    Waiting for disk cleanup to finish... ready.
    
  5. The output first shows you how many InterSystems IRIS blocks you need to do the type of backup you selected. It shows an estimate for each directory in the backup list and a total. The following is an example of the display for a full backup:

    
                                                         In-Use    Block
    Directory                                            Blocks    Size
    
    c:\iris-install\mgr\                                  19,963   (8KB)
    c:\iris-install\mgr\irisaudit\                           189   (8KB)
    c:\iris-install\mgr\user\                                 61   (8KB)
                                                          --------------
     Total number of database blocks:                     36,228
    
    

    The display for an incremental and cumulative backup looks similar to this:

    
                                                         Modified  Block
    Directory                                            Blocks    Size
     
    c:\iris-install\mgr\                                       5   (8KB)
    c:\iris-install\mgr\irisaudit\                             3   (8KB)
    c:\iris-install\mgr\user\                                  1   (8KB)
                                                        - --------------
    Total number of database blocks:                          10
    
    
  6. The utility then displays information about backup disk file space:

    Total backup size, including overhead of volume and pass labels:
     
         For a disk file:
              Number of 512-byte blocks:  598,092  (306,223,104 bytes)
    

Use the ^DBSIZE Function

You can also call ^DBSIZE from a routine. To do so, you use the following function:

$$INT^DBSIZE(backup_type)
Important:

The values of backup_type differ from the menu option numbers when running ^DBSIZE interactively.

backup_type Description
1 Incremental backup
2 Full backup
3 Cumulative incremental backup

For example, to see the size estimate for running a full backup:

%SYS>w $$INT^DBSIZE(2)
18950^5^160952320^2710^160309248^313104^313104

The returned value is seven numbers separated by a caret (^). In this example, the returned value 18950 is the total estimated size of the backup, in blocks; the returned value 5 indicates the number of database directories to back up. The following table shows what is contained in each piece of the output.

Position of output Description
Piece 1 Number of database blocks for backup

(-1 if error during processing or invalid parameter)

Piece 2 Number of directories to back up
Piece 3 Number of bytes for media (not including inter-record gaps)
Piece 4 Number of blocks for media
Piece 5 Number of bytes for a disk file
Piece 6 Number of 512-byte blocks for a disk file

The following shows the output of calling the ^DBSIZE function for each type of backup:

%SYS>w $$INT^DBSIZE(1)
466^5^4157440^70^4122624^8052^8052

%SYS>w $$INT^DBSIZE(2)
18950^5^160952320^2710^160309248^313104^313104

%SYS>w $$INT^DBSIZE(3)
466^5^4157440^70^4122624^8052^8052

FeedbackOpens in a new tab