ObjectStore C++ Advanced API User Guide

Chapter 10

Database Utility API

The information about the database utility APIs is organized in the following manner:

Database Utility API Overview

The database utility API provides C++ functions corresponding to the utilities documented in Chapter 4, Utilities, in ObjectStore Management. You can use them as a basis for your own database utilities and tools.

The os_dbutil class
All the functions in this facility are members of the class os_dbutil. See os_dbutil in Chapter 2, Class Library, of the ObjectStore C++ API Reference for a complete description of the os_dbutil class.

Initializing the database utility API
Call the following function before using any other members of os_dbutil:

      static void os_dbutil::initialize() ;
You only need to call this function once in each application.

Managing Servers

Getting Rawfs Disk Space Information with disk_free()

      static void disk_free(
            const char *hostname, 
            os_free_blocks *blocks
      ) ;
Function arguments
Gets disk space usage in the rawfs managed by the Server on the machine named hostname. blocks points to an instance of os_free_blocks allocated by the caller, using the zero-argument constructor. The class os_free_blocks has the following public data members:
os_unsigned_int32struct_version;
os_unsigned_int32free_blocks;
os_unsigned_int32file_system_size;
os_unsigned_int32used_blocks;

disk_free() sets the values of these data members for the instance of os_free_blocks pointed to by the argument blocks.

The os_free_blocks constructor sets struct_version to the value of os_free_blocks_version in the dbutil.hh file included by your application. If this version is different from that used by the library, err_misc is signaled. The constructor initializes all other members to 0.

See also

Getting Server Information with svr_stat()

      static void svr_stat(
            const char *server_host,
            os_unsigned_int32 request_bits
            os_svr_stat *svrstat_data
      ) ;
Function arguments
The db_util::svr_stat() function gets statistics for a Server's clients on server_host.

See also
Enumerators for request_bits
The request_bits argument specifies what information is desired. Supply this argument by forming the bit-wise disjunction of zero or more of the following enumerators:

For each enumerator that is specified, the corresponding information is retrieved.

For each of the classes described below, the constructor sets struct_version to the value of os_free_blocks_version in the dbutil.hh file included by your application. If this version is different from that used by the library, err_misc is signaled. The constructor initializes all other members to 0.

Public data members in os_svr_stat
The svr_stat_data argument points to an instance of os_svr_stat allocated by the caller, using the zero-argument constructor. This structure has the following public data members:
os_unsigned_int32struct_version;
os_svr_stat_svr_headerheader;
os_svr_stat_svr_parameters*svr_parameters;
os_svr_stat_svr_rusage*svr_rusage;
os_svr_stat_svr_meters*svr_meter_samples;
os_unsigned_int32n_meter_samples;
os_svr_stat_client_info*client_info_self;
os_svr_stat_client_info*client_info_others;
os_unsigned_int32n_clients;
os_dbutil::os_os_db_util::os_svr_stat() allocates instances of these as required. They are automatically cleaned up when the os_svr_stat instance (as provided by the caller) is deleted.

Public data members in os_svr_stat_svr_header
The os_svr_stat_svr_header data member (a member of os_svr_stat) has the following public data members:
os_unsigned_int32struct_version;
char*os_release_name;
os_unsigned_int32server_major_version;
os_unsigned_int32server_minor_version;
char*compilation;

