ObjectStore Management

Chapter 7

Managing ObjectStore on UNIX

This chapter provides information about managing ObjectStore on UNIX systems. For complete information, you should consult the first six chapters in this book along with this chapter.

The topics discussed in this chapter include

Database and Executable Pathnames

You specify a file database with an operating system pathname. For example:

os_database::open("/usr3/fauntleroy/my_file_db")
You can also specify a relative pathname.

ObjectStore treats links in the usual manner.

Automount pathnames are acceptable. If you are using automount, the pathname you specify cannot include the automount prefix, usually /tmp_mnt. Referring to the file with this prefix does not cause automount to keep it mounted and can cause the file to appear deleted.

Unless you set up a database to be a Server-remote database (see Chapter 5, Using Locator Files to Set Up Server-Remote Databases), you must store file databases on a host that is running an ObjectStore Server. ObjectStore determines which Server to use based on the NFS mountings of the client that creates the database.

Colons in file pathnames are interpreted as alphabetic characters if a slash character precedes the colon in the pathname. For example:
/usr1/moe/a:b

Specifies a file named a:b in the /usr1/moe directory, in the local host's name space.

bill:/usr2/dbs:abc

Specifies a file named dbs:abc in the /usr2 directory, on Server bill, in the Server's name space.

fifi/mimi:lulu

Specifies a file named mimi:lulu in the fifi directory, relative to the working directory, in the local host's name space.

File Name Expansion

When you specify a rawfs database name, ObjectStore commands use wildcard ( *, ?, {}, and [] ) name expansion.

You must insert a back slash (\) as an escape character immediately before a wildcard character. For example:

sax::/charlie\*.
Where you specify a file database name, the shell performs wildcard expansion. This means that it does not usually matter whether wildcards have preceding escape characters (back slashes). For example, the following two commands have an identical effect:

osls -d /oshome/bin/osse*
osls -d /oshome/bin/osse\*
In the first case, the shell expands the wildcard, and the expansions are all passed to osls; osls determines that they represent file pathnames, and passes them on to the shell command ls. In the second case, the shell passes the unexpanded string to osls, which determines that it represents a file pathname, and passes it to the shell command ls, which then does the expansion.

Executable Pathnames

Pathnames for the executables for ObjectStore utilities have the following format:

$OS_ROOTDIR/bin/utility-name 
ObjectStore utilities and shell commands
ObjectStore utilities have the prefix os, and most are analogous to shell commands. The utilities include oschgrp, oschmod, oschown, osls, osmkdir, osmv, osrm, and osrmdir. In most cases, you can use ObjectStore utilities and their corresponding shell commands interchangeably on operating system files and directories containing ObjectStore file databases; any differences are noted in the documentation for a particular utility.

Where the input name is a file database name, the commands (except oscp and osmv) pass the name on to the corresponding system command. Those commands that modify an individual database file in any way (oschgrp, oschmod, oschown, osmv, and osrm) attempt to verify that the file being operated on is in fact a database, by calling os_database::lookup() on the path before operating on it. This verification is only done, however, if neither -f (force) nor -R (recursive) is specified. If the force or recursive flag is specified, the paths are simply passed to the shell without further checking. This means, for example, that

osrm /foo/bar
removes /foo/bar only if it is a database, while

osrm -f /foo/bar
removes /foo/bar regardless of what type of file it is.

Note: ObjectStore utilities return a zero to indicate success and a nonzero value to indicate otherwise.

Setting Server Parameters

Each Server parameter that you can specify is described in Chapter 2, Server Parameters.

All Server parameters have default values. Object Design recommends that you use the default value for each parameter, which requires no action on your part. You can, however, modify Server parameters in two ways:

After you modify a Server parameter, you must shut down and restart the Server for any changes to parameters to take effect.

Using the osconfig Utility

When you create a rawfs with osconfig rawfs, the utility prompts you for a partition name. This results in a modification to the Server parameters.

When you run osconfig, the utility prompts you for the name of the Server log file. If you do not accept the default, this also results in a modification to the Server parameters.

Creating a Parameter File

A parameter file has the following format:

Parameter file format
Example
A parameter file can include one or more parameter specifications. The example below provides definitions for the Log File, PartitionN, and Authentication Required parameters:

Log File: /support2/local/ostore/sun4.r300/.log
Partition0: /support2/local/ostore/sun4.r300/.part0
Authentication Required: Unix Login
Search order
When you start an ObjectStore Server, ObjectStore looks for a parameter file in the following places in the order shown below. It uses the first parameter file that it finds.

  1. File specified with the -p option to osserver.

  2. $OS_ROOTDIR/etc/host_server_parameters, where host is the name of the local host.

OS_ROOTDIR is an environment variable set to the top-level directory in the part of the source hierarchy containing ObjectStore files.

Starting the Server

The ObjectStore Server usually starts when you boot your system. You can also start the Server with the osserver utility. However you start the Server, you can configure it with command-line options and parameter file options that the Server reads when it starts.

The pathname of the Server executable is $OS_ROOTDIR/lib/osserver. See the installation instructions for setting OS_ROOTDIR).

Syntax

$OS_ROOTDIR/lib/osserver [options]

Options

Ordinarily, you use Server parameters to control Server behavior. You can also specify options when you execute the osserver utility.
-c

Checkpoint. Forces all data to be propagated from the log to the database. The Server does not start after this checkpoint.

-d int

Starts the Server in debug mode. Specify an integer from 1 through 50. The larger the number, the more information ObjectStore provides. You can also specify the -F option so that ObjectStore displays the information on the screen.

ObjectStore copies debug output to the /tmp/ostore/oss_out file, unless you redirect it to another file.

-F

Foreground. Runs the Server process in the foreground. ObjectStore displays the information on the screen.This reverses the normal behavior, where the Server runs as a background process.

When run without -F, osserver returns 0 from a successful start-up of the background daemon; otherwise it returns 1.

-i

Initializes the Server log file and the rawfs, if you have one, with a confirmation prompt. Use with caution.

-I

(Uppercase I) Initializes the Server log file and the rawfs, if you have one, without a confirmation prompt. Use with extreme caution.

-p pathname

Specifies a file containing Server parameter settings that override the default settings. If you do not specify this option, ObjectStore uses only the default parameter file $OS_ROOTDIR/etc/host_server_parameters.

-v

Displays Server parameter values at start-up.

Description

After starting, the Server displays the message Server started on the system (host) console to let you know that it is ready to accept requests from clients on the network.

Debug mode
Output from debug mode can be very useful to Object Design personnel trying to help you solve a problem. When you no longer need the debug output, shut down the Server and restart it without the debug option. Running the Server in debug mode slows it down but does not affect clients. You should run the Server in debug mode only when you are experiencing a problem. In most cases, you want to specify -d 50 so you can obtain all possible information.

Use -i and -I with
caution
Be sure to move all data out of the log before you initialize it. See ossvrchkpt: Moving Data Out of the Server Transaction Log. Be sure to back up all data in the rawfs before you initialize it. See osbackup: Backing Up Databases.

When you initialize the transaction log, anything in the log is lost. The Server resizes the log to the values specified by the Log Data Segment Initial Size and Log Record Segment Initial Size Server parameters. When the log is in the rawfs, this frees space for use by other files. When the log is in the native file system, this reallocates space dedicated to the transaction log. The size of the log does not change.

Initializing when you
have a rawfs
If you have a rawfs, specifying the -i or -I option with osserver initializes the rawfs and the transaction log. When you specify -i, ObjectStore responds with

The entire ObjectStore file system on this host is about to be initialized, 
thus destroying any data currently in it. Unless you have a backup of the 
ObjectStore file system, it will be impossible to recover the old contents 
once the initialization is started. Are you sure that you want to reinitialize 
the ObjectStore file system?
When you specify -I, this message does not appear.

Initializing when
there is no rawfs
If you do not have a rawfs, then specifying the -i or -I option with osserver initializes only the transaction log. When you specify -i, ObjectStore responds with

You have asked for initialization which will create a new transaction log, 
deleting any old log that might exist, thus destroying any recovery data in 
the old log. This might leave some file databases in a broken state. Are 
you sure that you want to create a new log?
When you specify -I, this message does not appear.

Nonroot Server Start-Up

