Creating vbr Configuration Files
The vbr
utility uses a configuration file for the information required to back up and restore a full- or object-level backup or copy a cluster. You cannot run vbr
without a configuration file because no default file exists. You can, however:
- Create a configuration file. See Start the vbr Configuration Script.
- Copy and edit an existing configuration file and save the changes to a different file name.
- Copy and edit one of the sample configuration files included with Vertica.
Note: You must be logged on as the database administrator, not root
, to create the vbr
configuration file.
Start the vbr Configuration Script
To create a configuration file, enter this command:
> /opt/vertica/bin/vbr --setupconfig
The script prompts you to answer several questions, as shown in the following summarized example:
[dbadmin@localhost ~]$ /opt/vertica/bin/vbr --setupconfig Snapshot name (backup_snapshot): fullbak1 Number of restore points (1): 3 Specify objects (no default): Object restore mode (coexist, createOrReplace or create) (createOrReplace): Vertica user name (dbadmin): Save password to avoid runtime prompt? (n) [y/n]: y Password to save in vbr config file (no default): Node v_vmart_node0001 Backup host name (no default): 194.66.82.11 Backup directory (no default): /home/dbadmin/backups Config file name (fullbak1.ini): Password file name (no default value) (no default):pwdfile Change advanced settings? (n) [y/n]: n Saved vbr configuration to fullbak1.ini. Saved vbr database password to pwdfile.ini.
For further information on how to answer these questions, see:
See the following instructions to complete the questions in the configuration script:
- Specify a Backup Name
- Specify Restore Points
- Specify Object Restore Mode
- Specify Full or Object-Level Backups
- Enter the User Name
- Save the Account Password
- Specify the Backup Host and Directory
- Save the Configuration File
- Continue to Advanced Settings
Specify a Backup Name
Specify the name of the backup for vbr
to create:
Snapshot name (backup_snapshot):
You must provide a name for the backup that clearly identifies the specific backup. The backup name is used in the directory tree structure that vbr
creates for each node. Because Vertica automatically augments the backup subdirectories with date and time indicators, do not add dates to the backup name.
Create different configuration files with specific backup names for full and object-level backups, but use the same backup directory for both types of backups. For example, the configuration file for a full database backup, namedfullbak.ini
, has these snapshotName
and backupDir
parameter values:
snapshotName=fullbak backupDir=/home/dbadmin/data/backups
The configuration file for the object-level backup, namedobjectbak.ini
, has these parameter values:
snapshotName=objectbak
backupDir=/home/dbadmin/data/backups
Specify Restore Points
Specify how many backups to save as a number of restore points:
Number of restore points (1):
The default value is 1, indicating that vbr
always retains one additional restore point.
Saving multiple restore points gives you the option to recover from one of several backups. For example, if you specify 3
, you have 1 current backup, and 3 backup archives. Vertica stores the value you enter as the restorePointLimit
parameter in the vbr
configuration file.
Specify Object Restore Mode
Specify how Vertica should handle restored objects, as this example shows:
Object restore mode (coexist, createOrReplace or create) (createOrReplace):
Vertica supports the following object restore modes:
- createOrReplace (default) — Vertica creates any objects that do not exist. If the object does exist,
vbr
overwrites it with the version from the archive. - create — Vertica creates any objects that do not exist. If an object being restored does exist, Vertica displays an error message and skips that object.
- coexist — Vertica creates all restored objects with the form
<backup>_<timestamp>_<object_name>
. This approach allows existing and restored objects to exist simultaneously. If the appended information pushes the schema name past the maximum length of 128 characters, HP Vertica truncates the name. You can perform a reverse lookup of the original schema name by querying the system table TRUNCATED_SCHEMATA.
In all modes, Vertica restores data with the current epoch. Object restore mode settings do not apply to backups and full restores.
Specify Full or Object-Level Backups
Indicate whether you want to create a full- or object-level backup:
Specify objects (no default):
- For full database backup: Press
Enter
to continue creating a configuration file for a full database backup.
- For object-level backup: Enter the names of any schema or table for which you want to create an object-level backup configuration file. Enter table names in the form
schema.objectname
.
For example, to make backups of the table,customers
from the schema,finance
, enterfinance.customers
. Separate each name with a comma (,
). The objects you enter appear listed in theObjects
parameter of the configuration file.
Enter the User Name
Enter the user name of the person who invoking vbr
:
Vertica user name (dbadmin):
Note: This user name must be the user identified as the database administrator for the entire database. No other user has permission to invoke this action, even if the user has dbadmin permissions within portions of the database.
Save the Account Password
Specify whether vbr
prompts for an account password at run time:
Save password to avoid runtime prompt? (n) [y/n]:
Press Enter to accept the default (n
) and continue. Because you are not saving the password, you must enter it when you run vbr
.
To save your password to a password configuration file, enter y
. The utility prompts for you to enter the password but does not display the text as you type:
Save password to avoid runtime prompt? (n) [y/n]:
The parameter name in the configuration file that indicates whether to prompt for a password is dbPromptForPassword
.
Specify the Backup Host and Directory
Vbr lists each node name for your cluster. Enter the backup host name and directory for each cluster node at the prompts:
Node v_vmart_node0001
Backup host name (no default):
Backup directory (no default):
No defaults exist for either the host name or the backup directory.
In the configuration file, all cluster nodes appear listed by name under the [Mapping]
section. Each cluster node contains a line that includes the cluster node, backup host, and backup directory location:
[Mapping]
v_vmart_node0001 = 194.66.82.11:/home/dbadmin/backups
Save the Configuration File
To save the configuration file with its default name, enter a configuration file name of your choice, or press (Enter
:
Config file name (fullbak.ini):
The default name consists of:
- The backup name you supplied (
fullbak
in this example) - An
.ini
file extension
The vbr
utility confirms that it saved the file:
Saved vbr configuration to fullbak.ini.
By default, Vertica saves the file in the current working directory. You can include a fully qualified or relative path to save the configuration file to an alternate location.
Note: The backup configuration file is typically stored on the cluster you are backing up. Therefore, Open Text Corporation recommends that you also save a copy of the configuration file on the backup host. If you do so, the configuration file remains available, even if the cluster node is lost.
Continue to Advanced Settings
To continue with advanced configuration settings, enter y
:
Change advanced settings? (n) [y/n]:
To continue without advanced settings and save the configuration file with the information you just entered, press Enter.
Changing the objectRestoreMode Parameter Value
After you create the configuration file, you can also specify an objectRestoreMode
parameter. The objectRestoreMode
parameter is associated only with restoring object-level backups.