Public data members in os_svr_stat_svr_parameters
The os_svr_stat_svr_parameters data member (a member of os_svr_stat) has the following public data members:
os_unsigned_int32struct_version;
char*parameter_file;
os_booleanallow_shared_mem_usage;
os_int32*authentication_list;
os_unsigned_int32n_authentications;
os_int32RAWFS_db_expiration_time;
os_int32deadlock_strategy;
os_unsigned_int32direct_to_segment_threshold;
char*log_path;
os_unsigned_int32current_log_size_sectors;
os_unsigned_int32initial_log_data_sectors;
os_unsigned_int32growth_log_data_sectors;
os_unsigned_int32log_buffer_sectors;
os_unsigned_int32initial_log_record_sectors;
os_unsigned_int32growth_log_record_sectors;
os_unsigned_int32max_data_propagation_threshold;
os_unsigned_int32max_propagation_sectors;
os_unsigned_int32max_msg_buffer_sectors;
os_unsigned_int32max_msg_buffers;
os_unsigned_int32sleep_time_between_2p_outcomes;
os_unsigned_int32sleep_time_between_propagates;
os_unsigned_int32write_buffer_sectors;
os_unsigned_int32tcp_recv_buffer_size;
os_unsigned_int32tcp_send_buffer_size;
os_booleanallow_nfs_locks;
os_booleanallow_remote_database_access;
os_unsigned_int32max_two_phase_delay;
os_unsigned_int32max_aio_threads;
os_unsigned_int32cache_mgr_ping_time;
os_unsigned_int32max_memory_usage;
os_unsigned_int32max_connect_memory_usage;
os_unsigned_int32remote_db_grow_reserve;
os_booleanallow_estale_to_corrupt-DBs;
os_int32restricted_file_db_access_only;
os_unsigned_int32failover_heartbeat_time;

Public data members in os_svr_stat_svr_rusage
The os_svr_stat_svr_rusage data member (a member of os_svr_stat) has the following public data members:
os_unsigned_int32struct_version;
os_timesecs ru_utime; /* user time used */
os_timesecs ru_stime; /* system time used */
os_int32 ru_maxrss; /* max resident set size */
os_int32 ru_ixrss; /* shared mem size */
os_int32 ru_idrss; /* unshared data size */
os_int32 ru_isrss; /* unshared stack size */
os_int32 ru_minflt; /* page reclaims */
os_int32 ru_majflt; /* page faults */
os_int32 ru_nswap; /* swaps */
os_int32 ru_inblock; /* block input ops */
os_int32 ru_msgsnd; /* messages sent */
os_int32 ru_msgrcv; /* messages received */
os_int32 ru_nsignals; /* signals received */
os_int32 ru_nvcsw;
/* voluntary context switches */
os_int32 ru_nivcsw;
/* involuntary context switches */

Public data members in os_svr_stat_svr_meters
The os_svr_stat_svr_meters data member (a member of os_svr_stat) has the following public data members:
os_unsigned_int32 struct_version;
os_booleanvalid;
os_unsigned_int32n_minutes;
os_unsigned_int32n_receive_msgs;
os_unsigned_int32n_callback_msgs;
os_unsigned_int32n_callback_sectors_requested;
os_unsigned_int32n_callback_sectors_succeeded;
os_unsigned_int32n_sectors_read;
os_unsigned_int32n_sectors_written;
os_unsigned_int32n_commit;
os_unsigned_int32n_phase_2_commit;
os_unsigned_int32n_readonly_commit;
os_unsigned_int32n_abort;
os_unsigned_int32n_phase_2_abort;
os_unsigned_int32n_deadlocks;
os_unsigned_int32 n_readonly_commit;
os_unsigned_int32n_abort;
os_unsigned_int32n_phase_2_abort;
os_unsigned_int32n_deadlocks
os_unsigned_int32n_msg_buffer_waits;
os_unsigned_int32n_log_records;
os_unsigned_int32n_log_seg_switches;
os_unsigned_int32n_flush_log_data_writes;
os_unsigned_int32n_flush_log_record_writes;
os_unsigned_int32n_log_data_writes;
os_unsigned_int32n_log_record_writes;
os_unsigned_int32n_sectors_propagated;
os_unsigned_int32n_sectors_direct;
os_unsigned_int32n_do_some_propagation;

Public data members in os_svr_stat_client_info
The os_svr_stat_client_info data member (a member of os_svr_stat) has the following public data members:
os_unsigned_int32struct_version;
os_svr_stat_client_process*process;
os_svr_stat_client_state*state;
os_svr_stat_client_meters*meters;

os_db_util::os_svr_stat() allocates instances of these as required. They are automatically cleaned up when the os_svr_stat instance (as provided by the caller) is deleted.

