Oracle ConText Cartridge Administrator's Guide
Release 2.0

A54628_01

Library

Product

Contents

Index

Prev Next

9
Executables and Utilities

This chapter provides reference information for using the executables and utilities provided with ConText.

The executables and utilities discussed in this chapter are:

ctxsrv/ctxsrvx Executables

The ctxsrv and ctxsrvx executables start ConText servers. You execute ctxsrv or ctxsrvx for each ConText server that you want to start.

Note:

ctxsrv and ctxsrvx can only be executed by the Oracle user, CTXSYS.  

The ctxsrvx executable starts a ConText server with the Linguistic Services disabled. The executable for ctxsrvx is considerably smaller than ctxsrv, resulting in less memory required to run the executable.

Note:

A ConText server started by ctxsrvx will process all requests, except requests for Linguistic Services (document themes or Gists). If you want to process requests for Linguistic Services, use ctxsrv.

In addition, if you want to generate theme indexes or perform theme queries, do not use ctxsrvx to start ConText server processes.  

You can also use the ctxctl utility to start and shut down ConText servers

See Also:

For more information about the CTXSYS user, see "CTXSYS User" in Chapter 2, "Administration Concepts".

For more information about ctxctl, see "ctxctl Utility" in this chapter.  

.

Syntax

The syntax for executable ctxsrv or ctxsrvx is:

ctxsrv|ctxsrvx -user ctxsys/passwd[@sqlnet_address]
              [-personality RQDML]
              [-logfile log_name]
              [-sqltrace]

where:

-user

specifies the username and password for the Oracle user CTXSYS.

The username and password may be immediately followed by @sqlnet_address to permit logon to remote databases. The value for sqlnet_address is a database connect string. If the TWO_TASK environment variable is set to a remote database, you do not have to specify a value for sqlnet_address to connect to the database.

Note:

If you do not specify user in the ctxsrv/ctxsrvx command-line, you are prompted by ConText to enter the required information in the format: 'CTXSYS/password' where password is the password for CTXSYS.

This is useful if you wish to mask the CTXSYS password from other users of the machine on which the ConText server is running.  

-personality

specifies the personality mask for the ConText server started by ctxsrv/ctxsrvx. The possible values can be any combination of:

The default is QDM.

Note:

Oracle does not recommend assigning all the personalities to a single ConText server. This will result in the server bearing the majority of the processing load.

In addition, if you choose to execute ctxsrvx, do not specify a Linguistic personality in the command-line. If you do, the ConText server will start up; however, it will not process requests for the Linguistic Services.  

-logfile

specifies the name of a log file to which the ConText server writes all session information and errors.

-sqltrace

enables the ConText server to write to a trace file in the directory specified by the USER_DUMP_DEST initialization parameter.

Before you specify -sqltrace for ctxsrv or ctxsrvx, you should specify a value for USER_DUMP_DEST in your initsid.ora file.

See Also:

For more information about SQL trace and the USER_DUMP_DEST initialization parameter, see Oracle8 Server Administrator's Guide.  

Examples

The following example starts a linguistically-disabled ConText server with a Query and DDL personality mask and writes all server messages to a file named ctx.log:

ctxsrvx -user ctxsys/ctxsys -personality QD -log ctx.log &

Note:

In this example, the server is run as a background process in a UNIX-based environment. This is useful if you need to use the window/screen from which you started the server for other tasks.  

The following example starts a linguistically-enabled ConText server with a Linguistic personality and writes all server messages to a file named ctx.log. Because -user is not specified, ConText prompts you to enter a user:

ctxsrv -personality L -log ctx.log

...
ConText: Release 2.0.6.0.0 - Production on Sat Jun  7 14:06:26 1997
...
Copyright (c) Oracle Corporation 1979, 1996.  All rights reserved.
...
Enter user:

At the prompt, enter 'CTXSYS/password', where password is the password assigned to the CTXSYS user.

Note:

In this example, the process is not run in the background.

In environments where you can run processes in the background, if you do not specify -user in the ctxsrv/ctxsrvx command-line, you must run the server process in the foreground or pass a value for user to ctxsrv/ctxsrvx from an operating system file.

For example:

ctxsrv -personality L -log ctx.log < pword.txt

The file must contain a single line consisting of the following text: 'CTXSYS/password'

If you pass a value to ctxsrv/ctxsrvx from a file, ConText does not prompt you to enter a user.  


ctxctl Utility

The ctxctl utility is a shell script that can be used to start up and shut down ConText servers on the system from which you run ctxctl. It can also be used to check the status of all the ConText servers currently running on the system.

