Managing ObjectStore
osarchiv: Logging Transactions Between Backups
The osarchiv utility records all transaction activity for specified databases. You can run this utility interactively or in the background. See also Overview of the Backup/Restore Facility.
Syntax
osarchiv [options] -d directory [pathname...]
Options
-a archive-record-file
| Specifies the pathname of the file that osarchiv uses to record the segment change IDs for the archive set. The osarchiv utility updates this file each time it successfully records committed changes to the archive set. This is referred to as taking a snapshot. The archive record file is comparable to the incremental record file for osbackup.
|
-B size
| Specifies the size of the buffer used by each Server that osarchiv contacts. size is a number optionally appended with k, m, or g to indicate kilobytes, megabytes, or gigabytes, respectively. If no letter is specified, m is presumed. For example, -B 1024k, -B 1m, and -B 1 each specify a maximum buffer size of 1 MB. The default value is 1 MB.
|
-C
| Enables the interactive command-loop feature. This feature is disabled by default.
|
-i interval
| Specifies an integer that osarchiv uses as the interval between snapshots. By default, this interval is in seconds, but you can append m, h, or d to indicate minutes, hours, or days. For example, -i 60 and -i 1m both specify an interval of one minute.
When interval is not 0, osarchiv takes a snapshot immediately after being initiated, then every interval seconds (or minutes, hours, or days) thereafter.
When you do not specify an interval, it defaults to 0, which means that snapshots are not taken automatically. You can take a snapshot at any time that osarchiv is active by issuing the x command. See the command description for x.
|
-I import-file
| Specifies the name of a file that contains a list of either file or rawfs database pathnames. The osarchiv utility logs transactions for the databases in this list. The osarchiv utility cannot read such a list from stdin.
The list contains one pathname per line. Leading and trailing white space is ignored.
If you specify the -I (uppercase I) option, you can also specify additional pathnames on the command line. After you initiate the osarchiv utility, you can use the a command to add databases to the archive set. See a pathname. You cannot specify -I-.
|
-r
| Instructs osarchiv to descend into any rawfs directories specified on the command line, adding all rawfs databases found to the archive set. By default, only databases in the specified directory are backed up.
When archiving file databases, specifying the -r option has no effect. You must specify each file database explicitly.
After archive logging begins, you can add a rawfs directory to the archive set. If you specified -r when you initiated osarchiv, it applies to subsequently added rawfs directories.
You cannot specify the -r option for some directories and not for others. When specified, it applies to the entire archive set.
|
-s- size
| Specifies the maximum amount of data to write to an archive file. By default, this size is in megabytes. You can specify KB, MB, or GB by appending k, m, or g to size. For example, -s 1024k, -s 1m, and -s 1 each specify a maximum archive file size of 1 MB.
When an archive file is full, the osarchiv utility automatically starts using the next file in the archive file sequence. A particular snapshot is always in a single archive file; osarchiv never stores it across two files.
The default is 2 MB.
|
Commands
You can execute the following commands when you use osarchiv in interactive mode. The utility processes the command between snapshots.
Description
When archive logging is active, ObjectStore takes snapshots of modifications to the archive set. An archive snapshot records all data modified by transactions that have committed since the last snapshot was taken.
When you start osarchiv, the first snapshot records data modified by transactions that committed since the last time the osbackup or osarchiv utility was run.
Tape device
You cannot perform archive logging to a tape device.
Archive
file format
The osarchiv utility places snapshots in archive files in the directory that you specified when you initiated the osarchiv utility. The utility uses the following naming convention for archive files:
YYYYMMDDHH.ext
Switching
archive files
The osarchiv utility places consecutive snapshots in the same archive file until one of the following happens:
Ensure sufficient
disk space
You must ensure that there is sufficient disk space available to the osarchiv utility by periodically moving archive files to secondary storage. When osarchiv runs out of disk space for archive files, it notifies you and suspends activity. You must move archive files or allocate additional disk space to allow the utility to continue.
Adding to
archive set
When you add a database to a directory for which you are performing archive logging, the osarchiv utility does not begin to take snapshots of that database automatically. To enable archive logging for the additional database, you must use the a command to explicitly add the database to the archive set.
Deleting a database
When you are performing archive logging for a database, the Server keeps the database open. This has implications for deleting databases.
Windows
On Windows, you cannot delete a database for which you are performing archive logging until you invoke the osarchiv r command to remove the database from the archive set.
UNIX
On UNIX systems, when you remove a file, the operating system removes its directory entry but does not actually delete the file or free associated disk space until there are no applications with the database open. Again, you must invoke the osarchiv r command to remove the database from the archive set.
On all systems, the r command does not take effect until the end of a snapshot.
Tradeoffs for Obtaining the Results You Need
Decreasing the time between snapshots decreases the number of transactions recorded in each snapshot. Shorter intervals between snapshots have the effect of keeping the archive more up to date and keeping the amount of data that needs to be archived smaller.
However, each snapshot causes information to be written to the archive file, even if no data modifications are being recorded. Taking snapshots too frequently can consume space in the archive file unnecessarily. Longer intervals can reduce the amount of data being logged in cases in which the same data is modified by multiple transactions. In such cases, only the most recent copy of the committed data needs to be logged.
Examples
In the following example, ./inc is the pathname of the file that osarchiv uses to record the cluster change IDs for the archive set. The osarchiv utility updates this file each time it takes a snapshot. The directory in which to create the archive log files is /vancouver1/archives. The -i option indicates that snapshots should be taken every 30 seconds. The -r option instructs osarchiv to descend into any rawfs directories specified on the command line, adding to the archive set all rawfs databases found. Finally, vancouver::/ specifies a rawfs directory whose transactions you want to log.
% osarchiv -C -a ./inc -d /vancouver1/archives/ -i 30 -r vancouver::/
Writing backup volume #1 (/vancouver1/archives/1999011216.aaa)...
Display archive set members
> t
vancouver::/foo.db
vancouver::/dbdir/bar.db
vancouver::/dbdir/foo.db
Take a snapshot now
> x
Archiving 452 sectors in database vancouver::/dbdir/bar.db.
Archiving 452 sectors in database vancouver::/dbdir/foo.db.
Archiving 452 sectors in database vancouver::/foo.db.
Add to archive set
> a /vancouver1/dbdir/foo.db
Display archive set members
> t
vancouver::/foo.db
vancouver::/dbdir/bar.db
vancouver::/dbdir/foo.db
vancouver:/vancouver1/dbdir/foo.db
If you press Enter while the osarchiv utility is taking a snapshot, the utility displays a message such as the following. If it is not taking a snapshot, the utility displays another prompt symbol.
>
Archiving 452 sectors in database vancouver:/vancouver1/dbdir/foo.db.
Save snapshots in next archive file
> n
Closing volume #1 (/vancouver1/archives/1999011216.aaa).
Writing backup volume #2 (/vancouver1/archives/1999011216.aab)...
Display snapshot interval
> i
Snapshot interval is 5 seconds.
Change snapshot interval
> i 1m
> i
Snapshot interval is 60 seconds.
Remove member of archive set, display archive set members
> r vancouver::/foo.db
> t
vancouver::/dbdir/bar.db
vancouver::/dbdir/foo.db
vancouver:/vancouver1/dbdir/foo.db
Take a snapshot now
> x
Archiving 68 sectors in database vancouver::/foo.db.
Take a snapshot and terminate osarchiv utility
> q
Closing volume #2 (/vancouver1/archives/1999011216.aab).
%
API
None
[previous] [next]
Copyright © 1999 Object Design, Inc. All rights
reserved.
Updated: 03/11/99 11:19:07