Public data members in os_svr_stat_client_process
The os_svr_stat_client_process data member (a member of os_svr_stat_client_info) has the following public data members:
os_unsigned_int32struct_version;
char*host_name;
os_unsigned_int32process_id;
char*client_name;
os_unsigned_int32client_id;

Public data members in os_svr_stat_client_state
The os_svr_stat_client_state data member (a member of os_svr_stat_client_info) has the following public data members:
os_unsigned_int32struct_version;
os_client_state_typeclient_state;
char*message_name;
os_booleantxn_in_progress;
os_unsigned_int32txn_priority;
os_unsigned_int32txn_duration;
os_unsigned_int32txn_work;
os_client_lock_typelock_state;
os_unsigned_int32db_id;
char*db_pathname;
os_unsigned_int32locked_seg_id;
os_unsigned_int32locking_start_sector;
os_unsigned_int32locking_for_n_sectors;
os_unsigned_int32 n_conflicts;
os_svr_stat_client_process*lock_conflicts;

os_client_lock_type
      enum os_client_lock_type {
            OSSVRSTAT_CLIENT_LOCK_TO_MAX_BLOCKS,
            OSSVRSTAT_CLIENT_LOCK_TO_NBLOCKS,
      };
os_client_state_type
      enum os_client_state_type {
            OSSVRSTAT_CLIENT_WAITING_MESSAGE,
            OSSVRSTAT_CLIENT_EXECUTING_MESSAGE,
            OSSVRSTAT_CLIENT_WAITING_RANGE_READ_LOCK,
            OSSVRSTAT_CLIENT_WAITING_RANGE_WRITE_LOCK,
            OSSVRSTAT_CLIENT_WAITING_SEGMENT_WRITE_LOCK,
            OSSVRSTAT_CLIENT_DEAD,
            OSSVRSTAT_CLIENT_WAITING_SEGMENT_READ_LOCK,
            OSSVRSTAT_CLIENT_WAITING_DB_READ_LOCK,
            OSSVRSTAT_CLIENT_WAITING_DB_WRITE_LOCK,
      };
Data in locking_start_sector and locking_for_n_sectors is valid only when lock_state is OSSVRSTAT_CLIENT_STATE_WAITING_RANGE_READ_LOCK or OSSVRSTAT_CLIENT_STATE_WAITING_RANGE_WRITE_LOCK.

Public data members in os_svr_stat_client_meters
The os_svr_stat_client_meters data member (a member of os_svr_stat_client_info) has the following public data members:
os_unsigned_int32struct_version;
os_unsigned_int32n_receive_msgs;
os_unsigned_int32n_callback_msgs;
os_unsigned_int32n_callback_sectors_requested;
os_unsigned_int32n_callback_sectors_succeeded;
os_unsigned_int32n_sectors_read;
os_unsigned_int32n_sectors_written;
os_unsigned_int32n_deadlocks;
os_unsigned_int32n_lock_timeouts;
os_unsigned_int32n_commit;
os_unsigned_int32n_phase_2_commit;
os_unsigned_int32n_readonly_commit;
os_unsigned_int32n_abort;
os_unsigned_int32n_phase_2_abort;

Determining Sector Size with get_sector_size()

      static os_unsigned_int32 get_sector_size() ;
Return values
Returns 512, the size of a sector in bytes. Certain ObjectStore utilities report some of their results in numbers of sectors, and some Server parameters are specified in sectors

See also

Killing a Client Thread on a Server with svr_client_kill()

      static os_boolean svr_client_kill(
            const char *server_host,
            os_int32 client_pid, 
            const char *client_name, 
            const char *client_hostname,
            os_boolean all, 
            os_int32 &status
      ) ;
Function arguments
Kills one or all clients of the specified Server. server_host is the name of the machine running the Server.

client_pid is the process ID of the client to kill. client_name is the name of the client to kill. client_hostname is the name of the machine running the client to kill.

If all is 1, the other arguments except server_host are ignored, and all clients on the specified Server are killed.

