osdump[options] [-emit]pathname...
The schema for the dumped databases is stored in a remote schema database associated with the dump.
Default compared to 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. Databases with unions, pointers-to-members, or address-dependent data of types that are not C++ pointers or ObjectStore references or soft pointers cannot be dumped by this utility and need customized dump and load applications.
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 produces the following files in the current directory:
To build the loader from these files, use the makefile produced by osdump. On UNIX, use the make utility and makefile.unx. On Windows, use nmake and makefile.w32.
In general, two databases are equivalent if every object in one database has a corresponding, equivalent object in the other database. Two objects are equivalent if
Two objects, o1 and o2, are equivalent (according to map()) if and only if all the following are true:
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 types including collections with hash-table representations. Because a dumped collection element hashes to a different value than the corresponding loaded element does, their hash-table slots are different. The facility, then, 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) also should be dealt with through customization.
See Chapter 7, Dump/Load Facility, in the Advanced C++ API User Guide.
Performance
To enhance efficiency during a dump, database traversal is performed in address order whenever possible. To enhance efficiency during loads, loaders are generated by the dumper and tailored to the schema involved. This allows the elimination of most run-time schema lookups during the load. Converting a Database
This section describes how to use osdump and osload to update an ObjectStore database with a Release 5.1 format to one with a Release 6.0 format. Briefly, the steps are as follows.
ossg -asof schema.obj -asdb schema.adb /nologo /GX /MD \On UNIX, generate the schema as follows:
/DWIN32 schema.cc
ossg -assf dschema.cc -asdb schema.adb \
-I$OS_ROOTDIR/include schema.cc
cl /Fedummy.exe /nologo /GX /MD /DWIN32 dummy.cc \On UNIX:
schema.obj %OS_ROOTDIR\lib\ostore.lib
CC -o dummy dummy.cc dschema.cc -los -loscol -losthr
dummy my_db.db
osdump -emit my_db.db
osload db_table.dmp filename.dmpSee osload: Loading Databases for more information on osload.
Default Dumper ASCII Format
Each db_table.dmp file has the format for database_table described in the following section.
database_table ::=
databases [ 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 segments roots finalization
fixups
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_size] { objects }
objects ::=
object*
object ::=
id ( type ) value
id ::=
<database_index,segment_number,cluster_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 or escaped hex value
integral ::=
any non-floating-point decimal number
floating_point ::=
any floating-point decimal number
pointer_value ::=
id
string ::=
"s" where s is any sequence of printable ascii characters or
escaped hex value with '"' escaped as "\"" and '\' escaped as "\\".
array_elements ::=
{ value [ , value ]* }
class_members ::=
{ value [ , value ]* }
Each object is emitted as a single line of text. 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 or soft pointers, 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 | 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
dummy_cursor::=
[ D ]
cursor::=
[ C options ]
collection_reference::=
reference
safe_flag::=
integral
cursor_with_index::=
[ C options
{ 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
Updated: 03/11/99 11:19:07