Question & Answer
Question
How do I estimate the size of an incremental backup?
Answer
To find the estimated size of an incremental backup, you can use the /nz/support/contrib/bin/nz_backup_size_estimate script. The script is available as part of the Support tool kit. If Support tools are not installed on the system, refer to the related document, "How do I install the nz-support tools?"
The nz_backup_size_estimate script analyzes the database on which you will be performing the incremental backup (via nzbackup). It then provides an estimate of the amount of data that has changed and must be backed up. Use the script's help, nz_backup_size_estimate -h, to learn more.
In the following example, there is a table named “test” in database named “system_test” (which was previously backed up). Executing the script nz_backup_size_estimate provides the following output:
[nz@box1 system]$ nz_backup_size_estimate -db system_test
Database: SYSTEM_TEST
Starting TX id: 2628649
Ending TX id: 2628655
Visible+Invisible|Current Rowcount|DELETE'd Rows|INSERT'ed Rows|Table Size|Table Objid|Table Name
-----------------+----------------+-------------+--------------+-----------+------------+------
15,902 | 15,902 | 0 | 0 | 1,495,612 | 5714476 | TEST
[nz@box1 system]$
To calculate the average rowsize, divide the Table Size column value by the number of Visible+Invisible rows. In the example above, the average row size is 94.052 Bytes.
You can now do an insert in the table (to have new data for backup in a table) and then run nz_backup_size_estimate again:
nzsql system_test -c " insert into test select * from _t_object;"
[nz@box1 system]$ nz_backup_size_estimate -db system_test
Database: SYSTEM_TEST
Starting TX id: 2628649
Ending TX id: 2628711
Visible+Invisible|Current Rowcount|DELETE'd Rows|INSERT'ed Rows|Table Size|Table Objid|Table Name
-----------------+----------------+-------------+--------------+-----------+------------+------
31,804 | 31,804 | 0 | 15,902 | 2,991,340 | 5714476 | TEST
You have new mail in /var/spool/mail/nz
[nz@box1 system]$
To find the average size of data increase, do the following calculation:
(Table Size/Visible+Invisible) * (DELETE’d Rows + INSERT’ed Rows) = Bytes to be backed up
Using the values from the above output in the equation provides the following results:
((2,991,340 / 31,804) * ( 0 + 15,902))
(94.05546472141869) * (15,902) = 1495670 Bytes
In other words, 1495670 Bytes is the estimated size of the data to be backed up.
Historical Number
NZ694590
Was this topic helpful?
Document Information
Modified date:
17 October 2019
UID
swg21567110