status is set to -2 if a client was killed, 0 if no clients matched the specifications, 2 if multiple clients matched the specification. Any other value means that access was denied.

Return values
Returns 0 for failure and nonzero for success.

See also

Determining Whether a Server Is Running with svr_ping()

      static char *svr_ping(
            const char *server_host,
            os_svr_ping_state &state
      ) ; 
Function arguments
Determines whether an ObjectStore Server is running on the machine named server_host. The referent of state is set to one of the following global enumerators:

Return values
Returns a pointer to the status message string used by the utility ossvrping.

See also

Shutting Down the Server with svr_shutdown()

      static os_boolean svr_shutdown(
            const char *server_host
      ) ; 
Return values
Shuts down the Server on the machine named server_host. Returns nonzero for success, 0 otherwise. On some operating systems, you must have special privileges to use this function.

See also

Moving Data Out of the Server Transaction Log with svr_checkpoint()

      static os_boolean svr_checkpoint(
            const char *hostname
      ) ;  
Return values
Makes the specified Server take a checkpoint asynchronously. Returns nonzero when successful, 0 or an exception on failure.

See also

Managing Clients

Setting a Client Name with set_client_name()

      static void set_client_name (const char *name) ;
Sets the client name string for message printing.

See also

Getting a Client Name with get_client_name()

      static char const* get_client_name();
Return values
Returns the pointer last passed to set_client_name(). If there was no prior call to set_client_name(), 0 is returned. This function does not allocate any memory.

See also

Closing a Server Connection with close_server_connection()

      static void close_server_connection(const char *hostname);
Closes the connection the application has to the ObjectStore Server running on the machine named hostname.

See also

Closing All Server Connections with close_all_server_connections()

      static void close_all_server_connections();
Closes all connections the application has to ObjectStore Servers.

See also

Managing Cache Managers

Getting Cache Manager Status with cmgr_stat()

      static void cmgr_stat(
            const char *hostname, 
            os_int32 cm_version_number,
            os_cmgr_stat *cmstat_data
      ) ; 
Function arguments
Gets information for the Cache Manager on the machine with the specified hostname. The argument cm_version_number must match the Cache Manager's version number.

See also
Public data members in os_cmgr_stat
The cmstat_data argument points to an instance of os_cmgr_stat allocated by the caller, using the no-argument constructor. os_cmgr_stat has the following public data members:
os_unsigned_int32struct_version;
os_unsigned_int32major_version;
os_unsigned_int32minor_version;
os_unsigned_int32pid;
char*executable_name
char*host_name;
os_unixtime_tstart_time;
os_int32soft_limit;
os_int32hard_limit;
os_int32free_allocated;
os_int32used_allocated;
os_int32n_clients;
os_cmgr_stat_client*per_client; /* array */
os_int32n_servers;
os_cmgr_stat_svr* per_server; /* array */
os_int32n_cache_file_usage;
os_cmgr_stat_file_usage*cache_file_usage; /* array */
os_int32n_commseg_file_usage;
os_cmgr_stat_file_usage*commseg_file_usage; /* array */
char*cback_queue;
char*extra;

The constructor sets struct_version to the value of os_free_blocks_version in the dbutil.hh file included by your application. If this version is different from that used by the library, err_misc is signaled. The constructor initializes all other members to 0.

Public data members in os_cmgr_stat_client
The os_cmgr_stat_client data member (a member of os_cmgr_stat) has the following public data members:
os_unsigned_int32struct_version;
os_int32pid;
os_unsigned_int32euid;
char*name;
os_int32major_version;
os_int32minor_version;
os_int32commseg;

Public data members in os_cmgr_stat_svr
The os_cmgr_stat_svr data member (a member of os_cmgr_stat) has the following public data members:
os_unsigned_int32struct_version;
char*host_name;
os_int32client_pid;
char*status_str;

