Oracle ConText Cartridge Administrator's Guide Release 2.0 A54628_01 |
|
This chapter provides reference information for using the executables and utilities provided with ConText.
The executables and utilities discussed in this chapter are:
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.
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. |
The syntax for executable ctxsrv or ctxsrvx is:
ctxsrv|ctxsrvx -user ctxsys/passwd[@sqlnet_address] [-personality RQDML] [-logfile log_name] [-sqltrace]
where:
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.
specifies the personality mask for the ConText server started by ctxsrv/ctxsrvx. The possible values can be any combination of:
The default is QDM.
specifies the name of a log file to which the ConText server writes all session information and errors.
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. |
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.
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.
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:
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.
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. |
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. |
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. |
Terminates ctxctl and returns you to the command-line of the host machine.
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
The ctxload utility can be used to perform the following operations:
Use ctxload to load text from a load file into a LONG or LONG RAW column in a table.
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. |
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. |
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]
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.
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. |
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.
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.
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.
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. |
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. |
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.
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.
Specifies the number of rows (documents) that are inserted into the table before a commit is issued to the database. The default is 1.
Specifies that non-NLS messages can appear on standard output.
The following conditions apply to the command-line syntax:
-separate
option
-separate
option) is faster, in general, than loading text embedded in the load file
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
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
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
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:
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:
is the name of a column that will store structured data for the document.
is the structured data that will be stored in the column specified in col_name.
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.
indicates the end of the document.
The following conditions apply to the structure of the load file:
The following conditions apply to the syntax utilized in the text load file:
Note:
The entire value for doc_data does not have to be on the same line as the col_name; only the beginning of the value and the col_name must share the same line. |
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>
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 |
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:
is a word or phrase that is defined as having synonyms, broader terms, narrower terms, and/or related terms.
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.
are markers that indicate the relationship between the phrase and its synonyms (SYN), as well as the preferred synonym (USE) for the phrase.
is the marker that indicates the relationship between phrase and its related terms.
is the marker that indicates the following text is a scope note (i.e. comment) for the preceding entry.
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.
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.
is a word or phrase that has the same meaning for phrase. For example, the word elephant could have a synonym of pachyderm.
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. |
The following conditions apply to the structure of the entries in the import file:
For example: cranes (birds), cranes (lifting equipment)
Example of Incorrect SN usage:
VIEW CAMERAS SN Cameras with through-the lens focusing and a range of movements of the lens plane relative to the film plane
Example of Correct SN usage:
VIEW CAMERAS SN Cameras with through-the lens focusing and a SN range of movements of the lens plane relative SN to the film plane
The following conditions apply to the relationships defined for the entries in the import file:
Example of incorrect RT usage:
MOVING PICTURE CAMERAS NT CINE CAMERAS TELEVISION CAMERAS
Example of correct RT usage:
MOVING PICTURE CAMERAS RT CINE CAMERAS RT TELEVISION CAMERAS
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
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
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.