This chapter provides information about ObjectStore utilities. Many of these utilities are implemented using the os_dbutil class methods. See the ObjectStore C++ API Reference.
UNIX | $OS_ROOTDIR/bin/utility-name |
Windows and OS/2 | %OS_ROOTDIR%\bin\utility-name.exe |
Earlier releases
In previous releases of ObjectStore, utilities were in the /admin and /debugging directories. These directories are obsolete. FAT names on OS/2
On OS/2, if you install ObjectStore on a FAT file system, ObjectStore uses the FAT name for a utility if the usual name of the utility exceeds eight characters. os_postlink: Fixing Vtbls and Discriminants
On cfront platforms, the os_postlink utility fixes vtbls and discriminants in your executable.
Syntax
Use the OS_POSTLINK macro in your makefile to call the os_postlink utility.
$(OS_POSTLINK) executable
When your application references a persistent object of a class with virtual functions, ObjectStore must fill in the vtbl pointer in the object. Virtual function tables are not stored in databases; they are part of your executable. To fill in the vtbl pointer, ObjectStore needs the address of the vtbl for the class.
During relocation, ObjectStore might need vtbls and discriminant functions. It finds them in tables that map class names to references to vtbls and discriminant functions. The schema generator generates a C++ source file (or object file for Visual C++) containing these tables that relate your schema to your application.
These tables are filled in during application link or postlink or at program start-up time, or some combination of these, depending on the platform. At each of these steps, the referenced vtbls and discriminants are searched for in the executable and, if found, are entered into the tables. At run time, ObjectStore can use these tables to find items for relocation.
On cfront platforms, the os_postlink executable performs this job. On some platforms, the compiler/linker does it. On some platforms, this search might be done at run time based on the currently available DLLs.
osarchiv [options] -d directory [pathname...]
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. Tape device
You cannot perform archive logging to a tape device. Archive
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:
file format
YYMMDDHH.ext
Variable Meaning YY Year
MM Month
DD Day
HH Hour
ext Extension of the form aaa, aab, aac, and so on
On all systems, the r command does not take effect until the end of a snapshot.
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 where the same data is modified by multiple transactions. In such cases, only the most recent copy of the committed data needs to be logged.
% osarchiv -C -a ./inc -d /vancouver1/archives/ -i 30 -r vancouver::/
Writing backup volume #1 (/vancouver1/archives/96011216.aaa)...
> t
vancouver::/foo.db vancouver::/dbdir/bar.db vancouver::/dbdir/foo.db
> 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.
> a /vancouver1/dbdir/foo.db
> t
vancouver::/foo.db vancouver::/dbdir/bar.db vancouver::/dbdir/foo.db vancouver:/vancouver1/dbdir/foo.dbIf 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.
> n
Closing volume #1 (/vancouver1/archives/96011216.aaa). Writing backup volume #2 (/vancouver1/archives/96011216.aab)...
> i
Snapshot interval is 5 seconds.
> i 1m > i
Snapshot interval is 60 seconds.
> r vancouver::/foo.db > t
vancouver::/dbdir/bar.db vancouver::/dbdir/foo.db vancouver:/vancouver1/dbdir/foo.db
> x
Archiving 68 sectors in database vancouver::/foo.db.
> q
Closing volume #2 (/vancouver1/archives/96011216.aab). %
osbackup [options] -f backup-image-file [-f backup-image-file]...
pathname ...
When backup starts, osbackup determines which segments require backup, builds a map that describes this data, and sets itself up to intercept read and write requests to and from these sectors. Any time the Server reads a sector of interest to the backup process that has not already been backed up, osbackup allows the read to proceed and makes a copy of the data at that time. Similarly, write requests are intercepted and delayed long enough for osbackup to retrieve the transaction-consistent data first. Otherwise, the backup process operates in the background, retrieving data as efficiently as possible.
You can mix file databases and rawfs databases in the set of databases to be backed up.
If a file of this name already exists, it is written over, and data in it is lost. For this reason, it is recommended that you use the -i option to provide a unique name for the incremental record file.
% osls -l vancouver::/foo.db
-rw-rw-r-- smith odi 231424 Dec 20 16:17 vancouver::/foo.db %
% osbackup -i ./inc -f ./s1 -f ./s2 -f ./s3 -s 80k vancouver::/foo.db
Writing backup volume #1 (./s1)... Archiving 452 sectors in database vancouver::/foo.db. Closing volume #1 (./s1). Auto switching to volume #2 (./s2). Writing backup volume #2 (./s2)... Closing volume #2 (./s2). Auto switching to volume #3 (./s3). Writing backup volume #3 (./s3)... Closing volume #3 (./s3). %If you do not specify enough files, it prompts as follows:
% osbackup -i ./inc -f ./s1 -f ./s2 -f ./s3 -s 10k vancouver::/mdltst1.db
Writing backup volume #1 (./s1)... Closing volume #1 (./s1). Auto switching to volume #2 (./s2). Writing backup volume #2 (./s2)... Closing volume #2 (./s2). Auto switching to volume #3 (./s3). Writing backup volume #3 (./s3)... Archiving 913 sectors in database vancouver::/mdltst1.db. Closing volume #3 (./s3). Please enter the pathname of the next file to use for backup.
% osls vancouver::/
dbdir/ foo.db
% osls vancouver::/dbdir
bar.db foo.db
% touch ./img <-- create file to demonstrate problem % osbackup -f ./img -i ./inc vancouver::/foo.db
Error encountered while opening file ./img (File ./img already exists. Cannot archive to an existing file.)
Do you wish to try_again? (yes/no): yes Please enter the pathname of the next file to use for backup. ./img2 Writing backup volume #1 (./img2)... Archiving 452 sectors in database vancouver::/foo.db. Closing volume #1 (./img2).
% osbackup -f ./img -i ./inc -r vancouver::/
Writing backup volume #1 (./img)... 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. Closing volume #1 (./img).
% cat ./import_file
vancouver::/foo.db /vancouver1/dbdir/foo.db %
% osbackup -f ./img -i ./inc -I ./import_file
Writing backup volume #1 (./img)... Archiving 452 sectors in database vancouver:/vancouver1/dbdir/foo.db. Archiving 452 sectors in database vancouver::/foo.db. Closing volume #1 (./img). %
% osbackup -f ./img -i ./inc -I ./import_file vancouver::/dbdir/foo.db
Writing backup volume #1 (./img)... Archiving 452 sectors in database vancouver:/vancouver1/dbdir/foo.db. Archiving 452 sectors in database vancouver::/dbdir/foo.db. Archiving 452 sectors in database vancouver::/foo.db. Closing volume #1 (./img). %
% $OS_ROOTDIR/bin/osbackup -f ./img0 -i ./inc -l 0 vancouver::/foo.db
Writing backup volume #1 (./img0)... Archiving 452 sectors in database vancouver::/foo.db. Closing volume #1 (./img0).
% $OS_ROOTDIR/bin/osbackup -f ./img1 -i ./inc -l 1 vancouver::/foo.db
Writing backup volume #1 (./img1)... Closing volume #1 (./img1).
% $OS_ROOTDIR/bin/osbackup -f ./img2 -i ./inc -l 2 vancouver::/foo.db
Writing backup volume #1 (./img2)... Closing volume #1 (./img2).
% osrm vancouver::/foo.db
% $OS_ROOTDIR/bin/osrestore -f ./img0
Recovering from volume #1 (./img0)... Restoring 452 sectors to database "vancouver::/foo.db" Recovered to time Thu Jan 12 15:50:10 1996 Do you wish to restore from any additional incremental backups? (yes/no):
yes
Closing volume #1 (./img0). Please enter the pathname of the next file from which to restore.
./img1
Recovering from volume #2 (./img1)... Recovered to time Thu Jan 12 15:50:21 1996 Do you wish to restore from any additional incremental backups? (yes/no):
yes
Closing volume #2 (./img1). Please enter the pathname of the next file from which to restore.
./img2
Recovering from volume #3 (./img2)... Recovered to time Thu Jan 12 15:50:41 1996 Do you wish to restore from any additional incremental backups? (yes/no):
no
Closing volume #3 (./img2). %
oschangedbref db {from | -n name1} {to | -n name2}
oschange
ossize loon:/dbs/db_0
[ ...] External database pointers: Relative name db_1, resolves to loon:/dbs/db_1 External references: Relative name db_3, resolves to loon:/dbs/db_3To change the reference to db_3 to a reference to db_7, enter
oschangedbref loon:/dbs/db_0 loon:/dbs/db_3 loon:/dbs/db7For the to argument, you can use the relative pathname instead of the absolute name. This is an equivalent command:
oschangedbref loon:/dbs/db_0 loon:/dbs/db_3 db7
ossize me:h:\temp\t_1[output omitted]
External database pointers: Relative name t_3, resolves to me:h:\temp\t_3 Relative name t_0, resolves to me:h:\temp\t_0 Relative name t_2, resolves to me:h:\temp\t_2 External references: Relative name t_3, resolves to me:h:\temp\t_3To change pointers and references from t_3 to t_3.new, enter
oschange me:h:\temp\t_1 me:h:\temp\t_3 me:h:\temp\t_3.newor
oschange me:h:\temp\t_1 me:h:\temp\t_3 t_3.new
If you move both db1 and db2 to a different directory, for example, /e/f/g, the reference is still valid because the result is
/e/f/g/db1 /e/f/g/db2Both db1 and db2 are still in the same relative pathname.
If you move db1 to /e/f and db2 to /e/f/g, the result is
/e/f/db1 /e/f/g/db2In this case, they are no longer in the same relative path. You need to use the oschangedbref utility.
/e/f/db1 /e/f/c/db2The reference is still valid because db1 still refers to c/db2.
If you want to move only db1 to Server red in directory /x/y, then you must use oschangedbref to change the reference from db1 to specify the full pathname, including Server name, for db2.
When you store references, no Server name is attached until you use oschangedbref to specify it. The exception to this rule is if you use os_database::set_relative_directory(). See the ObjectStore C++ API Reference.
oschgrp [-R][-f] group pathname ...
When you specify a file database, you cannot specify a remote file-server host name in the pathname of the file database. The oschgrp utility passes the operation to a local native utility. If you specify a remote file-server host name, ObjectStore informs you that you specified an illegal pathname.
oschgrp can perform wildcard processing. See "Wildcards".
UNIX
When operating on a rawfs database, you must enclose the wildcard in quotation marks ("") or precede it with a back slash (\) to keep the shell from interpreting wildcards. API
Class: os_dbutil
Method: chgrp oschhost: Changing Rawfs Link Hosts
The oschhost utility changes the host that a link in the rawfs points to. Syntax
oschhost [-f][-R] newhost pathname ...
newhost | Specifies the name of the new host for the specified rawfs link. |
pathname ... | Specifies one or more rawfs links. |
-f | Forces execution. Errors are not reported. |
-R | Indicates that ObjectStore should change the host recursively for all specified directories. |
You can use oschhost to update the rawfs after you restore an entire file system from one Server to another.
Use the first form of the utility to change specified links, that is, links with particular pathnames.
Use the second form of the utility to change all links on a particular host (server_host) that point to a specified host (old_link_host) so that they point to a new host (new_link_host).
oschmod [-R][-f] new_mode pathname ...
-R | Indicates that ObjectStore should change the permission recursively for all specified directories. |
-f | Forces execution. Errors are not reported. |
The new_mode argument can be absolute or symbolic.
[ who ] op permission [ op permission ] ...
who is a combination of
u | User permissions |
g | Group permissions |
o | Others |
a | All, or ugo |
If you omit who, the default is a, but the setting of the file creation mask (on UNIX, see umask in sh(1) or csh(1) for more information) is taken into account. When who is omitted, oschmod does not override the restrictions of your user mask.
+ | Add the permission |
- | Remove the permission. |
= | Assign the permission explicitly (all other bits for that category, owner, group, or others, are reset). |
permission is any combination of
r | Read |
w | Write |
x | Execute |
Omitting permission is useful only with =, to remove all permissions.
When you specify a file database, you cannot specify a remote file-server host in the pathname of the file database. The oschmod utility passes the operation to a local native utility. If you specify a remote file-server host name, ObjectStore informs you that you specified an illegal pathname.
UNIX
When operating on a rawfs database, you must enclose the wildcard in quotation marks (" ") or precede it with a back slash (\) to keep the shell from interpreting wildcards. API
Class: os_dbutil
Method: chmod oschown: Changing Database Owners
The oschown utility changes the ownership of specified databases and directories. Syntax
oschown [-R][-f] owner[.group] pathname ...
-R | Indicates that ObjectStore should change the owner recursively for all specified directories. |
-f | Forces execution. Errors are not reported. |
When you specify a file database, you cannot specify a remote file-server host in the pathname of the file database. The oschown utility passes the operation to a local native utility. If you specify a remote file-server host name, ObjectStore informs you that you specified an illegal pathname.
oschown can perform wildcard processing. See "Wildcards".
UNIX
You must be the superuser to run this utility. The owner must be a user name in the password file, /etc/passwd. Only the superuser can change the owner of a directory or database. The group is a group name found in the GID file, /etc/group. API
Class: os_dbutil
Method: chown oscmrf: Deleting Cache and Commseg Files
The oscmrf utility instructs the Cache Manager on the specified host to delete the cache files and commseg files in its free pool. Syntax
oscmrf [hostname]
hostname | Specifies the host of the Cache Manager that you want to instruct to delete cache and commseg files. Defaults to the local host. |
After oscmrf runs, if an additional client appears, the Cache Manager must create new cache and commseg files. This is slightly slower than if it did not have to create these files.
% oscmrf
Deleted 2 cache files and 2 commseg files. %
oscmshtd [hostname] [version]
% oscmshtd
Shutting down Cache Manager process %
oscmstat [hostname] [version-number]
If you do not specify a host name, the default is the local host.
The oscmstat utility prints one line for every Server to which the Cache Manager is connected. For each Server, it displays
In oscmstat output, the second word of an ObjectStore file name is the name of the host that created and owns or owned the file. For example, for files named objectstore_doolittle_commseg_8 and objectstore_doolittle_cache_3, the host name is doolittle.
The command oscmstat doolittle displays the files that the Cache Manager daemon on host doolittle currently knows about. If your file is not on the list, it is no longer in use, and can be removed with oscmrf.
If oscmstat reports that there is no Cache Manager running, it is safe to delete the file, as long as you are certain that oscmstat did not fail due to temporary network failure or something similar.
kellen% oscmstat ObjectStore Release 5.0 Cache Manager, Version 9.0.1 Process ID 6444. Executable is path.exe.2 Host "kellen". Started at Sat May 20 14:54:05 1995 Soft Allocation Limit 0, Hard Allocation Limit 0. 3
Allocated: free 80568320, used 5775360. 4 Server host: Client process ID: Status for this host: kellen 0 Initializing: constructor finished There is 1 client currently running on this host: Free files (cache): /tmp/ostore/objectstore_5_kellen_cache_1 (16777216) 5 /tmp/ostore/objectstore_5_kellen_cache_5 (8388608) /tmp/ostore/objectstore_5_kellen_cache_7 (8388608) /tmp/ostore/objectstore_5_kellen_cache_9 (8388608) /tmp/ostore/objectstore_5_kellen_cache_11 (8388608) /tmp/ostore/objectstore_5_kellen_cache_13 (8388608) /tmp/ostore/objectstore_5_kellen_cache_15 (8388608) /tmp/ostore/objectstore_5_kellen_cache_17 (8388608) /tmp/ostore/objectstore_5_kellen_cache_19 (8388608) In-use files (cache): /tmp/ostore/objectstore_5_kellen_cache_3 (8388608) Free files (commseg): /tmp/ostore/objectstore_5_kellen_commseg_18 (278528) /tmp/ostore/objectstore_5_kellen_commseg_16 (278528) /tmp/ostore/objectstore_5_kellen_commseg_14 (262144) /tmp/ostore/objectstore_5_kellen_commseg_12 (262144) /tmp/ostore/objectstore_5_kellen_commseg_10 (983040) /tmp/ostore/objectstore_5_kellen_commseg_8 (483328) /tmp/ostore/objectstore_5_kellen_commseg_6 (344064) /tmp/ostore/objectstore_5_kellen_commseg_4 (557056) /tmp/ostore/objectstore_5_kellen_commseg_2 (1622016) In-use files (commseg): /tmp/ostore/objectstore_5_kellen_commseg_20 (262144) Call Back Queue: Empty Notifications 6
Client PID | QueueSize | ReceivedFrom Server | ReceivedBy Client | Pending | Overflows | Notifier State |
---|---|---|---|---|---|---|
13149 | 100 | 1814 | 1796 | 0 | 18 |
|
13145 | 43 | 904 | 876 | 0 | 5 |
|
2 Operating system process ID of the Cache Manager process. The executable that you are running oscmstat from is identified by path.exe.
3 The allocation limit parameters are as described in the parameter file.
4 Total sizes of the used pool and the free pool.
5 One line for each Server connection to the Cache Manager. This information is sometimes useful in debugging.
Cache file names end in odd numbers and commseg file names end in even numbers. The cache file whose name ends in 1 and the commseg file whose name ends in 2 go together. Likewise, the cache file whose name ends in 3 and the commseg file whose name ends in 4 go together, and so on.
One line for each client (ObjectStore application process) currently running on this host. For each client it gives the operating system process ID and user ID, the name of the client (assuming the client has called objectstore::set_client_name()), an internal version number that also has nothing to do with ObjectStore release numbers, and a virtual address within the Cache Manager that is useful in debugging the Cache Manager.
6 For each client, the oscmstat output displays the following notification information:
oscompact {-dbs_to_compact pathname ... | -segments_to_compact pathname segment_number [pathname segment_number] ... }
[-db_references pathname ...]
[-segment_references pathname segment_number
[pathname segment_number] ... ]
[-compaction_threshold percent_of_deleted_space]
You can use the oscompact utility on both file databases and rawfs databases.
Database size
Compacting a file database does not decrease its size, and might increase it to a small degree. Compacting rawfs databases
The ObjectStore rawfs stores all databases in a single region, on either one or more host files or raw partitions. Any space in a rawfs that is freed by the compaction operation can be reused by any segment in any database stored in the rawfs. What the compactor does
The compactor compacts all C and C++ persistent data, including ObjectStore collections, indexes, and bound queries, and correctly relocates pointers and all forms of ObjectStore references to compacted data. ObjectStore os_reference_local references are relocated assuming they are relative to the database containing them. The compactor respects ObjectStore clusters, in that compaction ensures that objects allocated in a particular cluster remain in the cluster, although the cluster itself may move as a result of compaction. Caution
When you have cross-database references, be sure to compact the databases together or use protected references. Not doing so can destroy references. If you run the oscompact utility on, for example, databaseA, then os_references from databaseB to databaseA are no longer valid. Alternatively, if you use protected references from databaseB to databaseA, then compacting databaseA does not cause a problem. Backing up compacted databases
When you run the oscompact utility on a database, it has the potential to modify each segment in the database. When you back up a database after compacting it, the osbackup utility copies each modified segment; this might be the entire database. Consequently, you might want to compact databases just before you perform a full backup. However, as a safeguard against unexpected results, it is a good idea to back up databases just before you compact them. Restrictions
You must observe the following data restrictions when using the compactor:
err_schema_key _CT_invalid_schema_key, "<err-0025-0151> The schema is protected and the key provided did not match the one in the schema."When deploying an application, if your end users need to use the oscompact utility on protected schema databases, you must wrap the utility in an application. This application must use the API to provide the key before using the os_dbutil class to call the utility. End users need not know anything about the key. For information about wrapping your application around an ObjectStore utility, see the class os_dbutil in the ObjectStore C++ API Reference.
oscopy cannot be used to copy databases to file directories. It cannot copy segment-level permissions and it does not work with ObjectStore/Single. Instead, use the oscp utility.
oscopy source target
source | Specifies the rawfs or file databases to be copied. |
target | Specifies the rawfs directory to contain the copies. |
Unlike oscopy, you can use oscp to copy ObjectStore/Single databases and to copy databases to file directories. Note, however, that oscp can produce an inconsistent database if other clients are updating the database while oscp is running. In these cases, use the oscopy command.
oscp[-L
server_log]
source target
[
-i]
source_dir target_dir[
-Ri]
source ... targetsource | Specifies the rawfs databases to be copied. |
target | Specifies the rawfs directory to contain the copies. |
Using native copy commands sometimes produces a database
oscp /source/db1 /target/db2If you do this on a host named atlas, then the full pathname of the copy is atlas:/target/db2, which is a Server-relative pathname. A Server-relative pathname is the operating system pathname as opposed to an ObjectStore rawfs pathname.
oscp /source/db1 /target/db2 oscp atlas:/source/db1 /target/db2The first command line is the same as the simple copy example above, but the result is different from the previous example. ObjectStore interprets /source/db1 as mars::/source/db1. The full pathname of the copy is mars::/source/db1.
In the second command, ObjectStore interprets atlas:/source/db1 as mars::atlas:/source/db1 and then as mars::/source/db1. This is the default interpretation when OS_DIRMAN_USE_SERVER_PREFIX is not set.
oscp mars::atlas:/source/db1 /target/db2ObjectStore interprets mars::atlas:/source/db1 as atlas:/source/db1. The full pathname of the copy is atlas:/target/db2.
oscp atlas:/source/db1 /target/db2ObjectStore interprets atlas:/source/db1 in two steps.
osdf hostname
hostnameThe name of the host for which you want to display rawfs disk space information.
osdf elvis
Filesystem | kbytes | use | avail | capacity |
elvis | 95749 | 533 | 95215 | 0% |
osdump[
-pseudo] [
-emit]
pathname...
The schema for the dumped databases is stored in a remote schema database associated with the dump.
Default vs. Customized Dump and Load
You can use the default dump and load processes, or customize the dump and load of particular types of objects. Customization is appropriate for certain location-dependent structures, such as hash tables. To determine when to customize, see When is Customization Required? in this section. To learn how to customize, see Dump/Load Facility in the ObjectStore C++ Advanced API User Guide.
Databases with unions, pointers-to-members or multidimensional arrays cannot be dumped by this utility.
Generated ASCII Files
When invoked without -emit, osdump generates the following files in the current directory:
Generated Source and Makefiles
If osdump is invoked with -emit, it generates the following files in the current directory:
To build the loader from these files, use one of the generated makefiles. On UNIX, use the make utility and the osdump-generated makefile makefile.unx. On Windows, use nmake and the osdump-generated makefile makefile.w32.
Roughly speaking, two databases are equivalent if every object in one database has a corresponding, equivalent object in the other database, where two objects are equivalent if
Two objects, o1 and o2, are equivalent (according to map()) if and only if all of the following hold:
A dumped object and its equivalent loaded object do not necessarily have the same location, that is, the same offsets in their segment. Among the implications of this are the following:
The default dumper and loader also take into account the second implication for ObjectStore collections with hash-table representations. Since a dumped collection element hashes to a different value than the corresponding loaded element, their hash-table slots are different. So the facility does not simply dump and load the array of slots based on fundamental values (which would result in using the same slot for the dumped and loaded objects).
Instead, it dumps the collection in terms of sequences of high-level API operations (that is, string representations of create and insert arguments) that the loader can use to recreate the collection with the appropriate membership.
The default dumper and loader do not take into account the second implication for non-ObjectStore classes. If you have your own classes that use hash-table representations, you must customize their dumping and loading. Any other location-dependent details of data structures (such as encoded offsets) should also be dealt with through customization.
See Dump/Load Facility in the ObjectStore C++ Advanced API User Guide.
For each dumped database, filename.db, filename.dmp has the format shown for database, below.
database_table ::= databasesEach object is emitted as a single line of text.[
number_databases]
{ database_entry[
database_entry]*
} number_databases ::=the integer number of dumped databases
database_entry ::= < pathname database_size number_segments odi_release architecture (date) > database ::= database [database_index] pathname roots segments pathname ::=the pathname of the database being dumped
database_size ::=the size of the database in an integral number of bytes
number_segments ::=the integral number of segments contained in the database
odi_release ::=the ObjectStore release information
architecture ::=the host architecture set for the database
date ::=the date the database was last modified
database_index ::=the index of this database within the list of databases being
dumped (0-based)
roots ::= roots [ number_roots ] { root[
, root]*
} root ::= name ( Type ) id segments ::= segments[
segment]*
segment ::= segment segment_number [segment_size] (pathname) data segment_number ::=integral segment number of this segment within its database
data ::=(
objects|
cluster)*
cluster ::= cluster [cluster_size] { objects } objects ::= object*
object ::= id ( type ) value id ::= <database_index,segment_number,offset> offset ::=integral value denoting the byte offset of an object
within its segment
type ::= integral|
real|
pointer|
reference|
array|
class value ::= character|
integral|
floating_point|
pointer_value|
reference|
collection|
string|
array_elements|
class_members integral ::= char|
signed char|
unsigned char|
signed short|
unsigned short|
int|
unsigned int|
signed long|
unsigned long real ::= float|
double pointer ::= type*
reference ::= type& array ::= array type [ size ] class ::=(
class|
struct|
union)
name character ::='c' where c is any printable ascii character
integral ::=any non-floating point decimal number
floating_point ::=any floating point decimal number
pointer_value ::=any hex unsigned integral number
string ::="s" where s is any sequence of printable ascii characters
with '"' escaped as "\"" and '\' escaped as "\\".
array_elements ::= { value[
, value]*
} class_members ::= { value[
, value]*
}
The special storage types cluster, segment, and database denote underlying ObjectStore storage structures. When a storage type appears, each object following is contained within that storage structure.
Other types denote C++ type constructs. Values appear as single values or as a bracketed comma separated list of values. Base class instances and other embedded subobjects are flattened into a class_members list.
ObjectStore references, collections, cursors , indexes, and queries are instances of Object Store types that require special treatment. The following special dump formats are used for them:
reference ::= id collection ::= simple_collection|
collection_with_representation_policy|
dummy_cursor|
cursor|
cursor_with_index|
cursor_with_range|
collection_index|
collection_element_load|
collection_query simple_collection::= [ behavior cardinality collection_type representation_enum ] behavior::= integral cardinality::= integral collection_type::= string representation_enum::= integral collection_with_representation_policy::= [ behavior cardinality collection_type representation_enum ] {[
representaion_enum]*
} dummy_cursor::= [ D ] cursor::= [ C collection_reference safe_flag ] collection_reference::= reference safe_flag::= integral cursor_with_index::= [ C collection_reference safe_flag { I path_name_length path_name element_name_length element_name } ] path_name_length::= integral path_name ::= string element_name_length::= integral element_name::= string cursor_with_range::= [ C collection_reference safe_flag { R range_type key_type low_condition low_value H high_condition high_value } ] range_type::= integral key_type::= integral low_condition::= boolean low_value::= integral high_condition::= boolean high_value::= integral boolean::= 0 | 1 collection_index::= [[
{ path_name_length path_name element_type_length element_type_name }]*
] collection_element_load::= [[
element_reference]*
] element_reference::= reference element_type_length::= integral element_type_name::= string collection_query::= [ element_type_length element_type < query_string_length query_string > < file_name_length file_name > < line_number > ] query_string_length::= integral query_string::= string file_name_length::= integral file_name::= string line_number::= integral
osexschm [-detail] pathname
-detail | Describes the structure of every class in detail. |
pathname | Specifies a file or rawfs database. |
err_schema_key _CT_invalid_schema_key, "<err-0025-0151> The schema is protected and the key provided did not match the one in the schema."
The command line utility for collecting garbage is osgc. Invoke this tool with the following format:
osgc [ options ] database_nameYou can specify the following options:
Performing Garbage Collection in a Database
The ObjectStore persistent garbage collector (GC) collects unreferenced objects and ObjectStore collections in an ObjectStore database.
The GC performs its job in two major phases. In the mark phase, the GC identifies the unreachable objects. In the sweep phase, the GC frees the storage used by the unreachable objects.
C++ Usage note
Normally, databases resulting from ObjectStore applications written in C++ will not require garbage collection since all storage allocation is handled explicitly. Restriction
Do not use osgc with applications that rely on cross-database pointers, The garbage collector operates on one database at a time. References to one database from another are not detected and objects pointed to by references from other databases are seen as unreferenced and therefore removed. osglob: Expanding File Names
The osglob utility performs ObjectStore file name expansion. Syntax
osglob wordlist
wordlistSpecifies strings, such as rawfs pathnames, containing wildcards that you want to expand into all matching pathnames.
oshostof pathname
pathnameSpecifies the database for which you want to display the host name.
Normal pathname syntax is supported, including the OS_DIRMAN_HOST compatibility feature.
When you specify a pathname that is a symbolic link oshostof displays the host of the database that the link points to.
When you specify the pathname of a Server-remote database the oshostof utility returns the name of the host where the database resides.
ossvrchkpt `oshostof a/b/c'
On UNIX, use the make utility and the osdump-generated makefile makefile.unx. On Windows, use nmake and the osdump-generated makefile makefile.w32.
osload[
-cwd]
db_table.dmp pathname...
-cwd | Tells osload to recreate databases in the current working directory. |
If switch -cwd is not set, then the databases have the same pathnames (as stored in db_table.dmp). If files with the given paths already exist (for example, because the dumped databases are still in their original locations), osload aborts.
-cwd forces osload to ignore paths from db_table.dmp and create the databases in the current working directory.
osln pathname linkname
pathnameThe pathname of the rawfs directory or database that you want to point to.
linknameThe pathname of the rawfs directory or database that is the new link. It points to pathname.
To indicate hosts, specify pathnames in the form
host::/pathname
To access a particular database or directory in its rawfs, the Server can traverse as many as ten same-Server links. When the Server reaches the eleventh link, ObjectStore displays the error message err_too_many_links.
In a chain of links, a client can return to a Server that it contacted earlier in the chain. In this situation, the Server's count of links within its rawfs begins with one. It does not continue the count from where it left off during the previous connection. Each time a link sends the client to a Server, the Server can follow as many as ten links within its rawfs.
These limits allow ObjectStore to catch circular links. For example, A is a link to B, and B is either directly or indirectly a link to A.
See osrm: Removing Databases and Rawfs Links on page224.
Examples
In the following example, link_to_db in canard's rawfs points to real_db in web-foot's rawfs.
osln web-foot::/real_db canard::/link_to_dbIn the next example, link_to_db points to real_db and both databases are in the same rawfs.
osln web-foot::/real_db web-foot::/link_to_db
osls [-dlRsu] pathname ...
pathname ... | Specifies one or more rawfs or native file directories for which you want to list the contents. |
The osls utility ignores trailing and multiple slashes in pathnames. It accepts a combination of rawfs pathnames and file pathnames.
When you specify a local directory, you cannot specify a remote file-Server host in the pathname of the local directory. The osls utility passes the operation to a local native utility. If you specify a remote file-Server host name, ObjectStore informs you that you specified an illegal pathname.
This utility can perform wildcard processing using regular expression wildcards *, ?, {}, and [].
osmkdir [-p] [-m octal-mode] directory
osmv [-fi] p1 p2
osmv [-fi] p1... pn dir
osmv [-fi] p1 p2
-f | Forces execution. Errors are not reported. |
-i | Specifies interactive mode. ObjectStore prompts you to confirm for each specified database that you really want to move it. |
As shown in the Syntax section, there are three forms of the command line for the osmv utility.
In the first form, if p1 and p2 are rawfs databases or links, osmv moves (changes the name of) p1 to p2. If p2 already exists, the utility removes it and then moves p1 to p2. If p1 is a rawfs directory, then p2 must not already exist. osmv moves (changes the name of) the p1 directory to the p2 directory.
In the second form, osmv moves one or more databases, links, or directories into the last directory in the list. The utility maintains the original names of the moved entities. The directory into which you are moving items must already exist and you must have write permission for that directory.
In the third form, osmv moves (changes the name of) file database p1 to file database p2.
Native move commands
While you can use native move commands to move ObjectStore file databases, you forfeit the database consistency protection that osmv provides. If the Server crashes before propagating all changes to the database, then the Server cannot find the changes at recovery time and the database is corrupted. UNIX
When operating on a rawfs database, you must enclose the wildcard in quotation marks ("") or precede it with a back slash (\) to keep the shell from interpreting wildcards. API
Class: os_dbutil
Method: rename osprmgc: Trimming Persistent Relocation Maps
The osprmgc utility prevents PRM bloat. Syntax
osprmgc [-q] [-r] [-n N] [-t keyword] database-name
The PRM grows whenever you add a pointer that is not yet translated by an existing PRME. Outbound relocation adds the necessary entry. The issue is that although pointers come and go (and once they are gone, the corresponding PRME might no longer be needed), the PRMEs are not normally removed. The PRM does not normally shrink.
If you are using relocation optimization, unnecessary PRM expansion can occur, since the entire lot of translations is taken in the interest of performance. That is, when you use relocation optimization for the sake of better performance, the PRM size can increase dramatically.
The osprmgc command-line utility is a PRME garbage collector that shrinks the size of the PRM so that it translates only the pointers currently existing in the segment. To decide when an entry should be removed, the utility looks at every data page in the segment to ensure that the entry is no longer needed.
The benefits of running the osprmgc utility are that it
Additionally, an embedded form of the utility exists in an os_dbutil version. This is particularly useful for databases with discriminant unions. The format is as follows:
struct os_prmgc_options { os_boolean flag_quiet; // -q, default is false os_boolean flag_read_only; // -r, default is false os_boolean flag_one_segment; // -n, default is false os_unsigned_int32 one_segment_number; // the N in -n N os_prmgc_type prmgc_type; //-t default is remove_whole_ranges };
Both the command-line and embedded versions of the utility use a streaming fetch policy. The embedded version ensures that the policy is restored to its original state (if different) to minimize impact on the application.
The defaults are effective for the large majority of conditions, but for extreme cases, there are override mechanisms. The default behavior can be overridden by the following environment variables:
osprop [-f] server-log-name ...
-f | Instructs osprop to ignore errors. |
osprop performs a function similar to ossvrchkpt. The difference is that ossvrchkpt propagates what it can, immediately. osprop propagates everything, guaranteed, and deletes the log when done.
It is not usually necessary to run this utility because an ObjectStore/Single application that terminates normally always conducts propagation and removes the log.
After osprop successfully propagates data in a log it removes the log. Running osprop twice on the same Server log is permissible.
Iteratively propagates committed data in the specified log files to the actual databases. Note that this is only meaningful if osprop is executed in an environment where the ObjectStore/Single version of libos is used.
osprop -f log3Propagates committed data in the specified log file if the file exists and is a valid log. Otherwise, the file is ignored.
osrecovr [options] [-f backup/log-file...] [pathname_translation...]
The osrecovr utility can restore backups as well as recover data from archive logs, both in the same invocation.
When you run the osrestore or osrecovr utility, the operation is transaction-protected. This means that if the operation fails, ObjectStore rolls databases back to the state they were in before the operation started.
ObjectStore applications cannot access databases that are being restored until the entire restoration process has finished.
Specify a pathname_translation when you want to restore
For example, if you specify -c when you initiate osrecovr, ObjectStore recovers each snapshot in its own transaction. If the operation fails because of media failure while applying the last snapshot, ObjectStore rolls the databases back to the state they were in as of the last successfully applied snapshot.
However, suppose that each snapshot is 100 MB. This requires 100 MB of log space. If you ensure that the database does not exist when the recover operation starts, and if you apply all snapshots in a single transaction, then all recovered data bypasses the log and goes directly to the database. Now, if the operation fails, ObjectStore rolls all changes back, including the database creation.
The fundamental tradeoff is between the ability to roll back to a previous state, and the resources needed to log the changes so that rollback is possible. In cases where the size of the databases being recovered exceeds the size of the space available (or desirable) for logging, it is preferable
% osrecovr -f /vancouver1/archives/96011216.aaa -t
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... vancouver::/foo.db vancouver::/dbdir/bar.db vancouver::/dbdir/foo.db Closing volume #1 (/vancouver1/archives/96011216.aaa). %
% osrecovr -f /vancouver1/archives/96011216.aaa
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... Target time: Thu Jan 12 17:28:22 1996 Recovered to time Thu Jan 12 16:25:27 1996 Recovered to time Thu Jan 12 16:25:57 1996 Recovered to time Thu Jan 12 16:26:11 1996 Restoring 452 sectors to database "vancouver:/vancouver1/dbdir/foo.db" Recovered to time Thu Jan 12 16:26:41 1996 Recovered to time Thu Jan 12 16:27:13 1996 Recovered to time Thu Jan 12 16:27:43 1996 Recovered to time Thu Jan 12 16:28:14 1996 Closing volume #1 (/vancouver1/archives/96011216.aaa). %
% osrecovr -f /vancouver1/archives/96011216.aaa -r 16:25:27
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... Target time: Thu Jan 12 16:25:27 1996 Recovered to time Thu Jan 12 16:25:27 1996 Closing volume #1 (/vancouver1/archives/96011216.aaa).
% cat ./archive_list
/vancouver1/archives/96011216.aaa /vancouver1/archives/96011216.aab /vancouver1/archives/96011216.aac
% osrecovr -t -F ./archive_list
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... vancouver::/foo.db vancouver::/dbdir/bar.db vancouver::/dbdir/foo.db Closing volume #1 (/vancouver1/archives/96011216.aaa).
% osrecovr -F ./archive_list
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... Target time: Thu Jan 12 17:27:01 1996 Recovered to time Thu Jan 12 16:25:27 1996 Recovered to time Thu Jan 12 16:25:57 1996 Recovered to time Thu Jan 12 16:26:11 1996 Restoring 452 sectors to database "vancouver:/vancouver1/dbdir/foo.db" Recovered to time Thu Jan 12 16:26:41 1996 Recovered to time Thu Jan 12 16:27:13 1996 Recovered to time Thu Jan 12 16:27:43 1996 Recovered to time Thu Jan 12 16:28:14 1996 Closing volume #1 (/vancouver1/archives/96011216.aaa). Auto switching to volume #2 (/vancouver1/archives/96011216.aab). Recovering from volume #2 (/vancouver1/archives/96011216.aab)... Recovered to time Thu Jan 12 16:28:21 1996 Recovered to time Thu Jan 12 16:28:35 1996 Recovered to time Thu Jan 12 16:28:37 1996 Recovered to time Thu Jan 12 16:28:38 1996 Recovered to time Thu Jan 12 16:28:40 1996 Recovered to time Thu Jan 12 16:28:41 1996 Recovered to time Thu Jan 12 16:28:49 1996 Recovered to time Thu Jan 12 16:28:55 1996 Recovered to time Thu Jan 12 16:29:01 1996 Recovered to time Thu Jan 12 16:29:06 1996 Recovered to time Thu Jan 12 16:29:12 1996 Recovered to time Thu Jan 12 16:29:17 1996 Recovered to time Thu Jan 12 16:29:23 1996 Recovered to time Thu Jan 12 16:29:28 1996 Recovered to time Thu Jan 12 16:29:34 1996 Recovered to time Thu Jan 12 16:29:39 1996 Recovered to time Thu Jan 12 16:29:43 1996 Recovered to time Thu Jan 12 16:29:44 1996 Recovered to time Thu Jan 12 16:29:49 1996 Recovered to time Thu Jan 12 16:29:55 1996 Recovered to time Thu Jan 12 16:30:01 1996 Closing volume #2 (/vancouver1/archives/96011216.aab). Auto switching to volume #3 (/vancouver1/archives/96011216.aac). Recovering from volume #3 (/vancouver1/archives/96011216.aac)... Recovered to time Thu Jan 12 16:31:04 1996 Recovered to time Thu Jan 12 16:31:06 1996 Closing volume #3 (/vancouver1/archives/96011216.aac). %
% osrecovr -F ./archive_list -D 1/12/96 -r 16:27:43
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... Target time: Thu Jan 12 16:27:43 1996 Recovered to time Thu Jan 12 16:25:27 1996 Recovered to time Thu Jan 12 16:25:57 1996 Recovered to time Thu Jan 12 16:26:11 1996 Restoring 452 sectors to database "vancouver:/vancouver1/dbdir/foo.db"Recovered to time Thu Jan 12 16:26:41 1996 Recovered to time Thu Jan 12 16:27:13 1996 Recovered to time Thu Jan 12 16:27:43 1996 Closing volume #1 (/vancouver1/archives/96011216.aaa). %
% osrecovr -F ./archive_list -r 16:27:43
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... Target time: Thu Jan 12 16:27:43 1996 Recovered to time Thu Jan 12 16:25:27 1996 Recovered to time Thu Jan 12 16:25:57 1996 Recovered to time Thu Jan 12 16:26:11 1996 Restoring 452 sectors to database "vancouver:/vancouver1/dbdir/foo.db" Recovered to time Thu Jan 12 16:26:41 1996 Recovered to time Thu Jan 12 16:27:13 1996 Recovered to time Thu Jan 12 16:27:43 1996 Closing volume #1 (/vancouver1/archives/96011216.aaa). %
% osrecovr -F ./archive_list -r 16:27:43 vancouver::/foo.db \
vancouver::/bar.db
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... Target time: Thu Jan 12 16:27:43 1996 Recovered to time Thu Jan 12 16:25:27 1996 Recovered to time Thu Jan 12 16:25:57 1996 Recovered to time Thu Jan 12 16:26:11 1996 Recovered to time Thu Jan 12 16:26:41 1996 Recovered to time Thu Jan 12 16:27:13 1996 Recovered to time Thu Jan 12 16:27:43 1996 Closing volume #1 (/vancouver1/archives/96011216.aaa).
% osls vancouver::/
bar.db dbdir/ foo.db %
% cat ./archive_list
/vancouver1/archives/96011216.aaa /vancouver1/archives/96011216.aab /vancouver1/archives/96011216.aac
% osrecovr -t -F ./archive_list
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... vancouver::/foo.db vancouver::/dbdir/bar.db vancouver::/dbdir/foo.db Closing volume #1 (/vancouver1/archives/96011216.aaa). %
% osrecovr -f /vancouver1/archives/96011216.aaa -r 16:25:27 \
vancouver::/asdla.db vancouver::/as.db
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... Closing volume #1 (/vancouver1/archives/96011216.aaa). Recover failed: Database vancouver::/asdla.db does not exist in this backup image %
% osrecovr -F ./archive_list -D 1/11
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... Target time: Wed Jan 11 17:29:08 1996 Closing volume #1 (/vancouver1/archives/96011216.aaa). %
% osrecovr -F ./archive_list -D 1/11/95
Recovering from volume #1 (/vancouver1/archives/96011216.aaa)... Target time: Tue Jan 11 17:29:51 1995 Closing volume #1 (/vancouver1/archives/96011216.aaa). %
osreplic[-r] [-v] [-x] [-i interval] [-p] [-B size] [-I import_file] -a archive_ rec_file src_path1 dest_path1 [src_path2 dest_path2 ...]
ObjectStore Release 4 and later databases and rawfs directories can be replicated, as well as ObjectStore Release 4 and later file databases. Native file system directories cannot be replicated.
When you start the replicator, you specify a set of sources and destinations for replicated databases on the command line or with a separate input file using the -I (I) option. The master/replica pair is specified by pathname with the src_path and dest_path arguments, including the target host if needed. The list of databases cannot be changed once the replicator is started.
src_path and dest_path can be a directory path or a database name. You can also use UNC pathnames (on Windows platforms), Server relative pathnames, or local pathnames. However, you cannot use UNC pathnames as destinations.
You must also specify an archive_record_file with the -a option. The osreplic utility uses this information to determine which segments within a database have been modified since the last replication. This file is identical to the archive record file for osarchiv.
At specified intervals, the replicator takes a snapshot of the databases and sends the changed data to the target host so the data is applied to the replica. All committed user data is replicated.
Database ACLs (Access Control Lists, including owner, group, mode) can also be copied for rawfs databases. However, neither rawfs directory ACLs nor segment-level permissions are copied. Additionally, no file database ACLs are copied.
Operations such as osrm are not propagated to the replica.
osrestore [options] -f backup-file [-f backup-file]... [pathname_ translation]...
Specify a pathname_translation when you want to restore
Scanning the list from right to left, find the lowest incremental backup level greater than 0, in this case, the level 2 backup made on Thursday. To restore databases to their state as of the backup on Friday, apply the level 0 backup and the incremental backups made at levels 2 and 4, in that order.
osrestore -f backup.img foo::/db foo::/restore.db
In the first interaction, the command line specifies the -t option, which instructs the osrestore utility to list the databases in the specified backup image. Nothing is actually restored. The only database in the backup image is mckinley:e:\r4tsd_data\arch.0. This is a Windows NT database, and the following example shows that the osrestore utility on a UNIX system translates it to mckinley:e:/r4tsd_data/arch.0. The utility automatically translates back slashes (\) to slashes (/).
% osrestore -f /tmp/my.img -t
Recovering from volume #1 (/tmp/my.img)... mckinley:e:/r4tsd_data/arch.0 Closing volume #1 (/tmp/my.img). %In the second interaction, the command line specifies the pathname translation mckinley:e:/r4tsd_data/ /recovery. This instructs the osrestore utility to copy all files in the backup image in the mckinley:e:/r4tsd_data/ directory to the /recovery directory on the local machine. In this example, this is only arch.0.
% osrestore -f /tmp/my.img mckinley:e:/r4tsd_data/ /recovery
Recovering from volume #1 (/tmp/my.img)... Restoring 3175 sectors to database "vancouver:/recovery/arch.0" Recovered to time Fri Mar 3 14:07:24 1995 Do you wish to restore from any additional incremental backups? (yes/no):
no
Closing volume #1 (/tmp/my.img). %
The examples are UNIX examples; however, they would be the same on any platform except for the file name format.
% osrestore -t -f /backup.img
::eudyp:/test/ ::eudyp:/test: data1.odb data2.odb data3.odb ::cleopat:/results/ ::cleopat:/results: r1.odb r2.odb r3.odbThis indicates that the backup image contains six file databases. Three are in the /test directory; they were backed up on host eudyp. Three are in the /results directory; they were backed up on host cleopat.
% osrestore -f backup.img eudyp:/ kellen:/ cleopat:/ eudyp:/
restoring "::eudyp:/test/data1.odb" to "::kellen:/test/data1.odb"
restoring "::eudyp:/test/data2.odb" to "::kellen:/test/data2.odb"
restoring "::eudyp:/test/data3.odb" to "::kellen:/test/data3.odb"
restoring "::cleopat:/results/r1.odb" to "::eudyp:/results/r1.odb"
restoring "::cleopat:/results/r2.odb" to "::eudyp:/results/r2.odb"
restoring "::cleopat:/results/r3.odb" to "::eudyp:/results/r3.odb"
% osrestore -f backup.img eudyp:/test kellen:/test-copy
restoring "::eudyp:/test/data1.odb" to "::kellen:/test-copy/data1.odb"
restoring "::eudyp:/test/data2.odb" to "::kellen:/test-copy/data2.odb"
restoring "::eudyp:/test/data3.odb" to "::kellen:/test-copy/data3.odb"
% osrestore -f backup.img eudyp:/test/data1.odb eudyp:/tmp
restoring "::eudyp:/test/data1.odb" to "::eudyp:/tmp/data1.odb"
% osrestore -f backup.img eudyp:/test/data1.odb cleopat:/example \ eudyp:/test eudyp:/test
restoring "::eudyp:/test/data1.odb" to "::cleopat:/example/data1.odb"In this example, the order of the pathname translations is important. Specify specific pathnames before you specify directories that include those pathnames.
restoring "::eudyp:/test/data2.odb" to "::eudyp:/test/data2.odb"
restoring "::eudyp:/test/data3.odb" to "::eudyp:/test/data3.odb"
% osrestore -f backup.img
restoring "::eudyp:/test/data1.odb" to "::eudyp:/test/data1.odb" restoring "::eudyp:/test/data2.odb" to "::eudyp:/test/data2.odb" restoring "::eudyp:/test/data3.odb" to "::eudyp:/test/data3.odb" restoring "::cleopat:/results/r1.odb" to "::cleopat:/results/r1.odb" restoring "::cleopat:/results/r2.odb" to "::cleopat:/results/r2.odb" restoring "::cleopat:/results/r3.odb" to "::cleopat:/results/r3.odb"
% osrestore -f back.img eudyp:/test /examples cleopat:/results /examples
restoring "::eudyp:/test/data1.odb" to "::twinkie:/examples/data1.odb" restoring "::eudyp:/test/data2.odb" to "::twinkie:/examples/data2.odb" restoring "::eudyp:/test/data3.odb" to "::twinkie:/examples/data3.odb" restoring "::cleopat:/results/r1.odb" to "::twinkie:/examples/r1.odb" restoring "::cleopat:/results/r2.odb" to "::twinkie:/examples/r2.odb" restoring "::cleopat:/results/r3.odb" to "::twinkie:/examples/r3.odb"
osrm [-f][i][r] pathname...
If you specify more than one database to be removed and for some reason ObjectStore cannot remove at least one of the databases, then ObjectStore does not remove any of the databases.
If a database is open when you remove it with the osrm utility, ObjectStore does not actually remove it until it is closed. Transactions can update the removed database until the database is closed.
The osrm utility can perform wildcard processing using regular expression wildcards *, ?, {}, and [].
For file databases, the osrm utility calls the native remove utility.
osrmdir directory
directorySpecifies the pathname of the directory that you want to remove from the rawfs.
You can also use osrmdir to remove a local directory. When you specify a local directory, you cannot specify a remote file-Server host in the pathname of the local directory. The osrmdir utility passes the operation to a local native utility. If you specify a remote file-Server host name, ObjectStore informs you that you specified an illegal pathname.
osscheq [-quiet] db1 db2
class C { int del ; int mod ; } ;Database test2 defines C as follows:
class C { int add ; char* mod ; } ;Invoke the osscheq utility as follows:
osscheq test1 test2The result is the following output:
The following class definitions in test1 and test2 were inconsistent: C ( C.del was deleted, the type of C.mod changed (from int to char*), and C.add was added)
Schema checking done by the schema generator is a stricter form of checking than that used to validate an application against a database. The latter form of checking is the minimal checking required to ensure that the application and the database use the same layout for all shared classes.
osserver options
API
None. ossetasp: Patching Executable with Application Schema Pathname
The ossetasp utility patches an executable so that it looks for its application schema in a database that you specify.
Syntax
ossetasp -p executable
ossetasp executable database
When you move or copy an ObjectStore application to a machine that is not running a Server, leave the application schema database on the Server host. Normally, the application schema database must always be local to the Server.
After you copy or move an application to another machine, you must patch the executable so that it can find the application schema database. Run the ossetasp utility with the absolute pathname of the application schema database. Be sure to specify the name of the Server host.
A locator file allows a database and its application schema to be on a machine other than the Server host. See Chapter 5, Using Locator Files to Set Up Server-Remote Databases.
Windows
On Windows systems, you can perform the ossetasp utility on any EXE or DLL that contains schema (that is, that has a schema object file produced by ossg linked into it). Restrictions
This utility is available on all platforms except OS/2. On OS/2, as well as on all other platforms, you can use the API. API
Class: objectstore
Methods: get_application_schema_pathname
and set_application_schema_pathname ossetrsp: Setting a Remote Schema Pathname
The ossetrsp utility specifies a new pathname for the schema associated with a particular database. Syntax
ossetrsp {-p | schema_db_path} db_path
If you copy the schema database with an operating system command or an ObjectStore utility, you can execute ossetrsp or use os_database::set_schema_database() to inform ObjectStore of the schema database's new pathname.
You cannot associate an entirely new schema database with the main database. You can only change the pathname of the original schema database by moving or copying the original schema database.
Use osbackup first
Running the ossevol utility changes the physical structure of your database. Consequently, you should back up your database before you run the ossevol utility. Syntax
ossevol workdb schemadb evolvedb ... [keyword-options]
err_schema_key _CT_invalid_schema_key, "<err-0025-0151> The schema is protected and the key provided did not match the one in the schema."When deploying an application, if your end users need to use the ossevol utility on protected schema databases, you must wrap the utility in an application. This application must use the API to provide the key before using the os_dbutil class to call the utility. End users need not know anything about the key. For information about wrapping your application around an ObjectStore utility, see the class os_dbutil in the ObjectStore C++ API Reference.
ossize [options] pathname ]
pathname | Specifies the file or rawfs database whose size you want to display. |
The ossize utility displays the comment for each segment that has a comment with a nonzero length. See os_segment::set_comment() in the ObjectStore C++ API Reference.
ossize <database path> Name: /h/kellen/ctdb_1 Size: 74752 bytes (70 Kbytes) Created: Fri Aug 23 14:59:40 1996 Created by: a SPARC-architecture CPU with 4K pages with Sun C++ 4.x PRMs are in enhanced format ... ossize <database path> Name: /h/kellen/ctdb_1 Size: 74752 bytes (70 Kbytes) Created: Fri Aug 23 15:00:53 1996 Created by: a SPARC-architecture CPU with 4K pages with Sun C++ 4.x PRMs are in standard format
err_schema_key _CT_invalid_schema_key, "<err-0025-0151> The schema is protected and the key provided did not match the one in the schema."
> ossize lame::/db1
Name: lame::/db1 Size: 44544 bytes (42 Kbytes) Created: Thu Jan 26 17:19:11 1996 Created by: a SPARC-architecture CPU with 4K pages There is 1 root: Name: head Type: note There are no external database pointers. There are no external references. The schema is local. There is 1 segment: Data segment 2: Size: 512 bytes (1 Kbytes) >
Info segment usage:
Fixed Offset | Cluster Size |
---|---|
0 | 4096 |
0x1000 | 8192 |
0x3000 | 16384 |
0x7000 | 32768 |
0xf000 | 4096 |
0x10000 | 65536 |
0x20000 | 8192 |
0x22000 | 16384 |
0x26000 | 32768 |
0x30000 | 65536 |
API
Class: os_dbutil
Method: ossize ossvrchkpt: Moving Data Out of the Server Transaction Log
The ossvrchkpt utility performs a checkpoint for a specified Server host. It ensures that all data is copied from the transaction log of the Server host to the database or databases that were changed. Syntax
ossvrchkpt hostname
ossvrchk
hostnameSpecifies the name of the host of the Server whose log you want to propagate.
0 | Success. |
1 | There is an error when passing the command to the Server. |
2 | The Server is unable to complete the checkpoint. |
When needed
Run this utility when you want to
ossvrchkpt hostessData in the Server transaction log on the host called hostess is copied to the databases that were modified.
ossvrclntkill hostname -h client-host | -p client-pid | -n client-name(The second form is supported for compatibility with earlier releases.)
[ -a ] ossvrclntkill hostname client-pid
You can use ossvrstat to determine the client-hostname and client-pid.
If the Server's authentication is set to something other than NONE (authentication is SYS by default), the following rule applies:
Any user can disconnect clients that user owns. If the -a option is used (kill all clients matching the given search pattern), the user must own all matching processes, otherwise authentication fails and no clients are killed.
Otherwise, no authentication is required.
ossvrclntkill hostess -h cupcake -aThis disconnects all clients on cupcake that are attached to the Server on hostess.
ossvrdebug hostname n
hostname | Server host to be debugged. |
---|---|
n | Number that specifies the trace level of the Server. |
ossvrdebug kellen 5Sets the Server debug trace level of the server kellen to 5.
ossvrmtr hostname
hostnameSpecifies the name of the host of the Server for which you want to display information.
API
Class: os_dbutil
Method: svr_stat ossvrping: Determining If a Server Is Running
The ossvrping utility reports whether or not a Server is running on the specified host. Syntax
ossvrping [ -v ] [ hostname ]
hostname | Specifies the name of the host on which you want to know whether or not a Server is running. |
-v | Indicates that you want more information when a Server is not running on the specified host. |
If you do not specify a host, the default is the local host.
ossvrping elvis
The ObjectStore Server on host elvis is alive.
ossvrshtd [-f] hostname
If any clients are connected to the Server when you shut it down, the next time those clients try to contact the Server they receive the message err_broken_server_connection. The client can call os_server::reconnect to try to reconnect.
If the Server's authentication is set to something other than NONE, ossvrshtd must be run as root.
ossvrshtd hostess
Are you sure that you wish to shut down the server on host hostess (yes/no) [no]: yes
ossvrstat hostname [options]
ObjectStore identifies each client by host name and then displays the program name (if there is one) with the process ID on the client host. Program names are set with objectstore::set_client_name. When there is no program name, ObjectStore displays default_client_name.
ossvrstat kellen
ObjectStore Release 5.0 Database Server Client/Server protocol version 1.8 Compiled by staff at 97-02-18 17:40:42 in /h/kellen/1/r5core/obj/sun4/opt/nserver Allow Shared Communications: Yes Authentication Required: SYS, DES, Name Password Cache Manager Ping Time: 300 Cache Manager Ping Time In Transaction: 300 DB Expiration Time: 5 seconds Deadlock Victim: Work Direct To Segment Threshold: 128 sectors (64KB) Log File: /kellen/log_file_DB Current Log Size 43024 sectors (21512KB) Log Data Segment Growth Increment: 2048 sectors (1MB) Log Data Segment Initial Size: 2048 sectors (1MB) Log Record Segment Buffer Size: 1024 sectors (512KB) Log Record Segment Growth Increment: 512 sectors (256KB) Log Record Segment Initial Size: 1024 sectors (512KB) Max AIO Threads 3 Max Connect Memory Usage unlimited Max Data Propagation Per Propagate: 512 sectors (256KB) Max Data Propagation Threshold: 8192 sectors (4MB) Max Memory Usage unlimited Max Two Phase Delay 30 Message Buffer Size: 512 sectors (256KB) Message Buffers: 4 Notification Retry Time: 60 seconds Preferred Network Receive Buffer Size 16384 bytes Preferred Network Send Buffer Size 16384 bytes Propagation Sleep Time: 60 seconds Propagation Buffer Size: 8192 sectors (4MB) Server Machine Usage: User time: 58123.6 secs System time: 3151.1 secs Max. Res. Set Size: 6639 Page Reclaims: 1400444 Page Faults: 54510 Swaps: 0 Block Input Operations: 20339 Block Output Operations: 387732 Signals Received: 1 Voluntary Context Switches: 775502 Involuntary Context Switches: 645611 Server Meters: Total since server start up: Client Meters: 1314496 messages received 23575 callback messages sent 211960 callback sectors 94240 succeeded sectors 3192253 KB read 3691926 KB written 211351 commits 89572 readonly commits 19749 aborts 0 two phase transactions 0 lock timeouts 341 lock waits (average 7555 us) 74 deadlocks 0 message buffer waits 14896 notifies sent 14938 notifies received Log Meters: 219314 log records 1514 record segment switches 52115 flush data 225902 flush records 0 KB data 0 KB records 576954 KB propagated 201924 KB direct 28302 propagations Total over past 60 minute(s): Client Meters: 2135 messages received 0 callback messages sent 0 callback sectors 0 succeeded sectors 7416 KB read 2759 KB written 40 commits 20 readonly commits 91 aborts 0 two phase transactions 0 lock timeouts 0 lock waits 0 deadlocks 0 message buffer waits 1843 notifies sent 1772 notifies received Log Meters: 116 log records 10 record segment switches 14 flush data 187 flush records 0 KB data 0 KB records 1799 KB propagated 787 KB direct 102 propagations Total over past 10 minute(s): Client Meters: 1056 messages received 0 callback messages sent 0 callback sectors 0 succeeded sectors 3708 KB read 1383 KB written 20 commits 10 readonly commits 44 aborts 0 two phase transactions 0 lock timeouts 0 lock waits 0 deadlocks 0 message buffer waits 1843 notifies sent 1772 notifies received Log Meters: 57 log records 5 record segment switches 7 flush data 73 flush records 0 KB data 0 KB records 901 KB propagated 395 KB direct 51 propagations Total over past 1 minute(s): Client Meters: 0 messages received 0 callback messages sent 0 callback sectors 0 succeeded sectors 0 KB read 0 KB written 0 commits 0 readonly commits 0 aborts 0 two phase transactions 0 lock timeouts 0 lock waits 0 deadlocks 0 message buffer waits 0 notifies sent 0 notifies received Log Meters: 0 log records 0 record segment switches 0 flush data 1 flush records 0 KB data 0 KB records 0 KB propagated 0 KB direct 0 propagations No active clients
On non-UNIX platforms, the Server fills in zeros for these output categories, which indicates that the measurement is not available on that platform.
Client connections awaiting a client message: Client #3 (atiq/26896/(unknown)) priority=0x8000, duration=4652 seconds, work=0, no transaction on server Client #5 (nanook/1346/(unknown)) priority=0x8000, duration=2 seconds, work=2, transaction in progress Client #7 (yukiko/14916/(unknown)) priority=0x8000, duration=136 seconds, work=0, no transaction on serverThis is a list of the clients that have initiated a connection to the Server. In the previous example, the Server is waiting for the next message from each client. Next to the client number, the information in parentheses indicates the
(unknown)
.
API
Class: os_dbutil
Method: svr_stat ostest: Testing a Pathname for Specified Conditions
The ostest utility indicates whether or not a pathname meets a specified condition. Syntax
ostest [option] pathname
pathnameThe pathname of a database or directory.
0 | When the specified condition is true |
Nonzero | When the specified condition is false |
When you specify a file database, you cannot specify a remote file-server host in the pathname of the file database. The ostest utility passes the operation to a local native utility. If you specify a remote file-server host name, ObjectStore informs you that you specified an illegal pathname.
API
Class: os_dbutil
Method: stat osupgprm: Upgrading PRM Formats
Upgrades a database's address-space format. Syntax
osupgprm database-name ...
The choice of immediate as opposed to deferred assignment for a segment is made every time the segment is put in use for the first time in a transaction. The type of assignment must remain constant for the duration of a transaction.
osverifydb [options] pathname
pathnameSpecifies a file or rawfs database whose pointers you want to verify.
The osverifydb utility runs integrity checks to ensure that the ObjectStore collections in the database are valid. You can suppress verification of collections by specifying the -nocoll option when you run osverifydb.
You would not normally include the -ignore_references option unless you had already tried to verify the database and verification failed because the utility ran out of address space.
err_schema_key _CT_invalid_schema_key, "<err-0025-0151> The schema is protected and the key provided did not match the one in the schema."
osverifydb -all -illegal_pointer_action null vtest1.dbThe null argument causes osverifydb to null all illegal pointers.
osverifydb -illegal_pointer_action ask vtest2.dbThe ask argument permits selective repair; that is, it causes osverifydb to prompt for an alternative value for the illegal pointer in the format used by os_reference::load(). Here is some sample output from osverifydb in such a circumstance:
The object at 0x6020000 (</daffy/home/daffy/daffy0/dbs/verifydb1 | 2 | 0>)(type "c1"), contains a pointer at 0x6020000(c1.m1) with the illegalYou can then press Enter, in which case the illegal pointer is set to null, or you can enter a valid reference string such as /daffy/home/daffy/daffy0/dbs/verifydb1 | 2 | 64 identifying an object at offset 64 in segment 2, in the database verifydb1. The new pointer value, if valid, is used as the replacement value for the pointer in the database.
value 0x1. It points to nonpersistent storage. Enter replacement pointer value in reference dump format (<database path | segment number | hex offset>:
The following output is the result of running osverifydb on a database that contains an object of type c1, with the bad pointers identified by the error messages.
beethoven%
osverifydb /camper/van
Verifying database beethoven::/camper/van Verifying segment 2 Size: 8192 bytes Pointer to nonpersistent storage. Pointer Location: 0x6010000. Contents: 0x1. Lvalue expression for pointer: c1::m1 Pointer type mismatch; the declared type is incompatible with the actual type of the object Pointer Location: 0x6010004. Contents: 0x601003c. Declared type c2*. Actual type: c3*. Lvalue expression for pointer: c1::m2 Pointer to deleted storage Pointer Location: 0x6010008. Contents: 0x6010040. Declared type c2*. Lvalue expression for pointer: c1::m3 Pointer type mismatch; the declared type is incompatible with the actual type of the object Pointer Location: 0x601000c. Contents: 0x6010028. Declared type c2*. Actual type: c1*. Lvalue expression for pointer: c1::m4 Lvalue expression for pointed to object: c1::ma[5] Pointer type mismatch; the declared type is incompatible with the actual type of the object Pointer Location: 0x6010010. Contents: 0x6010044. Declared type c2*. Actual type: char*. Lvalue expression for pointer: c1::m5 Lvalue expression for pointed to object: char[0] Pointer to nonpersistent storage. Pointer Location: 0x6010068. Contents: 0x1. Lvalue expression for pointer: void*[5] Verified 5 objects in segment Verified 5 objects in database beethoven%
osversion
elvis%
osversion
ObjectStore Release 5.1 for SPARC Solaris 2
[D\:]
osversion
ObjectStore Release 5.1 for Windows NT Systems
[D\:]
osversion
ObjectStore Release 5.1 for OS/2
Also see the file include/ostore/osreleas.hh.
Updated: 03/26/98 20:38:55