Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sfsadmin_add_index(8) — ACMSxp 3.2A

Media Vault

Software Library

Restoration Projects

Artifacts Sought

ENCINA(8)  —  Maintenance

NAME

sfsadmin add index - adds a secondary index to the specified file

SYNOPSIS

sfsadmin add index -server servername filename indexname [-inactive] [-unique] [-alternaterecord nrecordfields {{fieldname fieldtype [fieldsize]}...}] nindexfields {{fieldname [-descending]}...} [-excludedkey nindexfields {{fieldname fieldvalue}...}] [-volume volume] [-preallocate npages]

ARGUMENTS

-server servername Specifies the name of the file server. The name must be registered with the DCE Directory Service. If the -server option is not specified, the default is the server defined by the environment variable ENCINA_SFS_SERVER. 

filename Specifies the name of the file to which the index will be added. 

indexname Specifies the name of the new index. 

[-inactive] Specifies that the index will be inactive until it is rebuilt with the sfsadmin rebuild index command. An inactive index cannot be used to retrieve records in the file. If the -inactive option is not specified, the index is active. 

[-unique] Specifies that key values for this index must be unique. If the -unique option is not specified, duplicate key values are allowed for the index. 

[-alternaterecord nrecordfields {{fieldname fieldtype [fieldsize]}...}]

Names the alternate record specification from which to derive the index key fields. This option allows the secondary index to use record structures that are different from the primary record that was specified when the file was created. Only fields of type byteArray in the primary record specification can be reinterpreted. The individual field lengths must add up to the length of the byte array. Other field types in the alternate record specification should map to fields in the primary record specification of the same type and offsets. When adding an index for files not originally created in SFS, only fields of type byteArray in the primary record specification can be used as index fields. 

Specify the number of key fields in the alternate record specification as nrecordfields. For each key field, specify the name of the field as fieldname and the type of the field as fieldtype. Possible field types include: unsignedInt16, signedInt16, unsignedInt32, unsignedInt64, signedInt64, decimal, float, double, timestamp, string fieldsize, byteArray fieldsize, varLenByteArray fieldsize, shortVarLenByteArray fieldsize, nlsString fieldsize. Where noted, you must specify fieldsize. When strings of the type nlsString are used as index fields, the collating sequence is determined by the value of the -c option on the sfs command line. If that option is not specified, any field of nlsString type is treated as an invalid type. 

nindexfields {{fieldname [-descending ]...}}
Specifies the number of fields in the new index and their names. Specify the number of fields in the index as nindexfields. For each field, specify the name of the field as fieldname. The option -descending specifies that the field will be sorted in descending order. If -descending is not specified, field values are sorted in ascending order. 

[-excludedkey nindexfields {{fieldname fieldvalue}...}]
Specifies the key value to be excluded from the new index. Records with this key value will not be inserted into the index and will not be accessible through the secondary index. Specify the number of field values to be excluded as nindexfields, the name of the field to be excluded as fieldname, and its value as fieldvalue. If the -excludedkey option is not specified, all key values are included in the index. 

[-volume volume ] Specifies the name of the volume on which the new index will reside. If the -volume option is not specified, the index will reside on the same volume as the primary area of the file. 

[-preallocate npages] Specifies the number of pages to be reserved for the index. The size of a page is 4096 bytes. If the -preallocate option is not specified, the default value of npages is zero. 

DESCRIPTION

The sfsadmin add index command creates a secondary index for a file and stores it on the volume where the file’s primary area resides (but in a separate area called the secondary area). By default the index is active and duplicate key values are allowed. A file can have zero or more secondary indices. Because each secondary index is stored in an area separate from the primary area that it references, secondary indices can be stored on different volumes and used to access the primary area simultaneously. 

The names of files, fields, and indices can be any sequence of null-terminated characters and must follow these rules:

File names cannot contain the slash (/) character, and must be less than or equal to 254 characters. 

Field and index names must be less than or equal to 32 characters. 

EXAMPLE

The following command adds a secondary index named zipCodeIndex to the file Accounts. The zipCodeIndex index contains one key: the zipCode field. 

% sfsadmin add index Accounts zipCodeIndex 1 zipCode

PRIVILEGE REQUIRED

Encina SFS administer (A), exclusive open (E), and query (Q) permissions on the file

RELATED INFORMATION

sfsadmin create clusteredfile

sfsadmin create relativefile

sfsadmin create sequentialfile

sfsadmin deactivate index

sfsadmin delete index

sfsadmin expand index

sfsadmin query index

sfsadmin rebuild index

sfsadmin rename index

 

  —  March 1997

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026