Note:

If both of the ctxsrv and ctxsrvx executables are available, the ctxctl utility starts ConText servers using the ctxsrvx executable. In this case, if you want to start up a ConText server using ctxsrv, you must run the ctxsrv executable directly from the server machine command-line.  

Syntax

To start ctxctl, at the operating system prompt, type:

ctxctl

Once ctxctl is running, you can issue the following commands from the ctxctl command prompt:

help [command]

Provides online help for the specified command. If called without a command, it provides a list of all the commands you can use in ctxctl.

status

Provides a list of all the ConText servers and their personality masks currently running on the server host.

Note:

The ConText servers listed in the status output may be connected to different database instances.  

start n [load query ddl dml ling]

Starts n number of servers, each with the personalities specified. The personalities can be typed in any order, but must be typed in lowercase and exactly as they are named (e.g. load, query, ddl, dml, ling).

If you do not specify a personality, ctxctl starts the specified number of servers, each with the query, ddl, and dml personalities.

The first time you type the start command for a ctxctl session, ConText prompts you to enter the password for the ConText administrator (CTXSYS). After you enter the password, ConText starts the specified number of servers

Note:

The ConText server(s) are started on the host machine from which the start command is issued.  

.

stop pid | all

Shuts down the ConText server identified by pid or shuts down all ConText servers (all).

The status command can be used to obtain the pid for all currently running ConText servers.

Note:

ctxctl does not use CTX_ADM.SHUTDOWN to shut down the ConText server. Instead, it aborts the server process running on the host machine.  

quit | exit

Terminates ctxctl and returns you to the command-line of the host machine.

Examples

The following example starts two ConText servers, each with a DML, DDL, and Query personality mask:

command> start 2 query dml ddl

The following example shuts down a ConText server with a pid of 230454:

command> stop 23054

ctxload Utility

The ctxload utility can be used to perform the following operations:

Text Loading

Use ctxload to load text from a load file into a LONG or LONG RAW column in a table.

Suggestion:

If the target table does not contain a LONG or LONG RAW column or you do not want to load text into a LONG or LONG RAW column, you may want to use SQL*Loader to populate the table with text.  

A load file is an ASCII flat file that contains the plain text, as well as any structured data (title, author, date, etc.), for documents to be stored in a text table; however, in place of the text for each document, the load file can store a pointer to a separate file that holds the actual text (formatted or plain) of the document.

Note:

The ctxload utility does not support load files that contain both embedded text and file pointers. You must use one method or the other when creating a load file.  

The ctxload utility creates one row in the table for each document identified by a header in the load file.

See Also:

For more information about creating a load file for text loading, see "Structure of Text Load File" in this chapter.  

Thesaurus Importing and Exporting

Use ctxload to load a thesaurus from an import file into the ConText thesaurus tables.

An import file is an ASCII flat file that contains an entry for each synonym, broader term, and narrower term which can be used to expand queries.

ctxload can also be used to export a thesaurus by dumping the contents of the thesaurus into a flat file.

See Also:

For more information about creating an import file for thesaurus importing, see "Structure of Thesaurus Import File" in this chapter.  

Syntax

The syntax for running ctxload is:

ctxload -user username[/password][@sqlnet_address]
        -name object_name
        -file file_name
       [-thes]
       [-thesdump]
       [-separate]
       [-longsize n]
       [-date date_mask]
       [-log file_name]
       [-trace]
       [-commitafter n]
       [-verbose]

Mandatory Arguments

-user

Specifies the username and password of the user running ctxload.

The username and password can be followed immediately by @sqlnet_address to permit logon to remote databases. The value for sqlnet_address is a database connect string. If the TWO_TASK environment variable is set to a remote database, you do not have to specify a value for sqlnet_address to connect to the database.

-name

If ctxload is being used to load text, -name specifies the name of the table to be loaded. The table must be accessible to the user specified in the command-line.

If ctxload is being used to import a thesaurus, -name specifies the name of the thesaurus to be imported. The thesaurus name is used to specify the thesaurus to be used for expanding query terms in queries.

Note:

Thesaurus name must be unique. If the name specified for the thesaurus is identical to an existing thesaurus, ctxload returns an error and does not overwrite the existing thesaurus.  

If ctxload is being used to export a thesaurus, -name specifies the name of the thesaurus to be exported.

If a thesaurus is being loaded, -file specifies the name of the import file which contains the thesaurus entries.