Normally, you start the Server as root. However, this is not required. If you start the Server from a non-root account, ObjectStore allows access to rawfs databases but does not allow access to file databases. You can change this behavior with the Restricted File DB Access Server parameter. See Restricted File DB Access.

Creating a Rawfs

Maintaining a rawfs provides a fast, convenient way to manage all ObjectStore databases at your site.

Before you can create a rawfs, you must set aside some partitions to be in the rawfs.

When you create your rawfs, the preferred method of doing so is to use osconfig rawfs. This utility prompts you for a pathname for the partition and then initializes it. See your installation guide for details.

Restrictions
A file partition can be no larger than two gigabytes. There are no ObjectStore restrictions on the size of a rawfs partition; however, the allowable size depends on the operating system. Most 32-bit systems do not allow file partitions greater than 2 GB.

On SGI with XFS, file partitions can be greater than 2 GB.

The maximum number of partitions for a single Server is 32.

Specifying the Partitions in a Rawfs

The PartitionN Server parameter specifies the partitions in the rawfs. You add a partition to the rawfs by adding a PartitionN statement to the Server parameter file. Each PartitionN statement has the following form:

PartitionN: type pathname {expandable | nonexpandable}
N

Specifies a positive integer from 0 to n. PartitionN statements can appear in the Server parameter file in any order, but empty slots are not allowed. For example, if you have four partitions, they must be numbered 0 through 3. Required.

type

Specifies whether the partition is a raw partition or a file partition. Required.

The value for type can be PARTITION or UNIX (except on AIX, HP-UX, and SGI IRIX; see below). If you specify PARTITION, the value of pathname must be the raw device name, for example, /dev/rsd0d, of a UNIX disk partition to be used as the nth partition in the rawfs. If you specify UNIX, the value of pathname is the absolute pathname of a UNIX file that is to be used as the nth partition in the rawfs.

The raw device is also known as a character special file in UNIX. Typically, each partition is accessible both by a raw device and by a block special device. The ObjectStore Server requires the use of the raw device.

AIX

On AIX, the value for type can be UNIX, LV, or RAW.

HP-UX

On HP-UX, the value for type can be UNIX, PARTITION, or DISK.

SGI IRIX

On SGI IRIX, the value for type can be UNIX, LV, or PARTITION.

pathname

Specifies the pathname of the partition. It must begin with a slash. For a raw partition, it is the device name. For a file partition, it is the absolute pathname.

AIX

On AIX, specify

HP-UX

On HP-UX, specify

SGI IRIX

On SGI IRIX, specify

expandable | nonexpandable

Indicates whether the partition is expandable in size or nonexpandable. By default, raw partitions are nonexpandable and file partitions are expandable.

It is unnecessary to specify more than one file in the same partition.

Modifying Partition Size

You can expand raw partitions only by setting aside additional raw space, adjusting the PartitionN statements as needed, and then restarting the Server.

Rawfs expansion
When you use files in a rawfs, you can control expansion of the rawfs as follows:

Example
For example, suppose the rawfs contains one raw partition, /dev/rsd4x, and three files, /usr1/one, /usr2/two, and /usr3/three. If you want to permit only two of the files to expand, your Server parameter file might include

Partition0: UNIX /usr1/one expandable
Partition1: UNIX /usr2/two expandable
Partition2: UNIX /usr3/three nonexpandable
Partition3: PARTITION /dev/rsd4x
Increase partition size
To increase the size of one or more existing partitions, check the sizes of the partitions with the dkinfo(8) command. The new partition must be no smaller than the partition it is replacing. To copy the data from an existing small partition to a new larger one use dd(1) or the osbackup and osrestore utilities. Then substitute each new name for the corresponding old one in the Server parameter file.

Shrink rawfs
You cannot shrink the size of a rawfs by removing one of its partitions.

Adding partitions
Use the osconfig utility to establish your rawfs. You can use the following procedure to add partitions to the rawfs.

  1. Make sure your raw partition is in place or that you created the file that will be your file partition.

  2. Use the ossvrshtd utility to shut down the Server.

  3. Edit the file $OS_ROOTDIR/etc/<hostname>_server_parameters. Add a PartitionN for each new partition. See Specifying the Partitions in a Rawfs.

  4. As root, restart the Server with the osserver utility.

