ADD_SOURCE
The DBMS_SEARCH.ADD_SOURCE procedure adds one or more data sources (tables or views) from different schemas to the DBMS_SEARCH index.
Syntax
DBMS_SEARCH.ADD_SOURCE (
index_name VARCHAR2,
source_name VARCHAR2,
memory VARCHAR2 DEFAULT NULL,
parallel_degree NUMBER DEFAULT NULL);
Note: TheDBMS_SEARCH.ADD_SOURCE procedure has been upgraded in version
23.9 to support memory and parallel_degree parameters. These parameters are not available for use in earlier release versions.
index_name
Specify name of the index to which you want to add the table or view. You can also specify [schema].index_name.
source_name
Specify name of the table, view, or Duality view to add to the index. You can also specify [schema].table_or_view_name.
memory
Specify the amount of memory allocated for indexing of the added data source.
Note: Total memory usage is determined by multiplying the memory parameter by the parallel_degree.
parallel_degree
Specify the degree of parallelism used for indexing the added data source.
Notes
-
To add a data source, the index owner must have
SELECTandDMLaccess to the source. The user also must have theCTXAPPprivilege. -
All the data sources (such as table, view, or each table in the view definition) that are added to the
DBMS_SEARCHindex must include at least onePrimary Keycolumn. Each table that is part of a view source having a foreign key must also have theForeign Keyconstraint, referencing the relevant primary keys defined on the table.Defining a primary key for the source table is mandatory.
-
The
DBMS_SEARCHindex stores all supported SQL data types (includingObject Typecolumns) in JSON objects, except for theXMLTYPEandLONGdata types. This means that you cannot add a table or view as a data source to the index if it has a column with theXMLTYPEorLONGdata type. The maximum allowed length of a JSON data type is 32 megabytes. -
You can use the
USER_DBMS_SEARCH_INDEX_SOURCESandALL_DBMS_SEARCH_INDEX_SOURCESdictionary views to query information about the data sources that are added to yourDBMS_SEARCHindexes.
Examples
exec DBMS_SEARCH.ADD_SOURCE('MYINDEX','MYTABLE');
exec DBMS_SEARCH.ADD_SOURCE('MYINDEX','MYVIEW');
exec DBMS_SEARCH.ADD_SOURCE('DOCUSER.MYINDEX','DOCUSER.MYTABLE');
Related Topics