Administration: Omnidex Fundamentals

Omnidex Environments

Deploying Environments

An Omnidex Environment is usually prepared while it is in a non-production environment, and then deployed into a production environment. Deployment can be as simple as copying the directory structure that contains the Omnidex Environment File, the data files and the Omnidex indexes. These should be copied together so that they remain in sync.

Omnidex Environments usually include file locations, such as the Index Directory and the Physical location of data files. To allow Omnidex Environments to be as portable as possible, they should contain relative paths rather than absolute paths, or should reference environment variables.

Using Relative Paths

The following example uses relative paths, meaning that all file locations will be relative to the “current working directory”. This allows the environment to be easily copied to different locations.

> create environment
>>  in                   "simple.xml"
>>  with                 delete;
Environment created in simple.xml
>
>
> create database       "SIMPLE"
>>   type                FILE
>>   index_directory     "idx"
>>  in                   "simple.xml";
Database SIMPLE created in simple.xml
>
>
> create table          "HOUSEHOLDS"
>>  physical             "dat/households.dat"
>>  (
>>   "HOUSEHOLD"         CHARACTER(12)     omnidex,
>>   "ADDRESS"           CHARACTER(50)     quicktext,
>>   "CITY"              CHARACTER(28)     quicktext,
>>   "STATE"             CHARACTER(2)      omnidex,
>>   "ZIP"               CHARACTER(5)      omnidex,
>>   "COUNTRY"           CHARACTER(2)      omnidex,
>>   constraint HOUSEHOLDS_HOUSEHOLD_PK primary ("HOUSEHOLD")
>>  )
>>  in                   "simple.xml";
Table HOUSEHOLDS created in simple.xml
>
>
> create table          "INDIVIDUALS"
>>  physical             "dat/individuals.dat"
>>  (
>>   "INDIVIDUAL"        CHARACTER(12)     omnidex,
>>   "HOUSEHOLD"         CHARACTER(12)     omnidex,
>>   "NAME"              CHARACTER(50)     quicktext,
>>   "GENDER"            CHARACTER(1)      omnidex bitmap,
>>   "BIRTHDATE"         ANSI DATE         omnidex,
>>   "PHONE"             CHARACTER(14)     omnidex,
>>   "EMAIL"             CHARACTER(60)     quicktext,
>>   constraint INDIVIDUALS_INDIVIDUAL_PK primary ("INDIVIDUAL"),
>>   constraint INDIVIDUALS_HOUSEHOLD_FK foreign ("HOUSEHOLD") references "HOUSEHOLDS"
>>  )
>>  in                   "simple.xml";
Table INDIVIDUALS created in simple.xml

Using Environment Variables

The following example uses an environment variable called “APPLICATION_HOME”, meaning that all file locations will be relative to the directory contained in that environment variable. This also allows the environment to be easily copied to different locations and only requires that the environment variable be changed.

> create environment
>>  in                   "{$APPLICATION_HOME/simple.xml}"
>>  with                 delete;
Environment created in simple.xml
>
>
> create database       "SIMPLE"
>>   type                FILE
>>   index_directory     "{$APPLICATION_HOME/idx}"
>>  in                   "{$APPLICATION_HOME/simple.xml}";
Database SIMPLE created in simple.xml
>
>
> create table          "HOUSEHOLDS"
>>  physical             "{$APPLICATION_HOME/dat/households.dat}"
>>  (
>>   "HOUSEHOLD"         CHARACTER(12)     omnidex,
>>   "ADDRESS"           CHARACTER(50)     quicktext,
>>   "CITY"              CHARACTER(28)     quicktext,
>>   "STATE"             CHARACTER(2)      omnidex,
>>   "ZIP"               CHARACTER(5)      omnidex,
>>   "COUNTRY"           CHARACTER(2)      omnidex,
>>   constraint HOUSEHOLDS_HOUSEHOLD_PK primary ("HOUSEHOLD")
>>  )
>>  in                   "{$APPLICATION_HOME/simple.xml}";
Table HOUSEHOLDS created in simple.xml
>
>
> create table          "INDIVIDUALS"
>>  physical             "{$APPLICATION_HOME/dat/individuals.dat}"
>>  (
>>   "INDIVIDUAL"        CHARACTER(12)     omnidex,
>>   "HOUSEHOLD"         CHARACTER(12)     omnidex,
>>   "NAME"              CHARACTER(50)     quicktext,
>>   "GENDER"            CHARACTER(1)      omnidex bitmap,
>>   "BIRTHDATE"         ANSI DATE         omnidex,
>>   "PHONE"             CHARACTER(14)     omnidex,
>>   "EMAIL"             CHARACTER(60)     quicktext,
>>   constraint INDIVIDUALS_INDIVIDUAL_PK primary ("INDIVIDUAL"),
>>   constraint INDIVIDUALS_HOUSEHOLD_FK foreign ("HOUSEHOLD") references "HOUSEHOLDS"
>>  )
>>  in                   "{$APPLICATION_HOME/simple.xml}";
Table INDIVIDUALS created in simple.xml

Additional Resources

See also:

 
Back to top
admin/basics/environments/deploy.txt · Last modified: 2016/06/28 22:38 (external edit)