If a thesaurus is being exported, -file specifies the name of the export file created by ctxload.

Note:

If the name specified for the thesaurus dump file is identical to an existing file, ctxload overwrites the existing file.  

Optional Arguments

-thes

Specifies that ctxload imports a thesaurus. The file from which it loads the thesaurus is specified by the -file argument. The name of the thesaurus to be imported is specified by the -name argument.

-thesdump

Specifies that ctxload exports a thesaurus. The name of the thesaurus to be exported is specified by the -name argument. The file into which the thesaurus is dumped is specified by the -file argument.

-separate

For text loading, specifies that the text of each document in the load file is actually a pointer to a separate text file. During processing, ctxload loads the contents of each text file into the LONG or LONG RAW column for the specified row.

-longsize

For text loading, specifies the maximum number of kilobytes to be loaded into the LONG or LONG RAW column. This argument may be necessary for loading separate data and to help reduce memory usage when loading smaller embedded data.

The minimum value is 1 (Kb, i.e. 1024 bytes) and the maximum value is machine-dependent. The default is 64 (Kb).

Note:

The value for -longsize must be entered as a numeric value. Do not include a 'K' or 'k' to indicate Kilobytes.  

-date

Specifies the TO_CHAR date format for any date columns loaded using ctxload.

See Also:

For more information about the available date format models, see Oracle8 Server SQL Reference.  

-log

Specifies the name of the log file to which ctxload writes any national-language supported (NLS) messages generated during processing. If you do not specify a log file name, the messages appear on the standard output.

-trace

Specifies that a server process trace file is enabled using 'ALTER SESSION SET SQL_TRACE TRUE'. This command captures all processed SQL statements in a trace file, which can be used for debugging purposes. The location of the trace file is operating-system dependent and may be modified using the USER_DUMP_DEST initialization parameter.

-commitafter

Specifies the number of rows (documents) that are inserted into the table before a commit is issued to the database. The default is 1.

-verbose

Specifies that non-NLS messages can appear on standard output.

Usage Notes

The following conditions apply to the command-line syntax:

Text Load Example

The following example loads documents from the reviews.txt load file into table docs for user jsmith. It also writes log information to a file called log2.out. Because -commitafter was not specified, each row (document) is committed to the database after it is inserted into the docs table.

Also, because -separate was not specified, ctxload expects the text for each document to be embedded in the reviews.txt file.

ctxload -user jsmith/123abc -name docs -file 	review.txt -log log2.out

Thesaurus Import Example

The following example imports a thesaurus named tech_doc from an import file named tech_thesaurus.txt:

ctxload -user jsmith/123abc -thes -name tech_doc -file 	tech_thesaurus.txt

Thesaurus Export Example

The following example dumps the contents of a thesaurus named tech_doc into a file named tech_thesaurus.out:

ctxload -user jsmith/123abc -thesdump -name tech_doc -file tech_thesaurus.out

Structure of Text Load File

The load file must use the following format for each document, as well as any structured data associated with the document:

<TEXTSTART: col_name1=doc_data, col_name2=doc_data,...col_nameN=doc_data>
text. . . 
<TEXTEND>

where:

<TEXTSTART: ... >

is a header marker that indicates the beginning of a document. It also may contain one or more of the following fields used to specify structured data for a document:

col_name

is the name of a column that will store structured data for the document.

doc_data

is the structured data that will be stored in the column specified in col_name.

text

is the text of the document to be loaded or the name (and location, if necessary) of an operating system file containing the text to be loaded.

<TEXTEND>

indicates the end of the document.

Load File Structure

The following conditions apply to the structure of the load file:

Load File Syntax

The following conditions apply to the syntax utilized in the text load file:

Example of Embedded Text in Load File

The following example illustrates a correctly formatted text load file containing structured employee information, such as employee number (1000, 1024) and name (Joe Smith, Mary Jones), and the text for each document, which, in this case, is resume:

<TEXTSTART: EMPNO=1000, ELNAME='Smith', EFNAME='Joe'>
Joe has an interesting resume, includes...cliff-diving.
<TEXTEND>
<TEXTSTART: EMPNO=1024, EFNAME='Mary', ELNAME='Jones'>
Mary has many excellent skills, including...technical,
marketing, and organizational.  Team player.
<TEXTEND>

Example of File Name Pointers in Load File

The following example illustrates a correctly formatted text load file containing structured employee information, such as employee number (1000, 1024) and name (Joe Smith, Mary Jones), and a file name pointer for each document.