The Server initializes only the new partitions. The content of existing partitions remains intact.

To reinitialize the entire rawfs, see Reconfiguring the Rawfs.

Setting Cache Manager Parameters

If a Cache Manager is not already running, the Cache Manager starts automatically when a client application starts.

You can specify the following Cache Manager parameters:

If you modify a Cache Manager parameter, the parameter does not take effect until the Cache Manager is shut down and restarted.

Specifying the Cache Directory Parameter

Default: /tmp/ostore
The Cache Directory parameter specifies the directory in which ObjectStore places the client cache file. This directory should not be an NFS mount point because this can result in slower client performance and can create the potential for problems with memory mapping over NFS.

If the environment variable OS_CACHE_DIR is set, ObjectStore uses that directory. Cache and commseg files should be in the same directory.

Make sure that this directory exists. The Cache Manager does not automatically create it.

Specifying the Commseg Directory Parameter

Default: /tmp/ostore
The Commseg Directory parameter specifies the directory in which ObjectStore places the communications segment. This directory should not be an NFS mount point because this can result in slower client performance and can create the potential for problems with memory mapping over NFS.

If the environment variable OS_COMMSEG_DIR is set, ObjectStore uses that directory. Cache and commseg files should be in the same directory.

Specifying the Hard Allocation Limit Parameter

Default: 0
The Hard Allocation Limit parameter specifies the upper bound, in bytes, on the amount of disk space that the Cache Manager can allocate for its cache files and commseg files. If you try to exceed this limit, you receive an error message similar to the following at ObjectStore initialization time (for example, when you call objectstore::initialize() or open or create a database):

Cache Manager hard limit (NNNNN) exceeded by request for MMMMM 
bytes of cache and/or commseg
This parameter allows you to prevent ObjectStore files from using too much disk space.

The default of 0 means that no limit is enforced.

Specifying the Mount Table Pathname Parameter

Default: /etc/mtab
The Mount Table Pathname parameter specifies the pathname of the mount table. The mount table indicates which UNIX file systems are mounted, and where they are in your file system. For example, if grizzly has a directory named /archive/two and you have it mounted on your file system as /arc2, NFS uses the mount table to translate the file name /arc2/x/y to /archive/two/x/y.

HP-UX and System V
This parameter instructs ObjectStore to use a mount table that is not in the default location. For HP-UX and System V platforms, except SGI, the default pathname is /etc/mnttab.

Object Design expects that few users will ever need this parameter. It is provided for the very unlikely situation in which you have something in your default mount table that ObjectStore cannot parse.

Specifying the Soft Allocation Limit Parameter

Default: 0
The Soft Allocation Limit parameter specifies the suggested upper bound, in bytes, on the amount of disk space that the Cache Manager can allocate for its cache files and commseg files. An application is allowed to exceed this limit in order to run to completion; when it finishes, the Cache Manager automatically deletes the cache and commseg files if the soft limit has been exceeded. Doing so frees disk space, but can make application start-up slower by forcing ObjectStore to create new cache and commseg files.

This parameter allows you to prevent ObjectStore cache files from using too much disk space.

The default of 0 means that no limit is enforced.

Specifying the Temporary Files Permission Parameter

When f is set to an octal value (for example, 0666), the Cache Manager creates commseg and cache files with file permissions equal to that value. If you do not use this parameter, the Cache Manager creates new cache and commseg files with the permission 0660.

Note that the Cache Manager file permissions setting can also be affected by the umask of the shell that started the Cache Manager. For this reason, you should set the umask to 0 when using this parameter.

Cache Manager Parameter File Location

The Cache Manager parameter file is similar to the Server parameter file in terms of location and internal format. ObjectStore searches the following locations in the following order and uses the first Cache Manager parameter file that it finds.

  1. $OS_ROOTDIR/etc/host_cache_manager_parameters, where host is the name of the current host as returned by the hostname program. OS_ROOTDIR is an environment variable.

  2. $OS_ROOTDIR/etc/cache_manager_parameters.

Cache Manager Parameter File Format

The Cache Manager parameter file has the same characteristics as the Server parameter file:

Example of a Cache Manager Parameter File

