Oracle8
ConText Cartridge Administrator's Guide
Release 2.4 A63820-01 |
|
This chapter provides reference information for using the
PL/SQL packages provided with ConText to administer ConText servers and
queues, as well as to obtain product information about ConText.
The topics covered in this chapter are:
The CTX_ADM PL/SQL package is used to manage ConText servers
and queues.
CTX_ADM contains the following stored procedures and functions:
The CHANGE_MASK procedure changes the personality mask of
the specified ConText server.
CTX_ADM.CHANGE_MASK(name IN VARCHAR2 personality_mask IN VARCHAR2 DEFAULT 'QDM');
Specify the name (internal identifier) of the server for which you are changing the personality mask.
Specify the new personality mask that you want to assign to the server. Can be any combination of:
execute ctx_adm.change_mask('DRSRV_8025', 'D')
The names of all currently running ConText servers can be
obtained from the CTX_SERVERS or CTX_ALL_SERVERS
views.
The GET_QUEUE_STATUS function returns the status of the specified
ConText queue.
CTX_ADM.GET_QUEUE_STATUS(qname IN VARCHAR2) RETURN VARCHAR2;
Specify the queue/pipe for which you want to return the status:
Status of the queue, which is one of the following:
The specified queue is enabled.
The specified queue is disabled.
declare status varchar2(8); begin status := ctx_adm.get_queue_status('DML_QUEUE'); end;
A status of DISABLED indicates the queue or pipe is inactive
and requests in the queue will not be processed by any of the available
ConText servers.
When a queue or pipe has a status of DISABLED, the queue
continues to accept requests. The ConText administrator should regularly
monitor the status of the queues and pipes to prevent accumulation of requests
in disabled queues.
To enable a disabled queue, you must call CTX_ADM.UPDATE_QUEUE_STATUS.
The RECOVER procedure deletes all database objects for text
tables that have been deleted without first dropping the index or policies
for the tables.
CTX_ADM.RECOVER;
execute ctx_adm.recover
ConText Servers automatically perform recovery approximately
every fifteen minutes. CTX_ADM.RECOVER provides a method for users to manually
perform recovery on command.
The SET_QUERY_BUFFER_SIZE procedure sets the size of the
database pipe used for queries.
CTX_ADM.SET_QUERY_BUFFER_SIZE(buffer_size IN NUMBER);
Specify the size, in bytes, of the query buffer.
execute ctx_adm.set_query_buffer_size(100000);
The default size of the buffer is 8192 bytes.
CTX_ADM.SET_QUERY_BUFFER_SIZE can only be used to increase
the size of the buffer from the default size.
The SHUTDOWN procedure shuts down the specified ConText server.
CTX_ADM.SHUTDOWN(name IN VARCHAR2 DEFAULT 'ALL', sdmode IN NUMBER DEFAULT NULL);
Specify the name (internal identifier) of the ConText server
to shutdown.
Default is ALL.
Specify the shutdown mode for the server:
execute ctx_adm.shutdown('DRSRV_3321', 1)
If you do not specify a ConText server to shut down, CTX_ADM.SHUTDOWN
shuts down all currently running ConText servers.
The names of all currently running ConText servers can be
obtained from the CTX_SERVERS view.
The UPDATE_QUEUE_STATUS procedure is used to change the status
of the specified ConText queue (Text, DML, or Services).
For example, the GET_QUEUE_STATUS returns a status of DISABLED
for one of the queues. Once the error that caused the queue to become disabled
is cleared, UPDATE_QUEUE_STATUS can be called with an action of ENABLE_QUEUE
to reactivate the queue.
UPDATE_QUEUE_STATUS can also be used to control request processing
in the system. When you disable a queue, you prevent any currently running
ConText servers from picking up queued requests until you enable the queue.
CTX_ADM.UPDATE_QUEUE_STATUS(qname IN VARCHAR2, qstatus IN VARCHAR2 DEFAULT ENABLE_QUEUE);
Specify the queue or pipe for which you want to return the status:
Specify the action to perform on the queue:
execute ctx_adm.update_queue_status(ctx_adm.dml_queue,ctx_adm.enable_queue)
A queue with a status of DISABLED will remain inactive until
it is enabled using UPDATE_QUEUE_STATUS; however, the queue will continue
to accept requests. The ConText administrator should regularly monitor
the status of the queues and pipes to prevent accumulation of requests
in disabled queues.
Both qname and qstatus must be fully qualified
with the PL/SQL package name (CTX_ADM) as shown in the examples.
The CTX_SVC PL/SQL package is used to query requests in the
Services Queue and to manage the queue.
CTX_SVC contains the following stored procedures and functions:
The CANCEL procedure removes a request with a status of PENDING
from the Services Queue.
CTX_SVC.CANCEL(request_handle IN NUMBER);
Specify the handle, returned by CTX_LING.SUBMIT, of the service
request to remove.
execute ctx_svc.cancel(3321)
Requests with a status other than pending in the Services
Queue cannot be removed using CTX_SVC.CANCEL. To cancel requests that ConText
has not yet entered into the Services Queue, use CTX_LING.CANCEL.
See
Also:
For more information about the CTX_LING PL/SQL package, see Oracle8 ConText Cartridge Application Developer's Guide. |
The CANCEL_ALL procedure removes all requests with a status
of PENDING from the Services Queue.
CTX_SVC.CANCEL_ALL;
execute ctx_svc.cancel_all
The CANCEL_USER procedure removes all requests with a status
of PENDING for the current user from the Services Queue.
CTX_SVC.CANCEL_USER;
execute cancel
The CLEAR_ALL_ERRORS procedure removes all requests (text
indexing, theme indexing, and linguistics) that have a status of ERROR
in the Services Queue.
CTX_SVC.CLEAR_ALL_ERROR;
execute ctx_svc.clear_all_errors
The CLEAR_ERROR procedure can be used to remove a request
with a status of ERROR from the Services Queue.
CTX_SVC.CLEAR_ERROR(request_handle IN NUMBER);
Specify the handle, returned by CTX_LING.SUBMIT, of the errored
service request to remove.
See
Also:
For more information about SUBMIT and the CTX_LING PL/SQL package, see Oracle8 ConText Cartridge Application Developer's Guide. |
execute clear_error(214)
If you call CLEAR_ERROR with a 0 (zero) value for request_handle,
all requests with a status of ERROR in the Services Queue are removed.
Use the CTX_SVC.REQUEST_STATUS
function to return the status of a request in the Services Queue.
The CLEAR_INDEX_ERRORS procedure removes all indexing requests
that have a status of ERROR in the Services Queue.
CTX_SVC.CLEAR_INDEX_ERROR;
execute ctx_svc.clear_index_errors
The CLEAR_LING_ERRORS procedure removes all Linguistics requests
that have a status of ERROR in the Services Queue.
CTX_SVC.CLEAR_LING_ERROR;
execute ctx_svc.clear_ling_errors
The REQUEST_STATUS function returns the status of a request
in the Services Queue.
CTX_SVC.REQUEST_STATUS(request_handle IN NUMBER, timestamp OUT DATE, errors OUT VARCHAR2) RETURN VARCHAR2;
Specify the handle of the service request, as returned by CTX_LING.SUBMIT.
Returns the time at which request was submitted.
Returns the error message stack for the request. The message
stack is returned only if the status of the request is ERROR.
See
Also:
For more information about SUBMIT and the CTX_LING PL/SQL package, see Oracle8 ConText Cartridge Application Developer's Guide. |
Status of the request, which is one of the following:
The request has not yet been picked up by a ConText server.
The request is being processed by a ConText server.
The request encountered an error (see errors argument).
The request completed successfully.
declare status varchar2(10); declare timestamp date; declare errors varchar2(60); begin status := ctx_svc.request_status(3461,timestamp,errors); dbms_output.put_line(status,timestamp,substr(errors,1,20); end;
Specifying an invalid value for request_handle causes
CTX_SVC.REQUEST_STATUS to return a status of SUCCESS.
The CTX_INFO PL/SQL package is used to obtain information
about the installed version of ConText.
CTX_INFO contains the following stored procedures and functions:
Name | Description |
---|---|
Returns the status and version number for the installed ConText |
|
Returns the status of ConText |
|
Returns the version number for the installed ConText |
The GET_INFO procedure calls the GET_VERSION and GET_STATUS
functions in CTX_INFO to return version and status information for ConText.
CTX_INFO.GET_INFO(product IN VARCHAR2, version OUT VARCHAR2, status OUT VARCHAR2);
Specify the product code for which information is returned. Currently, the only valid value for product is OCO.
Specify the version of the product.
Specify the status of the product.
set serveroutput on declare ver varchar2(20); stat varchar2(20); begin ctx_info.get_info('OCO', ver, stat); dbms_output.put_line ('Version is '||ver); dbms_output.put_line ('Status is '||stat); end;
The GET_STATUS function returns the product status for ConText.
CTX_INFO.GET_STATUS(product IN VARCHAR2) RETURN VARCHAR2;
Specify the product for which a status returned. Currently,
the only valid value for product is OCO.
The product status for ConText.
set serveroutput on declare stat varchar2(60); begin stat := ctx_info.get_status('OCO'); dbms_output.put_line ('Status is '||stat); end;
The GET_VERSION function returns the version number for ConText.
CTX_INFO.GET_VERSION(product IN VARCHAR2) RETURN NUMBER;
Specify the product for which a version number is returned.
Currently, the only valid value for product is OCO.
The version number for ConText.
set serveroutput on declare ver varchar2(20); begin ver := ctx_info.get_version('OCO'); dbms_output.put_line ('Version is '||ver); end;