onbar -b syntax: Backing up

Use the onbar -b command to back up storage spaces and logical logs.

To run ON-Bar commands, you must be user root, user informix, a member of the bargroup group on UNIX™, or a member of the HCL OneDB™-Admin group on Windows™.

Figure 1: Syntax for backing up with ON-Bar

1  onbar  -b
1 
2.2.1+ 
2.2.1?   -L
2.2.2.1 0
2.2.2.1 1
2.2.2.1 2
2.2.1?   -p
2.2.2.1   -f filename
2.2.2.1 +  dbspace_list
2.2.2.1?  -w
2.1   -l
2.2.1  -C
2.2.1  -c
2.2.1  -s
1 ?   -O?   -cf
2.1 yes
2.1 no
2.1 only
1   -F
Table 1. Options for the onbar -b command
Option Description
-b Specifies a backup

Backs up the storage spaces and logical logs, including the current logical log.

dbspace_list Specifies the storage spaces to be backed up, separated by blank spaces.

If you do not enter dbspace_list or -f filename, ON-Bar backs up all online storage spaces on the database server.

-c Closes and backs up the current logical log and the other full logical logs.
-C Starts a continuous log backup.

Reserve a dedicated storage device and terminal window because the continuous log backups run indefinitely waiting for logical logs to fill.

To stop a continuous log backup, stop the ON-Bar process with an interrupt command, such as CTRL-C or SIGTERM.

-cf Specifies whether the critical files are backed up. The critical files are the onconfig file, the sqlhosts file, and the ixbar.servernum file.

Valid values are:

  • yes = Backs up the critical files. Default when performing a level 0, 1, or 2 backup.
  • no = Does not back up the critical files. Default when backing up the logical log files.
  • only = Backs up only the critical files.
-f filename Backs up the storage spaces that are listed in the text file that is specified by the filename value.

Use this option to avoid entering a long list of storage spaces every time that you back up.

For more information, see List of storage spaces in a file.

-F Performs a fake backup

A storage-manager application is not necessary. No backup actually occurs, so no restore is possible from a fake backup. Use fake backups sparingly, if at all. Fake backups might be appropriate in the following situations:

  • Change database logging modes
  • Change a RAW table to a STANDARD table
  • Allow the user to use new logs, chunks, or mirrors without performing a backup
  • In special situations when you, the administrator, judge that a backup is not needed
-L Specifies the level of backup to perform on storage spaces:
  • 0 = a complete backup (Default)
  • 1 = changes since the last level-0 backup
  • 2 = changes since the last level-1 backup

If you request an incremental backup and ON-Bar finds that no previous level backup was performed for a particular storage space, ON-Bar backs up that storage space at the previous level. For example, if you request a level-1 backup, and ON-Bar finds no level-0 backup, it makes a level-0 backup instead.

-l Performs a backup of full logical-log files.

The current logical-log file is not backed up.

If you are using ISM, it also backs up the ISM catalog.

-O Overrides normal backup restrictions.

Use this option to back up logical logs when blobspaces are offline.

If a log backup occurs when blobspaces are offline, return code 178 displays in the ON-Bar activity log.

-p Backs up only physical storage spaces without logical logs.

A warning message is written to the activity log listing the log unique ID of the latest log file that is required for a restore of the storage spaces. Use this option if logical logs are being continuously backed up. If necessary, a log switch is initiated, so that this log can be backed up. If the current log is already newer than the log with the archive checkpoint of the last storage space, then no log switch is initiated.

-s Salvages any logical logs that are still on disk after a database server failure. You can run the onbar -l -s command while the server is offline.

If possible, use this option before you replace a damaged disk. If you use onbar -r to perform a cold restore on an undamaged disk, ON-Bar automatically salvages the logical logs.

-w Backs up a whole system, which includes all storage spaces and logical logs based on a single checkpoint.