A Cache Manager parameter file can include one or more parameter specifications. Here is an example of a Cache Manager parameter file:

Cache Directory: /support2/local/ostore/tmp
Commseg Directory: /support2/local/ostore/tmp
Mount Table Pathname: /new/mount/pathname
Hard Allocation Limit: 10000000

Increasing the Size of the Cache

A larger cache size does not necessarily improve performance.

On UNIX, an ObjectStore cache is a memory mapped file. Now, suppose you have a system where the size of this memory mapped file is a significant percentage of the system's real memory. In this situation, an application that is performing memory mapping for a large file and subsequently doing a lot of processing that does not involve the memory mapped file can suffer a much poorer performance than if the application had not memory mapped the file - that is, if the application used straight UNIX file I/O.

The reason for this is that overall system swapping is increased by the presence of the semiactive memory mapped file. That is, the application is not using or reusing the cached database pages frequently enough to benefit from a large cache file.

An example of such an application is a program that populates a database by inserting a large number of objects into a collection. In this case, with the exception of the actual collection object, the pages in the cache are not being reused. Such a program benefits from having a small cache (for example, 2 MB) because the objects are not being revisited and overall UNIX system swapping is low.

A program that would benefit from having a large cache would be one that accesses a large number of objects (pages) and then reaccesses the same objects before replacing the objects (pages) in the cache with other objects (pages) fetched from the database. Of course, as the cache size starts to become a larger and larger percentage of the size of the machine's physical memory, more and more system swapping occurs and the performance gain of a large cache file begins to be lost.

The important issue with a large database is knowing how to properly cluster and segment it to achieve maximum performance. Properly designing a database so that it is clustered/segmented to achieve maximum performance is usually very application specific.

See OS_CACHE_SIZE for information on setting the cache size.

Description of ObjectStore Directories

The ObjectStore directory structure appears in the following illustration. You must set OS_ROOTDIR to Toplevel.

The directory structure for AIX and Solaris 2 each contain one extra directory, sunpro on Solaris 2 and cset on AIX as shown in the following illustration. Each of these two directories contain links to the top level, bin, lib and Other Directories.

The cset and sunpro directories provide backward compatibility. In previous releases, the AIX and Solaris 2 platforms supported two compilers, a native C++ compiler and Cfront. Some components were common to the two compilers and some were compiler-dependent. The cset and sunpro directories contained compiler-specific components, and the common components were contained in a directory called common.

In the modified directory structure of ObjectStore Release 5.1 the common directories have been eliminated, and the sunpro and cset directories contain links to bin, lib, and so on. For backward compatibility, you can set OS_ROOTDIR to Toplevel/cset or Toplevel/sunpro.

Finding Files Containing ObjectStore Messages

When an ObjectStore daemon process sends output to stdout or stderr, ObjectStore routes the output to a corresponding file, as follows:
Cache Manager

/tmp/ostore/osc4_out

Server

/tmp/ostore/oss_out

If the file does not already exist, ObjectStore creates it; if the file does exist, ObjectStore appends the new information.

ObjectStore daemons seldom send messages to these files except under certain unusual error conditions. In these cases, this information can be helpful in understanding and resolving an error. When you report to Object Design a problem that might involve one of these daemons, find such a file if it exists, and provide the contents.

When the daemon process is not running, you can safely delete the corresponding file. Usually, very little is ever sent to these files, so they are unlikely to occupy much disk space.

Using Tapes with the osbackup Utility

When you execute the osbackup utility, you can use standard UNIX tape drives, including quarter-inch cartridge and 8mm cartridge drives. Some standard tape formats and sizes are
Format Capacity in Megabytes
QIC-11

30

QIC-24

60

QIC-150

150

QIC-525

525

EXB-8200

2200

EXB-8500

5000

ObjectStore Use of /tmp/ostore

ObjectStore uses /tmp/ostore as the default location for the following files:
FileFor Information See
Cache

OS_CACHE_DIR

Commseg

OS_COMMSEG_DIR

oss_out Server output file

osc4_out Cache Manager output file

Finding Files Containing ObjectStore Messages

UNIX domain sockets

Modifying Network Port Settings

AIX Considerations

