The order of the commands does not matter except that the storage-space names or filename must come last.
>>-onsmsync-----------------------------------------------------> >--+-+-----------------+--+-----+--+-----+--+------------------+-+->< | +- -g--generation-+ '- -s-' '- -O-' +- -f--filename----+ | | +- -t--time-------+ | .--------------. | | | '- -i--interval---' | V | | | | '---dbspace_list-+-' | '- -b---------------------------------------------------------'
Element | Purpose | Key Considerations |
---|---|---|
no options | Synchronizes the sysutils database and emergency boot file with the storage-manager catalog | None. |
-b | Regenerates the emergency boot file from the sysutils database only | Not used with the other onsmsync options. Does not synchronize with the storage manager. |
dbspace_list | Lists the storage spaces to expire | If you enter more than one storage space, use a space to separate the names. |
-f filename | Specifies the pathname of a file that contains a list of storage spaces to expire | Use this option to avoid entering a long list of storage spaces. The filename can be any valid UNIX or Windows filename. |
-g generation | Retains a certain number of versions of each level-0 backup | The latest generation of backups are retained and all earlier ones are expired. |
-i interval | Expires all backups older than some period of time | Retains backups younger than this interval. Backups older than interval are not expired if they are needed to restore from other backups after that interval. Use the ANSI or GLS format for the interval: YYYY-MM or DD HH:MM:SS |
-s | Skips backups that the storage manager has expired | Use this option to skip synchronizing objects that are already expired from the storage manager. The object expiration will be based on other arguments if the -s option is provided. |
-O | Enforces expiration policy strictly | If used with the -t, -g, or -i option, expires all levels of a backup, even if some of them are needed to restore from a backup that occurred after the expiration date. The -O option does not affect logical-log expiration. See Expiring All Backups. |
-t datetime | Expires all backups before a particular date and time | Retains backups younger than this datetime. Backups older than datetime are not expired if they are needed to restore from other backups after that datetime. Use the ANSI or GLS_DATETIME format for datetime. |
If called with no options, the onsmsync utility compares the backups in the sysutils database and emergency boot file with the backups in the storage-manager catalog. The onsmsync utility removes all backups that are not in the storage manager catalog from the sysutils database and emergency boot file.
The onsmsync utility starts onbar-merger processes that delete backups on all nodes that contain storage managers.
ISM and certain third-party storage managers do not allow onsmsync to delete backups from the storage manager. First, manually expire or delete the old backups from the storage manager. Then, run onsmsync without any parameters.
For more information, see the IBM Informix: Storage Manager Administrator's Guide.
To regenerate the emergency boot file only, use the following command:
onsmsync -b
On Dynamic Server, this command saves the old emergency boot file as ixbar.server_number.system_time and regenerates it as ixbar.server_number.
On Extended Parallel Server, this command saves the old backup boot file on each coserver as Bixbar_hostname_system_time.server_number and regenerates it as Bixbar_hostname.server_number.
If you lose the sysutils database, use the bldutil utility in $INFORMIXDIR/etc on UNIX or %INFORMIXDIR%\etc on Windows to re-create the sysutils database with empty tables.
Then use the onsmsync utility to re-create the backup and restore data in sysutils.
The onsmsync utility cannot tell which backups failed verification. If the latest backup failed verification but an earlier one was successful, you must manually delete the failed backup records from the storage manager and then run onsmsync with no options to synchronize ON–Bar. For more information, see Verifying Backups.
The following example expires backups that started before November 24, 2000 and all fake backups, failed backups, and restores:
onsmsync -t "2000-11-24 00:00"
The following example retains the latest three sets of level-0 backups and the associated incremental backups, and expires all earlier backups and all restores, fake backups, and failed backups:
onsmsync -g 3
The following example expires all backups that are older than three days and all fake backups, failed backups, and restores:
onsmsync -i "3 00:00:00"
The following example expires all backups older than 18 months (written as 1 year + 6 months):
onsmsync -i "1-6"
If you perform more than one point-in-time restores, multiple timelines for backups exist. Figure 21 shows three timelines with their backups.
In this example, the second timeline begins with a point-in-time restore to backup 1. The second timeline consists of backups 1, 5, 6, 7, and 8. The third timeline (in bold) consists of backups 1, 5, and 9. The third timeline is considered the current timeline because it contains the latest backup.
When you run onsmsync to expire old backups, onsmsync removes the old backups from the current timeline, and make sures that the current timeline is restorable from the backup objects that are retained. All other backups that are not in the current timeline are also expired but onsmsync does not make sure that the other timelines are restorable from the objects retained.
The onsmsync utility applies expiration policies in the following order to make sure that objects from current timeline are expired according to the specified expiration policy and that the current timeline is restorable:
At the same time, the expiration policy is applied to backups in other timelines.
For example, if you execute the onsmsync -g 2 command on the example in Figure 21, backup 1 from the current timeline is expired, and backups 2, 3, 4, 6, and 7 from the first and second timelines are expired. Backups 1, 5, and 9 from the current timeline are retained. Backup 8 is retained from other timelines.
The onsmsync utility retains the latest level-0 backup unless you use the -O option. If you use the -O and -t options, all backups from before the specified time are removed even if they are needed for restore. If you use the -O and -i options, all backups from before the specified interval are removed even if they are needed for restore.
For example, to expire all backups, specify the following:
onsmsync -O -g 0