Oracle Context Option Administrator's Guide Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index



Go to previous file in sequence Go to next file in sequence

CHAPTER 2. Administering ConText Option


This chapter provides details on how to administer ConText Option users, servers, and queues from the command-line.

The process of administering ConText Option can be divided into three main tasks:

Management of ConText Option users can be performed by any Oracle DBA user or the CTXSYS user. Management of ConText servers and queues is performed by the CTXSYS user.

Note: Many of the ConText server and queue administration tasks can be performed from the administration tool. These tasks are noted throughout the chapter.

Managing Users

Figure 2 - 1. User Administration Tasks

This section provides details for performing the following user administration tasks from the command-line:

Creating ConText Option Users

ConText Option provides a pre-defined Oracle user called CTXSYS for performing system and database administration.

To create additional Oracle users for ConText Option, login to SQL*Plus as an Oracle DBA and use the SQL command CREATE USER.

For example:

	create user app_dev
	identified by 123abc
	default tablespace app_tables;

Note: Do not use PL/SQL and SQL reserved words as the usernames for the users. In addition, certain words, such as ASCII, HTML, BLASTER, and FILTER, are used internally by ConText Option and, consequently, should not be used by themselves as usernames; however, they can be combined with other words to create descriptive usernames.

For more information about creating Oracle users, see Oracle7 Server SQL Reference.

Granting ConText Roles to Users

To assign one or more ConText roles to a user, login to SQL*Plus as an Oracle DBA and use the SQL command GRANT.

For example:

	grant ctxapp to app_dev

Note: The CTXADMIN role should only be assigned to the CTXSYS user.

For more information about the ConText roles, see "ConText Roles" in "Administration Concepts (Chapter 1)."

For more information about granting roles to users, see Oracle7 Server SQL Reference.

Note: In addition, ConText roles can be granted to users through the GUI administration tool.

Granting EXECUTE Privileges to Users

For ConText Option users to call procedures from within their own stored procedures and triggers, you must explicitly grant to each user EXECUTE privileges for the PL/SQL packages that contain the procedures.

To grant EXECUTE privileges to users, login to SQL*Plus as CTXSYS and use the GRANT command.

For example:

	grant execute on ctx_query to ctxdev;

In this example, CTXSYS grants EXECUTE privileges to the user CTXDEV for all the stored procedures in the CTX_QUERY package.

The ConText Option packages which users may need EXECUTE privileges for are:

For more information about the CTX_QUERY and CTX_LING packages, see Oracle ConText Option Application Developer's Guide.

For more information about granting privileges to users, see Oracle7 Server SQL Reference.

Managing ConText Servers

Figure 2 - 2. ConText Server Administration Tasks

This section provides details for performing the following ConText server administration tasks from the command-line:

Note: You can also use the administration tool to view the status of currently running ConText servers, change the personality mask for a server, and shut down servers.

Starting ConText Servers

To start a ConText server, run the ctxsrv executable from the command-line of the server machine.

For example:

	ctxsrv -user ctxsys/ctxsys_passwd -personality QDML

Note: The userid specified for -user must be CTXSYS and the password must be the password for CTXSYS. Only CTXSYS can start ConText servers.

You can also use the ctxctl utility to start ConText servers. To start the ctxctl utility, type the following command on the command-line for the server machine:

	ctxctl

The ctxctl utility provides a command-line where you can start, shut down, and view the status of your ConText servers.

Suggestion: If your machine supports running multiple ConText servers, to prevent contention between text operations, you should start one or more servers with the Query, DDL, and DML personalities, and one or more separate servers with the Linguistic and Loader personalties.

In addition, the Linguistic personality is only required for generating linguistic output. Once the output has been generated, the separate Linguistic server(s) could be shut down.

For more information about using ctxsrv and ctxctl, see "ctxsrv/ctxsrvx Executable" and "ctxctl Utility" in "Utilities and Executables (Chapter 8)."

Viewing the Status of ConText Servers

You can view the status of currently running ConText servers using the ctxctl utility. You can also use the CTX_SERVERS view to monitor the status of ConText servers.

For example, to view all the currently running ConText servers using CTX_SERVERS, you can use the following SQL statement:

	column ser_name format a30
	select ser_name, ser_status, ser_started_at
	from ctx_all_servers;