The following information provides additional considerations for ObjectStore Release 5 on AIX.

Using SCSI Tape Drives

When using tapes with the osbackup and osrestore utilities, you have several choices of how to configure SCSI tape drives as output devices on the RISC System/6000. These choices offer tradeoffs between convenience and performance.

You must choose values for these parameters:

Device buffers
Writing a tape is much faster when you use device buffers. To do this, set Use Device Buffers to yes with chdev or SMIT. When you use device buffers, you must also specify a tape size to the osbackup command to ensure that buffered data is not lost. Without a specified tape size, ObjectStore continues to write data until the end of the tape, not leaving room for any buffered data.

This situation does not occur when Use Device Buffers is set to no, and it is not necessary to specify a tape size to the osbackup command.

Block size
In general, you get the best tape usage by using variable-size blocks. To select variable-size blocks, you must use SMIT or chdev to set the block_size attribute to 0.

The use of variable-size blocks on QIC-120 or QIC-150 media is apparently unique to IBM. If you write variable-size blocks on such a tape, you will not be able to read it on another system.

You can also use fixed-size records, which can facilitate tape duplication under certain circumstances.

To use fixed-size records, you must either set block_size in bytes in SMIT or with chdev, or use the -b control argument to osbackup to specify the block size in 512-byte sectors. Note that the osbackup command option overrides the SMIT setting, unlike utilities such as tar, where the SMIT setting takes precedence.

The block size must be 512 bytes or less. The osbackup utility cannot work when the block size is greater than 512 bytes.

Setting Up Permissions

When you have a client and a Server on two different AIX machines, export the file systems as setuid. Also, add the switch

-root=server_host_name 
to the exportfs command or to the line in the /etc/exports file. server_host_name is the name of the host of the ObjectStore Server.

Failing to perform both steps can cause permission errors.

Troubleshooting Permission Denied Error

There is an AIX bug that occurs when the number of processes allowed per user is too low. You can list the current setting with the following command:

# lsattr -E -l sys0 -a maxuproc
maxuproc 40 Maximum # of processes allowed per user True
To increase the maxuproc parameter, enter the following command:

# chdev -l sys0 -a maxuproc=200
sys0 changed
When the number of processes allowed per user is too low, you might receive the following error:

No handler for exception:
permission to access this database was denied
re /usr/lpp/ostore/lib/liboscol.ldb while looking up file database 
/usr/lpp/ostore/lib
/liboscol.ldb (host "aix_server1")
gmake: *** [AIX/os_schema.C] Error 1
aix_server1> ps -efl | grep ostore
260801 S     root 19379  3967   0  60 20 12892   516            Feb 23      -  0:00
/usr/lpp/ostore/lib/cmgr3 -AIX_SRC
 200801 S pbergstr 32347 41739   1  60 20 11051    88  6052824 14:01:27 
pts/15  0:00
grep ostore
262801 S pbergstr 40254  3967   0  60 20  9e3  1372          14:00:31      -  
0:00 /
usr/lpp/ostore/lib/osserver -AIX_SRC
aix_server1>

Uninstalling ObjectStore Release 5

In the event that you want to completely remove ObjectStore Release 5.0 from your AIX system, use the following procedure.

  1. Shut down the Cache Manager ($OS_ROOTDIR/bin/oscmshtd).

  2. Shut down the Server ($OS_ROOTDIR/bin/ossvrshtd -f hostname).

  3. Use ossvrchkpt to ensure that all data is copied from the transaction log to the database that was changed.

  4. Check the files $OS_ROOTDIR/etc/yourhostname_server_parameters and $OS_ROOTDIR/etc/yourhostname_cache_manager_parameters to see where your transaction log and temporary files are going, then remove them.

  5. Remove the install area (/usr/lpp/ODI by default).

  6. Remove links to /usr/bin if you created them with osconfig. Do not remove /usr/bin/oslevel.

  7. Remove links to /usr/lib if you created them (/usr/lib/libos*).

  8. Remove the link to $OS_ROOTDIR/include if you created it (/usr/include/ostore).

  9. Remove /etc/rc.objectstore.



[previous] [next]

Copyright © 1997 Object Design, Inc. All rights reserved.

Updated: 03/26/98 20:44:42