Examples: Manage storage devices with Informix Primary Storage Manager
Learn how to set up and use Informix® Primary Storage Manager to manage storage devices that the onbar utility uses for backing up and restoring instances. Each example shows how you can use the storage manager for a specific backup strategy.
Prerequisites:
- Informix 14.10 is installed with the ON-Bar utility.
- Environment variable INFORMIXDIR is set to the path where the database server is installed.
- Environment variable ONCONFIG is set to the file in $INFORMIXDIR/etc that contains the configuration parameters for your database. The name of the file must be unique for each database server instance.
- User informix or root privileges.
- Example 1: Storing backups for an instance
- Example 2: Storing backups for two instances
- Example 3: Exporting backups to and restoring them from another directory
- Example 4: Exporting a backup from one server and importing it into another server
In these examples, storage manager refers to Informix Primary Storage Manager.
Example 1: Storing backups for an instance
This example shows how to set up and use Informix Primary Storage Manager to back up the data and logical logs for a single database server instance to a directory: $INFORMIXDIR/backups.
In this example, you update the configuration file so that the Informix Primary Storage Manager can communicate with ON-Bar and you specify the directory where you want backups stored. Then you use the onbar utility to perform a standard, level-0 backup of all online storage spaces and used logical logs. You validate the backup by checking the messages that were logged and by using the onpsm utility to confirm that storage objects were created.
With a few simple steps, you configured the storage manager and performed a full backup of an instance to a file device. Very little configuration was required because the storage manager uses the default settings for various ON-Bar configuration parameters.
Storage catalog tables are not included in a backup. Be sure to back up the storage catalog tables with your operating system tools as part of a disaster recovery strategy. If the storage catalog tables are lost, the onbar utility cannot restore the backup objects that Informix Primary Storage Manager created. The location of the storage catalog tables is set by the PSM_CATALOG_PATH configuration parameter (default = $INFORMIXDIR/etc/psm).
To restore the instance from the backup objects, use the onbar utility. The storage manager tracks the backup objects and storage devices for you.
Example 2: Storing backups for two instances
This example shows how to configure one instance of Informix Primary Storage Manager to manage the storage devices for two database server instances in a multiple residency environment.
In this example, you set up two independent database server environments on the same computer. Each database server is installed in a separate directory: (/usr/informix/ids1210fc1 and /usr/informix/ids1210fc1b) and has a database server instance. Storage for backup operations on both database server instances is managed by one instance of Informix Primary Storage Manager. Pools of storage devices for physical and logical data are configured for each instance.
Example 3: Exporting backups to and restoring them from another directory
This example shows how to export backups to a new directory and import the backup objects from that directory.
Suppose that you keep five generations of backups. As an added precaution, you also keep copies of the most recent backups in a separate directory. In this example, you use the onsmsync utility to export your most recent backup to and import it from the Informix Primary Storage Manager external pool in a separate directory.
The storage manager tracks devices in the external device pool (EXTPOOL) so it can copy objects to and from external devices. (Although the storage manager tracks devices, it does not track files and objects that are inside the EXTPOOL pool in the storage manager catalogs.)
- Run the onsmsync command to import all backup
objects in the pw_sept5 subdirectory:
onsmsync -I -p pw_sept5
Use your own file-transfer methods to move the exported backups, as needed, to other machines.
Example 4: Exporting a backup from one server and importing it into another server
This example shows how to use the onsmsync utility to export a backup from a database server that has the name informix_serv1. Then the example shows how to use the onsmsync utility to import the data into a server that has the name informix_serv2.