If a ConText server is running, the query will display results similar to the following output:

SER_NAME             SER_STAT SER_START
-------------------- -------- ---------
DRSRV_1120           IDLE     18-MAR-96

Changing the Personality Masks of ConText Servers

To change the personality mask for a ConText server, use the CTX_ADM.CHANGE_MASK procedure.

For example:

	execute ctx_adm.change_mask('DRSRV_1120' , 'QD')

This example shows a personality mask consisting of the Query (Q) and DDL (D) personalities replacing the existing personality mask for the ConText server.

Also, in this example, DRSRV_1120 is the ID (name) for the ConText server. A server ID is generated automatically when you start up a ConText server. You can use the ctxctl utility or the CTX_SERVERS view to obtain the ID for a ConText server.

Shutting down ConText Servers

To shut down a ConText server, use the PL/SQL procedure CTX_ADM.SHUTDOWN.

For example:

	execute ctx_adm.shutdown ('DRSRV_1120', 1)

In this example, DRSRV_1120 is the ID (name) of the ConText server and the shutdown method is 1 (immediate). An ID is generated automatically when you start up a ConText server. You can use the ctxctl utility or the CTX_SERVERS view to obtain the ID for a ConText server.

Note: You do not need to specify a server identifier when calling CTX_ADM.SHUTDOWN. If you do not specify an identifier, CTX_ADM.SHUTDOWN shuts down all currently running ConText servers. For example:

execute ctx_adm.shutdown

You can also use the ctxctl utility to shutdown ConText servers.

A ConText server performs the following tasks before shutting down:

Managing ConText Option Queues

Figure 2 - 3. Queue Administration Tasks

This section provides details for performing the following ConText server administration tasks from the command-line:

Viewing the DML Queue

You can view the status of requests in the DML Queue, using a number of views provided with ConText Option:

You can use the following views to monitor requests in the DML Queue:

For more information about the structure of the DML Queue views, see "ConText Queue Views."

Viewing the Services Queue

To view the status of requests in the Services Queue, you can use the CTX_SVC.REQUEST_STATUS function.

For example:

	variable status varchar2
	execute :status := ctx_svc.request_status(3341)
	print status

In this example, a variable named STATUS is defined and REQUEST_STATUS is called to return the status of the request with handle 3341.

A handle is generated automatically when a request is submitted to the Services Queue using CTX_LING.SUBMIT.

Removing Requests from the Services Queue

You can remove pending and errored requests in the Services Queue using procedures in the CTX_SVC package.

Pending Requests

To remove a request with a status of PENDING, use the CTX_SVC.CANCEL procedure.

For example:

	execute ctx_svc.cancel(3341)

In this example, the request with handle ID 3341 is removed from the Services Queue.

Errored Requests

To remove a request with a status of ERROR, use the CTX_SVC.CLEAR_ERROR procedure.

For example:

	execute ctx_svc.clear_error(3341)

In this example, the request with handle ID 3341 is removed from the Services Queue.

Suggestion: To remove all requests with a status of ERROR from the queue, specify a 0 (zero) handle when calling CLEAR_ERROR. For example:

execute ctx_svc.clear_error(0)

Enabling and Disabling Queues

You can enable or disable the following queues in the Text Request Queue:

If a queue is disabled, pending requests in the queue are not processed by ConText servers.

Note: A disabled queue continues to accept requests. The queues should be monitored regularly to prevent an excessive backlog of pending requests.

To enable or disable a queue, use the CTX_ADM.UPDATE_QUEUE_STATUS procedure.

For example:

	execute ctx_adm.update_queue_status('DML_QUEUE', 'ENABLE_QUEUE')
	execute ctx_adm.update_queue_status('TEXT_QUEUE', DISABLE_QUEUE')

In the first example, the DML Queue is enabled, which allows entries in the queue to be processed by ConText servers.

In the second example, the Text Queue (DDL and Query pipes) is disabled, which prevents all text queries and DDL requests from being processed by ConText servers.

For more information about disabling and enabling queues, see "CTX_ADM" in "PL/SQL Packages (Chapter 10)."




Go to previous file in sequence Go to next file in sequence
Prev Next
Oracle
Copyright © 1996 Oracle Corporation.
All Rights Reserved.
Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index