Public data members in os_cmgr_stat_file_usage
The os_cmgr_stat_file_usage data member (a member of os_cmgr_stat) has the following public data members:
os_unsigned_int32struct_version;
char*file_name;
os_unsigned_int32file_length;
os_booleanis_free;

Deleting Unused Cache and commseg Files with cmgr_remove_file()

      static char *cmgr_remove_file(
            const char *hostname, 
            os_int32 cm_version_number
      ) ;
Function arguments
Makes the Cache Manager on the machine with the specified hostname delete all the cache and commseg files that are not in use by any client. The argument cm_version_number must match the Cache Manager's version number.

Return values
This function returns a pointer to the result message string.

See also

Shutting Down the Cache Manager with cmgr_shutdown()

      static char *cmgr_shutdown(
            const char *hostname, 
            os_int32 cm_version_number
      ) ; 
Function arguments
Shuts down the Cache Manager running on the machine with the specified hostname. The argument cm_version_number must match the Cache Manager's version number.

Return values
Returns a pointer to the result message string.

See also

Managing Databases

Changing Database Group Names with chgrp()

      static void chgrp(
            const char *pathname, 
            const char *gname
      ) ;
Changes the primary group of the rawfs directory or database whose name is pathname. gname is the name of the new group.

See also

Changing Database Owner with chown()

      static void chown(
            const char *pathname, 
            const char *uname
      ) ;
Function arguments
Changes the owner of the rawfs directory or database whose name is pathname. uname is the user name of the new owner.

See also

Changing Database Permissions with chmod()

      static void chmod(
            const char *pathname, 
            const os_unsigned_int32 mode
      ) ;
Function arguments
Changes the protections on the rawfs database or directory whose name pathname. mode specifies the new protections.

See also

Changing a Rawfs Hosts with rehost_link()

      static void rehost_link(
            const char *pathname, 
            const char *new_host
      ) ;
Function arguments
Changes the host to which a rawfs link points. pathname must specify a symbolic link, otherwise err_not_a_link is signaled. new_host specifies the new Server host.

See also

Changing All Rawfs Hosts with rehost_all_links()

      static void rehost_all_links(
            const char *server_host, 
            const char *old_host,
            const char *new_host
      ) ;
Function arguments
Changes the hosts of specified rawfs links. server_host specifies the host containing the links to be changed. All links pointing to old_host are changed to point to new_host. On some operating systems, you must have special privileges to use this function.

See also

Copying Databases with copy_database()

      static os_boolean copy_database(
            const char *src_database_name, 
            const char *dest_database_name
      ) ;
Function arguments
Copies the database named src_database_name and names the copy dest_database_name. If there is already a database named dest_database_name, it is silently overwritten.

Return values
Returns 0 for success, 1 if per-segment access control information has been changed during copy (which can happen when copying a rawfs database to a file database, since file databases do not have separate segment-level protections). This function can be called either within or outside a transaction.

See also

Expanding File Names with expand_global()

      static char **expand_global(
            char const *glob_path, 
            os_unsigned_int32 &n_entries
      ) ;
Function arguments and return values
Returns an array of pointers to rawfs pathnames matching glob_path by expanding glob_path's wildcards (*, ?, {}, and []). n_entries is set to refer to the number of pathnames returned. It is the caller's responsibility to delete the array and pathnames when no longer needed.

See also

Creating Rawfs Directories with mkdir()

      static void mkdir(
            const char *path,
            const os_unsigned_int32 mode,
            os_boolean create_missing_dirs = 0
      ) ;
Function arguments
Makes a rawfs directory whose pathname is path. The new directory's protections is specified by mode. If create_missing_dirs is nonzero, creates the missing intermediate directories.

Return values
Signals err_directory_not_found if create_missing_dirs is 0 and there are missing intermediate directories. Signals err_directory_exists if there is already a directory with the specified path. Signals err_database_exists if there is already a database with the specified path.

See also

Setting Links in the Rawfs with make_link()

      static void make_link(
            const char *target_name,
            const char *link_name
      ) ;
Function arguments
Makes a rawfs soft link. target_name is the path pointed to by the link. link_name is the pathname of the link.