<TEXTSTART: EMPNO=1024, EFNAME='Mary', ELNAME='Jones'>
mjones.doc
<TEXTEND>
<TEXTSTART: EMPNO=1000, EFNAME='Joe', EFNAME='Smith'>
jsmith.doc
<TEXTEND>

Note:

To use the load file in this example, you would have to specify the -separate argument when executing ctxload.  

Structure of Thesaurus Import File

The import file must use the following format for the entries in the thesaurus:

phrase
BT broader_term
NT narrower_term1
NT narrower_term2
. . .
NT narrower_termN
BTG broader_term
NTG narrower_term1
NTG narrower_term2
. . .
NTG narrower_termN
BTP broader_term
NTP narrower_term1
NTP narrower_term2
. . .
NTP narrower_termN
SYN synonym2
SYN synonym2
. . .
SYN synonymN
USE synonym1
RT related_term1
RT related_term2
. . .
RN related_termN
SN text

where:

phrase

is a word or phrase that is defined as having synonyms, broader terms, narrower terms, and/or related terms.

Note:

In compliance with ISO-2788 standards, a TT marker can be placed before a phrase to indicate that the phrase is the top term in a hierarchy; however, the TT marker is not required. In fact, ctxload ignores TT markers during import.

In ConText, a top term is identified as any phrase that does not have a broader term (BT, BTG, BTP).  

BT, BTG, BTP, NT, NTG, NTP

are markers that indicate the relationship between the phrase and its broader (generic|partitive) terms and narrower (generic|partitive) terms.

If an entry does not have a broader (generic|partitive) term, but has one or more narrower (generic|partitive) terms, the entry is created as a top term.

SYN, USE

are markers that indicate the relationship between the phrase and its synonyms (SYN), as well as the preferred synonym (USE) for the phrase.

RT

is the marker that indicates the relationship between phrase and its related terms.

SN

is the marker that indicates the following text is a scope note (i.e. comment) for the preceding entry.

broader_term

is a word or phrase that conceptually provides a more general description or category for phrase. For example, the word elephant could have a broader term of land mammal.

narrower_term

is a word or phrase that conceptually provides a more specific description for phrase. For example, the word elephant could have a narrower terms of indian elephant and african elephant.

synonym

is a word or phrase that has the same meaning for phrase. For example, the word elephant could have a synonym of pachyderm.

related_term

is a word or phrase that has a meaning related to, but not necessarily synonymous with phrase. For example, the word elephant could have a related term of wooly mammoth.

Note:

Related terms are not transitive. If a phrase has two or more related terms, the terms are related only to the parent phrase and not to each other.  

Import File Structure for Terms

The following conditions apply to the structure of the entries in the import file:

Import File Structure for Relationships

The following conditions apply to the relationships defined for the entries in the import file:

Example 1 of Import File

The following example illustrates a correctly formatted thesaurus import file:

cat
SYN feline
cat
NT domestic cat
NT wild cat
BT mammal
mammal
BT animal
domestic cat
NT persian cat
NT siamese cat
wild cat
NT bengal tiger
dog
BT mammal
NT domestic dog
NT wild dog
SYN canine

Example 2 of Import File

The following example illustrates a correctly formatted thesaurus import file:

35MM CAMERAS
BT MINIATURE CAMERAS
CAMERAS
BT OPTICAL EQUIPMENT
NT MOVING PICTURE CAMERAS
NT STEREO CAMERAS
LAND CAMERAS
USE VIEW CAMERAS
VIEW CAMERAS
SN Cameras with through-the lens focusing and a range of 
SN movements of the lens plane relative to the film plane
UF LAND CAMERAS
BT STILL CAMERAS

Loading Text into External Data Store Columns

The ctxload utility is best suited for loading text into columns that utilize the direct data store for storing text. However, if you use the external data store (i.e. in your text column, you store pointers to documents in your file system), you can use ctxload to load the file pointers.

To use ctxload with external data store columns, the following conditions must exist:

For example:

<TEXTSTART: EMPNO=1010, ENAME='Mary Jones'>
mjones.pdf
<TEXTEND>

In this example, the file name mjones.pdf will be loaded into the LONG column for the table and the structured employee information, such as employee number (1010) and name (Mary Jones), will be loaded into the specified columns.

Suggestion:

Because a LONG column is an inefficient means of storing file pointers, you probably do not want to use ctxload to load file pointers into columns that use the external data store. You may want to consider using SQL*Loader to load the file pointers instead.  




Prev

Next
Oracle
Copyright © 1997 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index