The time of the backup is stored with the backup information. The data in all storage spaces is consistent in a whole-system backup, therefore, you do not need to restore the logical logs to make the data consistent. If you do not save the logical logs, you must use the -w option.

Usage

Before you back up your data, make sure that your data is consistent by running the oncheck -cD command.

To run ON-Bar commands, you must be user root, user informix, or a member of the bargroup group on UNIX, or a member of the Informix-Admin group on Windows. For more information, see ON-Bar security.

You can back up storage spaces and logical logs when the database server is in online, quiescent, or fast-recovery mode.

The storage-space chunks can be stored on raw disk storage space, in cooked files, or on an NTFS file system (Windows).

Only online storage spaces are backed up. Use the onstat -d command to determine which storage spaces are online. During a backup, if ON-Bar encounters a down dbspace, it skips it and later returns an error. If a storage space is offline, restart the backup when the storage space is back online.

After you begin the backup, monitor its progress in the ON-Bar activity log and database server message log.

You can either back up the logical logs separately or with storage spaces. Back up the logical logs as soon as they fill so that you can reuse them and to protect against data loss if the disks that contain the logs are lost. If the log files fill, the database server pauses until you back up the logical logs. You can either back up the logical logs manually or start a continuous logical-log backup by running the onbar -b -C command. Logical-log backups are always level 0. After you close the current logical log, you can back it up.

If you perform whole-system backups and restores, you do not need to restore logical logs. However, back up the logical logs when you use whole-system backups. These log backups allow you to recover your data to a time after the whole-system backup, minimizing data loss.

If you are running continuous logical log backup and then start a whole system backup, the ON-Bar process attempts to save the logical logs. Because the continuous logical log backup is running, an error message is returned indicating that a logical log backup is already running, and the whole system backup returns a non-zero error code. In this case the logical logs are backed up only one time. To avoid the error, create a physical backup with the onbar -b -w -p command.

To back up a specific table or set of tables in ON-Bar, store these tables in a separate dbspace and then back up this dbspace. Alternatively, you can perform table level restores with the archecker utility.

Example: Back up a whole system

The following command performs a level-0 whole system backup after taking a checkpoint of all online storage spaces and logical logs:

onbar -b -w

The following command performs a level-1 whole system backup:

onbar -b -w -L 1

Example: Back up all online storage spaces and logical logs

The following command performs a standard, level-0 backup of all online storage spaces and used logical logs:

onbar -b

Example: Perform an incremental backup

The following command performs a standard, level-1 backup:
onbar -b -L 1

Example: Back up specified storage spaces and all logical logs

The following command performs a level-0 backup of the dbspaces named fin_dbspace1 and fin_dbspace2 and all logical logs:
onbar -b fin_dbspace1 fin_dbspace2

Example: Back up a list of storage spaces specified in a file

The following sample file named listfile3 contains a list of storage spaces to be backed up:blobsp2.1, my_dbspace1, blobsp2.2, dbsl.1, rootdbs.1, and dbsl.2.

blobsp2.1
# a comment                     ignore this text

       my_dbspace1           # back up this dbspace
; another comment
blobsp2.2                      dbsl.1
rootdbs.1      dbsl.2   ; backing up two spaces
The following command backs up the storage spaces listed in the listfile3 file:
onbar -b -f listfile3

Example: Back up logical logs

The following command starts a manual logical-log backup:

onbar -b -l

The following command backs up the current logical-log file:

onbar -b -l -c

Example: Physical backup

The following command backs up all storage spaces without backing up any logical logs:

onbar -b -p -L 0

A warning message is written to the ON-Bar activity log file stating that log file backup was not initiated. The message also contains the log unique ID of the latest log file that is required for a restore of the storage spaces. The latest required log file contains the archive checkpoint of the last dbspace backed up.

Example message:
2011-12-14 09:30:35 14277  14275 (-43354) WARNING: Logical logs were
     not backed up as part of this operation. Logs through log unique ID 9
     are needed for restoring this backup. Make sure these logs are backed 
     up separately.