Return values
Signals err_database_exists or err_directory_exists if link_name already points to an existing database or directory.

A rawfs can have symbolic links pointing within itself or to another Server's rawfs. The Server follows symbolic links within its rawfs for all os_dbutil members that pass pathname arguments, unless specified otherwise by a function's description; only os_dbutil::stat() can override this behavior. All members passing pathname arguments also follow cross-server links on the application side, unless specified otherwise by a function's description.

To access a particular database or directory, a client can follow as many as 15 cross-Server links. For example, a client traverses a link to Server Q. Server Q sends the client to Server P. Server P sends the client to another Server or even back to Server Q. Each connection to a Server counts as one link. It does not matter whether or not the Server was previously connected to in the link chain. When the client reaches the sixteenth link, ObjectStore displays the error message err_too_many_cross_svr_links.

To access a particular database or directory in its rawfs, the Server can traverse as many as 10 (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.

A rawfs symbolic link always has the ownership and the permissions of the parent directory.

See also

Removing Databases and Rawfs Links with remove()

      static void remove(char const *path) ;
Return values
Removes the database or rawfs link with the specified name. If path names a link, the link is removed but the target of the link is not. If path names a directory, it is not removed. Signals err_not_a_database if path exists in a rawfs but is not a database. Signals err_file_not_db if the path designates an operating system file, but does not appear to be an ObjectStore database. Signals err_file_error when a problem is reported by the Server host's file system. Signals err_file_not_local if the file is not local to this Server.

See also

Removing Rawfs Directories with rmdir()

      static void rmdir(const char *path) ;
Return values
Removes the rawfs directory with the specified pathname. Signals err_directory_not_empty if the directory still contains databases. Signals err_not_a_directory if the argument does not specify a directory path.

See also

Moving Directories and Databases with rename()

      static void rename(
            const char *source, 
            const char *target
      ) ;
Function arguments
Renames the rawfs database or directory. source is the old name and target is the new name.

Return values
Signals err_cross_server_rename if source and target are on different Servers. Signals err_invalid_rename if the operation makes a directory its own descendent. Signals err_database_exists if a database named target already exists. Signals err_directory_exists if a directory named target already exists.

See also

Testing a Pathname for Specified Conditions with stat()

      static os_rawfs_entry *stat(
            const char *path,
                  const os_boolean b_chase_links = 1
      ) ;
Function arguments
Gets information about a rawfs pathname. If b_chase_links is false and the path is a link, the server does not follow it. The server still follows intrarawfs links for the intermediate parts of the path.

Return values
Returns a pointer to an os_rawfs_entry to be destroyed by the caller, or 0 on error.

See also

Listing Directory Contents with list_directory()

      static os_rawfs_entry **list_directory(
            const char *path, 
            os_unsigned_int32 &n_entries
      ) ; 
Function arguments
Lists the contents of the rawfs directory named path.

Return values
Returns an array of pointers to os_rawfs_entry objects. n_entries is set to the number of elements in the returned array. If path does not specify the location of a directory, err_not_a_directory is signaled. It is the caller's responsibility to delete the array and os_rawfs_entry objects when no longer needed.

See also

Find Database Size with ossize()

      static os_int32 ossize(
            const char *pathname,
            const os_size_options *options
      ) ;
Function arguments
Prints to standard output the size of the database whose name is pathname. options points to an instance of os_size_options allocated by the caller using the zero-argument constructor. os_size_options has the following public data members (each member corresponds to an option for the utility ossize):
os_unsigned_int32struct_version;
os_booleanflag_all;/* -a */
os_booleanflag_segments;/* -c */
os_booleanflag_total_database;/* -C */
os_booleanflag_free_block_map;/* -f */
os_unsigned_int32one_segment_number;/* -n */
os_booleanflag_every_object;/* -o */
charflag_summary_order;/* -s `s'=space `n'=number `t'=typename */
os_booleanflag_upgrade_rw;/* -u */
const char*workspace_name; /* -w */
os_booleanflag_list_workspaces;/* -W */
os_booleanflag_internal_segments;/* -0 */
os_booleanflag_access_control;/* -A */

The constructor sets struct_version to the value of os_size_options_version in the dbutil.hh file included by your application. If this version is different from that used by the library, err_misc is signaled. The constructor initializes all other members to 0.

Returns 0 for success, -1 for failure.

If OS__DBUTIL_NO_MVCC is set, this function opens the database for read only, rather than for multiversion concurrency control (the default).

See also

Verifying Pointers and References with osverifydb()

      static os_unsigned_int32 osverifydb(
            const char *dbname,
            os_verify_db_options* opt= 0
      ) ;
Function arguments
Verifies that all pointers and references in the database named dbname. opt point to an instance of os_verify_db_options allocated by the caller using the zero-argument constructor. os_verify_db_options has the following public data members:

      os_boolean verify_segment_zero ;   
            /* verify the schema segment */
      os_boolean verify_collections ;    
            /* check all top-level collections */
      os_boolean verify_pointer_verbose;
            /* print pointers as they are verified */
      os_boolean verify_object_verbose ; 
            /* print objects as they are verified */
      os_boolean verify_references ;
            /* check all OS references */
      os_int32  segment_error_limit ;    
            /* maximum errors per segment */
      os_boolean print_tag_on_errors ; 
            /* print out the tag value on error */
      const char* explicit_workspace 
            /* The workspace name if one was explicitly specified. */ 
      const void* track_object_ptr ;     
            /* Track object identified by pointer */
      const char* track_object_ref_string;
            /* Track the object identified by the reference string. */
      enum { 
            default_action, 
            ask_action, 
            null_action, 
      } illegal_pointer_action ;
You must have called os_collection::initialize() and os_mop::initialize() prior to calling this function.

If OS__DBUTIL_NO_MVCC is set, this function opens the database for read only, rather than multiversion concurrency control (the default).

Return values
Returns 0 for success, 1 for failure.

See also

Managing Schemas

Comparing Schemas with compare_schemas()

      static os_boolean compare_schemas(
            const os_database* db1,
            const os_database* db2,
            os_boolean verbose = 1
      ) ;
Function arguments and return values
Compares the schemas of db1 and db2. Returns 1 if the schemas are incompatible, 0 otherwise. Each database can contain an application schema, a compilation schema, or a database schema. If the database contains a database schema, it can be local or remote.

If verbose is nonzero, the function issues a message to the default output describing any incompatibility.

See also

Setting the Application Schema with set_application_schema_path()

      static char *set_application_schema_path(
            const char *executable_pathname,
            const char *database_pathname
      ) ;
Function arguments
Finds or sets an executable's application schema database. executable_pathname specifies the executable. database_pathname is either the new schema's pathname or 0.

Return values
If database_pathname is 0, the function returns new storage containing the current pathname. If database_pathname is nonzero, the function returns 0.

See also

Exceptions Summary

err_file_pathname: A rawfs pathname was expected.

err_misc: An unexpected 0 argument or an invalid pathname was passed; version mismatch of an in/out structure argument.

err_rpc: RPC error.

err_too_many_cross_svr_links: Excessively long cross-server link chain. The maximum depth of a cross-server link chain is currently 15.

err_no_rawfs: There is no database file system (rawfs) on this Server.

err_read_only_file_system: The file database is stored in a read-only file system.

err_no_credentials: Access is not permitted; no credentials were presented.

err_server_not_superuser: The Server is not running as the superuser.

err_link_not_found: Intrarawfs link was not found.

err_too_many_links: Too many levels of intrarawfs links.

err_rawfs_not_upgraded: The rawfs is from an old release.

err_permission_denied: Permission to access this database was denied.

err_invalid_pathname: The rawfs pathname is not valid.

err_directory_not_found: The directory was not found.

err_database_not_found: The rawfs database was not found.

err_link_not_found: The rawfs link was not found.



[previous] [next]

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

Updated: 03/31/98 15:43:20