How to find distinct words in Oracle Text index
We have a requirement to fetch all distinct words in the CLOB field for all records
and find the no. of records in which each word appears.
DR$<Index Name>$I table stores exactly such information. Is it ok to use this table in queries?
Are there any disadvantages in using it?
Help is very much appreciated.
the disadv -
with every sync index the contents will change.
with every release the structure may change without any prior information - your application may go bad.
It is not advisable to use them in your applications. For your own investigation etc you can always use its contents.
thanks
Similar Messages
-
How to find a word in select text?
if offer is in select text, i want display some message.
How can i find select text contains offer using JS?.
selObj.options[selIndex].text == "%offer%"Take a look at javascript's string functions or regular
expressions for more complex searches. Just remember javascript is
case sensitive.
http://www.w3schools.com/jsref/jsref_obj_string.asp
http://www.w3schools.com/jsref/jsref_obj_regexp.asp -
Command for "How to find Cursor Size" in Oracle Stored Procedure"
Hi
Can u tell me....
How to find Cursor Size" in Oracle Stored Procedure........
I want command for that........why don't you try select count(*) from your_table;That requires running the same query twice - or rather running two different queries twice. Besides it still doesn't guarantee anything, because Oracle's read consistency model only applies at the statement level (unless you're running in a serialized transaction).
This is such a common requirement - users are wont to say "well Google does it" - it seems bizarre that Oracle cannot do it. The truth is that that Google cheats. Firstly it guesses the number on the basis of information in its indexes and refines the estimate as pages are returned. Secondly, Google is under no onus to kepp all its data and indexes synchronized - two simultaneous and identical queries which touch different Google servers can return different results. Oracle Text works the same way, which is why we can get a count with CTX_QUERY.COUNT_HITS in estimate mode.
Cheers, APC
blog: http://radiofreetooting.blogspot.com
. -
"MS" reserved word in oracle text query?
Wondering if anyone has run into the string "MS" behaving as a reserved word in oracle text queries. For example, this specification returns all records from Texas:
'<query>
<textquery>
<progression>
<seq> TX WITHIN CUSTOMER_STATE </seq>
</progression>
</textquery>
</query>'
But this one does NOT find any results for Mississippi:
'<query>
<textquery>
<progression>
<seq> MS WITHIN CUSTOMER_STATE </seq>
</progression>
</textquery>
</query>'
I've confirmed we have data that should match, and I've tried escaping it with the sequences as described in the SQL docs (I've tried single quotes, pairs of single quotes, braces, and combinations of those) . And trying to find info on the web is tough since all web queries that contain 'MS' bring back tons of Microsoft-relevant information.
Can anyone nudge me in the right direction for a better google-search, or some materials in these forums (my initial searches here didn't turn anything up either).
Thanks for any feedback!
jhWondering if anyone has run into the string "MS" behaving as a reserved word in oracle text queries.Maybe because »MS« is in the default english stoplist?:
English Default Stoplist. -
How to finds specific words in each sentence?
import java.io.*;
import java.text.*;
import java.util.*;
public class FindingWordsSpecific {
static String[] days = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "every Tuesday"};
public static void main( String args[] ) throws IOException {
// the file must be called 'myfile.txt'
String s = "myfile.txt";
File f = new File(s);
if (!f.exists())
System.out.println("\'" + s + "\' does not exit. Bye!");
return;
BufferedReader inputFile = new BufferedReader(new FileReader(s));
String line;
int nLines = 0;
while ((line = inputFile.readLine()) != null)
nLines++;
System.out.println(findTheIndex(line));
inputFile.close();
public static String findTheIndex(String sentence){
String result = "";
String[] s = sentence.split("\\s");
for (String s1: s){
for (String s2: days){
if (s1.equalsIgnoreCase(s2)) {
if(s2.matches("every Tuesday")){
}else if (s2.matches("every Wednesday")){
}What is wrong with it because I tried to find "every Tuesday" in
myfile.txt: "Go fishing every Tuesday and every Wednesday"
There is big problem with split statement because it takes each word not more than a word.
I need to have "every Tuesday" not "Tuesday". How to make it correct codes?I am going to give you a picture of how the output will look.
Here are two sentences from myfile.txt:
Go fishing every Tuesday and every Wednesday
Meet with research students on Thursday
I need to read from myfile.txt and to find specific words in each sentences like this output:
Every Tuesday : Go fishing
Every Wednesday : Go fishing
Thursday : Meet with research students
Ok. make sense? Now I am trying to figure out how to find specific words in each sentence from myfile.txt.
That is why I have difficult with the splits statement and loops. Like this:
public static String findTheIndex(String sentence){
String result = "";
String[] s = sentence.split("\\s");
for (String s1: s){
for (String s2: days){
if (s1.equalsIgnoreCase(s2)) {
if(s2.matches("every Tuesday")){
}else if(s2.matches("every Wednesday")){
}else if(s2.matches("Thursday")){
}else{
System.out.println("That sentence is not working");
return result;
}So look at the "Thursday" it is working the output because I have split statement to give me only one word not more than
a word in sentence. So there is big problem with more than a word in sentence like this "every Tuesday" and it won't work at all because of split. Could you please help me how to do that? I appreciated for that help. Thanks. -
How to find data dictionary and oracle schema tables for UTF8 char conversi
I am doing UTF8 char conversition, i got lot of convertable objects,as per document we don't need to worry about data dictionary objects and how to find data dictionary and oracle schema objects for UTF8 char conversition.
USER.TABLE Convertible Truncation Lossy
MDSYS.OPENLS_NODES 17 0 0
MDSYS.SDO_COORD_OP_PARAM_VALS 200 0 0
MDSYS.SDO_GEOR_XMLSCHEMA_TABLE 1 0 0
MDSYS.SDO_STYLES_TABLE 78 0 0
MDSYS.SDO_XML_SCHEMAS 3 0 0
ORDDATA.ORDDCM_CT_PRED_OPRD 51 0 0
ORDDATA.ORDDCM_DOCS 9 0 0
ORDDATA.ORDDCM_MAPPING_DOCS 1 0 0
SYS.METASTYLESHEET 178 0 0
SYS.REGISTRY$ERROR 2 0 0
SYS.RULE$ 21 0 0
SYS.SCHEDULER$_EVENT_LOG 182 0 0
SYS.WRH$_SQLTEXT 2,099 0 0
SYS.WRH$_SQL_PLAN 1,736 0 0
SYS.WRI$_ADV_ACTIONS 5,452 0 0
SYS.WRI$_ADV_DIRECTIVE_META 5 0 0
SYS.WRI$_ADV_OBJECTS 2,278 0 0
SYS.WRI$_ADV_RATIONALE 9,594 0 0
SYS.WRI$_ADV_SQLT_PLANS 455 0 0
SYS.WRI$_ADV_SQLT_PLAN_STATS 288 0 0
SYS.WRI$_DBU_FEATURE_METADATA 188 0 0
SYS.WRI$_DBU_FEATURE_USAGE 16 0 0
SYS.WRI$_DBU_HWM_METADATA 20 0 0
SYS.WRI$_REPT_FILES 27 0 0
XDB.XDB$DXPTAB 2 0 0
XML CSX Dictionary Tables:
USER.TABLE Convertible Truncation Lossy
Application Data:
USER.TABLE Convertible Truncation Lossy
APPLSYS.BISM_OBJECTS 4 0 0
APPLSYS.DR$FND_LOBS_CTX$I 0 103 1,260,883
APPLSYS.FND_CONC_PROG_ANNOTATIONS 272 0 0
APPLSYS.FND_OAM_CONTEXT_FILES 15 0 0
APPLSYS.FND_OAM_DOC_LINK 1 0 0
APPS.FND_OAM_CONTEXT_FILES_1 6 0 0
AZ.AZ_APIS 11 0 0
AZ.AZ_SELECTION_SET_ENTITIES_B 48 0 0
ECX.ECX_DTDS 205 0 0
ECX.ECX_FILES 91 0 0
IBC.IBC_ATTRIBUTE_BUNDLES 41 0 0
JTF.JTF_HEADER_DTD 1 0 0
JTF.JTF_MESSAGE_OBJECTS 82 0 0
JTF.JTY_TRANS_USG_PGM_SQL 29 0 0
ODM.ODM_PMML_DTD 1 0 0
OKC.OKC_REPORT_SQL_B 3 0 0
OKC.OKC_REPORT_SQL_TL 2 0 0
OKC.OKC_REPORT_XSL_TL 5 0 0
XDP.XDP_PROC_BODY 10 0 0
[Distribution of Convertible, Truncated and Lossy Data by Column]
Data Dictionary Tables:
USER.TABLE|COLUMN Convertible Truncation Lossy
MDSYS.OPENLS_NODES|SYS_NC00004$ 17 0 0
MDSYS.SDO_COORD_OP_PARAM_VALS|PARAM_VALUE_FILE 200 0 0
MDSYS.SDO_GEOR_XMLSCHEMA_TABLE|XMLSCHEMA 1 0 0
MDSYS.SDO_STYLES_TABLE|DEFINITION 78 0 0
MDSYS.SDO_XML_SCHEMAS|XMLSCHEMA 3 0 0
ORDDATA.ORDDCM_CT_PRED_OPRD|SYS_NC00004$ 51 0 0
ORDDATA.ORDDCM_DOCS|SYS_NC00005$ 9 0 0
ORDDATA.ORDDCM_MAPPING_DOCS|SYS_NC00007$ 1 0 0
SYS.METASTYLESHEET|STYLESHEET 178 0 0
SYS.REGISTRY$ERROR|MESSAGE 1 0 0
SYS.REGISTRY$ERROR|STATEMENT 1 0 0
SYS.RULE$|CONDITION 21 0 0
SYS.SCHEDULER$_EVENT_LOG|ADDITIONAL_INFO 182 0 0
SYS.WRH$_SQLTEXT|SQL_TEXT 2,099 0 0
SYS.WRH$_SQL_PLAN|OTHER_XML 1,736 0 0
SYS.WRI$_ADV_ACTIONS|ATTR5 2,726 0 0
SYS.WRI$_ADV_ACTIONS|ATTR6 2,726 0 0
SYS.WRI$_ADV_DIRECTIVE_META|DATA 5 0 0
SYS.WRI$_ADV_OBJECTS|ATTR4 2,278 0 0
SYS.WRI$_ADV_RATIONALE|ATTR5 9,594 0 0
SYS.WRI$_ADV_SQLT_PLANS|OTHER_XML 455 0 0
SYS.WRI$_ADV_SQLT_PLAN_STATS|OTHER 288 0 0
SYS.WRI$_DBU_FEATURE_METADATA|INST_CHK_LOGIC 21 0 0
SYS.WRI$_DBU_FEATURE_METADATA|USG_DET_LOGIC 167 0 0
SYS.WRI$_DBU_FEATURE_USAGE|FEATURE_INFO 16 0 0
SYS.WRI$_DBU_HWM_METADATA|LOGIC 20 0 0
SYS.WRI$_REPT_FILES|SYS_NC00005$ 27 0 0
XDB.XDB$DXPTAB|SYS_NC00006$ 2 0 0
XML CSX Dictionary Tables:
USER.TABLE|COLUMN Convertible Truncation Lossy
Application Data:
USER.TABLE|COLUMN Convertible Truncation Lossy
APPLSYS.BISM_OBJECTS|SYS_NC00023$ 4 0 0
APPLSYS.DR$FND_LOBS_CTX$I|TOKEN_TEXT 0 103 1,260,883
APPLSYS.FND_CONC_PROG_ANNOTATIONS|PROGRAM_ANNOTAT 272 0 0
APPLSYS.FND_OAM_CONTEXT_FILES|TEXT 15 0 0
APPLSYS.FND_OAM_DOC_LINK|DOC_LINK_INFO 1 0 0
APPS.FND_OAM_CONTEXT_FILES_1|TEXT 6 0 0
AZ.AZ_APIS|FILTERING_PARAMETERS 11 0 0
AZ.AZ_SELECTION_SET_ENTITIES_B|FILTERING_PARAMETE 48 0 0
ECX.ECX_DTDS|PAYLOAD 205 0 0
ECX.ECX_FILES|PAYLOAD 91 0 0
IBC.IBC_ATTRIBUTE_BUNDLES|ATTRIBUTE_BUNDLE_DATA 41 0 0
JTF.JTF_HEADER_DTD|HEADER_DTD 1 0 0
JTF.JTF_MESSAGE_OBJECTS|BUS_OBJ_DTD 41 0 0
JTF.JTF_MESSAGE_OBJECTS|BUS_OBJ_SQL 41 0 0
JTF.JTY_TRANS_USG_PGM_SQL|BATCH_DEA_SQL 1 0 0
JTF.JTY_TRANS_USG_PGM_SQL|BATCH_INCR_SQL 5 0 0
JTF.JTY_TRANS_USG_PGM_SQL|BATCH_TOTAL_SQL 6 0 0
JTF.JTY_TRANS_USG_PGM_SQL|INCR_REASSIGN_SQL 5 0 0
JTF.JTY_TRANS_USG_PGM_SQL|REAL_TIME_INSERT 6 0 0
JTF.JTY_TRANS_USG_PGM_SQL|REAL_TIME_SQL 6 0 0
ODM.ODM_PMML_DTD|DTD 1 0 0
OKC.OKC_REPORT_SQL_B|SQL_TEXT 3 0 0
OKC.OKC_REPORT_SQL_TL|HELP_TEXT 2 0 0
OKC.OKC_REPORT_XSL_TL|HELP_TEXT 2 0 0
OKC.OKC_REPORT_XSL_TL|XSL_TEXT 3 0 0
XDP.XDP_PROC_BODY|PROC_BODY 10 0 0
-------------------------------------------------- ---------------- ---------------- ----------------Hi;
Please run below query which could be helpful for your issue:
select * from dictionary where TABLE_NAME LIKE '%NLS%'
select * from dictionary where TABLE_NAME LIKE '%GLOBAL%'
Regard
Helios -
How to compute a global SCORE over a few oracle text indexed tables?
Dear experts!
I want to search a website with Oracle Text. The website consists of four tables:
- site
- chapter
- text
- binaries
Each table has two or three columns which should be indexed with oracle text. So I have created a MULTI_COLUMN_DATASTORE oracle text index on each table - So I have four indexes on my website.
When I want to search over the website I have to join my 4 tables (4 contain clauses). So how do I get a global SCORE over these 4 contains clauses?
The next question is can I change the weight of my text indexes (useful for the search hit list)? For example the highest weight has the site index, the second highest weight the chapter index and so on?
Thanks
MarkusIf it's a simple JOIN, then you could just add the scores for each CONTAINS clause
select score(1)+score(2)+score(3)+score(4)
from table1 t1,table2 t2, table3 t3,table4 t4
where [join conditions]
and contains(t1.col, 'xxx', 1) > 0 or
contains(t2, col, 'xxx', 2) > 0 or
... etc
then to change the weight you just add a multiplying factor.
Can't help thinking it's probably more complex than this, though. -
How to find encrypted columns in oracle 10g database
Hi,
How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
my question is apart from this is there anyother views or tables?
Thanks..user602872 wrote:
Hi,
How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
my question is apart from this is there anyother views or tables?Hmm not which I could find,
SQL> select * from dict where lower(table_name) like '%encrypted%';
TABLE_NAME
COMMENTS
DBA_ENCRYPTED_COLUMNS
Encryption information on columns in the database
ALL_ENCRYPTED_COLUMNS
Encryption information on all accessible columns
USER_ENCRYPTED_COLUMNS
Encryption information on columns of tables owned by the user
SQL>HTH
Aman.... -
SMB Server using Oracle Text Index
Hi folks,
I am looking into IFS and can't find any info
on whether IFS is able to use the Oracle Text
indexing, when accessed through SMB (directory mount).
If I search for a file containing a given string
is that search executed within IFS and only the
resultset returned to the client, or is every
file read from IFS delivered to the client,
searched there and then thrown away if it doesn't
contain the string (rendering the Text Index useless)?
Does anybody have background info / experience with this?
Regards
Jan-PeterHi folks,
I am looking into IFS and can't find any info
on whether IFS is able to use the Oracle Text
indexing, when accessed through SMB (directory mount).
If I search for a file containing a given string
is that search executed within IFS and only the
resultset returned to the client, or is every
file read from IFS delivered to the client,
searched there and then thrown away if it doesn't
contain the string (rendering the Text Index useless)?
Does anybody have background info / experience with this?
Regards
Jan-Peter To answer your question, it would help to have a little more context (pardon the pun). Are you trying to (1) understand how the 9iFS Windows UI uses Oracle Text, or (2) are you trying to write a client application that somehow uses the Text index on 9iFS content? -
Why oracle text index column taking long time
why oracle text index column is taking long time to return result.I created text index on a column if I run the query on a single table result is very fast.If I join table with other table (10 records only )
it is taking long time but in explain plan it is searching by index only.
I created this index for searching a varchar2 column,the data is comma seperated values like ( UK,US,IT,BR) and the table having records 20 lakhs.Normally if I query with like operater
( like '%US%' ) it is taking full table scan because I am using '%' both sides. Please help me on this regard how to search the data with less time. Here is may sample code and explain plan.
SQL*Plus: Release 9.2.0.1.0 - Production on Wed Jan 28 16:54:22 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> set timing on
SQL> set linesize 180
SQL> explain plan for SELECT T.esongid FROM (SELECT A.ESONGID FROM wcmedeco.EDECO_ESONGS_TERR_CTRY
A WHERE CONTAINS(A.TERR_CTRY_NAMES,'US')>0
2 GROUP BY A.ESONGID)K,T
3 WHERE K.ESONGID=T.ESONGID;
Explained.
Elapsed: 00:00:00.01
SQL> select *from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 1 | 26 | 4 |
| 1 | NESTED LOOPS | | 1 | 26 | 4 |
| 2 | VIEW | | 1 | 13 | 4 |
| 3 | SORT GROUP BY | | 1 | 89 | 4 |
| 4 | TABLE ACCESS BY INDEX ROWID| EDECO_ESONGS_TERR_CTRY | 1 | 89 | 2 |
| 5 | DOMAIN INDEX | IDX_TERR_CTRY_NAMES | | | 0 |
| 6 | INDEX RANGE SCAN | IDX_ESONGID_T | 1 | 13 | 1 |
PLAN_TABLE_OUTPUT
Note: cpu costing is off, 'PLAN_TABLE' is old version
14 rows selected.
Elapsed: 00:00:00.00
SQL> Regards,
RajasekharYou have not formatted your code properly so we cannot see the query you're executing. Please put some line breaks in.
Secondly, how fresh are the statistics on those tables? Are you really returning one record out of twenty million?
Cheers, APC
blog: http://radiofreetooting.blogspot.com -
Help with creating oracle text index on 2 columns with partial html data
Hi,
I need to create an oracle text index on 2 columns.
TITLE - varchar(255) = contains plain text data
DESCRIPTION - CLOB = contains partial HTML data
This is what I created.
begin
ctx_ddl.create_preference ('Title_Description_Pref', 'MULTI_COLUMN_DATASTORE');
ctx_ddl.set_attribute('Title_Description_Pref', 'columns', 'TITLE, DESCRIPTION');
end;
begin
ctx_ddl.create_preference ('bid_lexer', 'BASIC_LEXER');
ctx_ddl.set_attribute('bid_lexer', 'index_stems', 'ENGLISH');
ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP');
end;
create index Bid_Title_Index on Bid(title) indextype is ctxsys.context parameters ('LEXER bid_lexer sync (every "sysdate+(1/24)")');
create index Bid_Title_Desc_Index on Bid(description) indextype is ctxsys.context parameters ('LEXER bid_lexer DATASTORE Title_Description_Pref sync (every "sysdate+(1/24)") filter ctxsys.null_filter section group htmgroup');
The problem is when I do a CONTAINS(description, '$(auction)')>0. I get results where the descriptions have the "auction" word (which is correct). But, the results also returned rows where the search word is inside an IMG tag. e.g. <img src="http://auction.de/120483" alt="Auction Logo"/>.
What I would like is to exclude rows where the search word is inside HTML tag attributes, results expected are rows having <a>Auction</a> or <p>For Auction</p> ... etc. Basically stripping the html tags and leave the text contents.
I'd appreciate some input.
Thanks,
AmielHi,
I need to create an oracle text index on 2 columns.
TITLE - varchar(255) = contains plain text data
DESCRIPTION - CLOB = contains partial HTML data
This is what I created.
begin
ctx_ddl.create_preference ('Title_Description_Pref', 'MULTI_COLUMN_DATASTORE');
ctx_ddl.set_attribute('Title_Description_Pref', 'columns', 'TITLE, DESCRIPTION');
end;
begin
ctx_ddl.create_preference ('bid_lexer', 'BASIC_LEXER');
ctx_ddl.set_attribute('bid_lexer', 'index_stems', 'ENGLISH');
ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP');
end;
create index Bid_Title_Index on Bid(title) indextype is ctxsys.context parameters ('LEXER bid_lexer sync (every "sysdate+(1/24)")');
create index Bid_Title_Desc_Index on Bid(description) indextype is ctxsys.context parameters ('LEXER bid_lexer DATASTORE Title_Description_Pref sync (every "sysdate+(1/24)") filter ctxsys.null_filter section group htmgroup');
The problem is when I do a CONTAINS(description, '$(auction)')>0. I get results where the descriptions have the "auction" word (which is correct). But, the results also returned rows where the search word is inside an IMG tag. e.g. <img src="http://auction.de/120483" alt="Auction Logo"/>.
What I would like is to exclude rows where the search word is inside HTML tag attributes, results expected are rows having <a>Auction</a> or <p>For Auction</p> ... etc. Basically stripping the html tags and leave the text contents.
I'd appreciate some input.
Thanks,
Amiel -
Can anybody know is it possible to create two oracle text indexes on one column, for example, CTXCAT index and CTXRULE index and what will be during the querying of that column? is it a good practise?
Thanks in advance.When in doubt, test and see. Yes, you can create two different types of Oracle Text indexes on the same column. If you create a CTXCAT index and a CTXRULE index, then queries using CATSEARCH will use the CTXCAT index and queries using MATCHES will use the CTXRULE index. When querying with CATSEARCH, it will find all rows where the terms searched for are found within the column value. When querying with CTXRULE, it does the opposite, and finds all rows where the column values are found within the terms searched for. Please see the demonstration below. As to whether it is a good practice, it depends on what you need. If you need both types of searches, then yes. If not, then no, it would be unnecessary overhead.
SCOTT@orcl_11gR2> create table test_tab (test_col varchar2(60))
2 /
Table created.
SCOTT@orcl_11gR2> insert all
2 into test_tab values ('test')
3 into test_tab values ('data')
4 into test_tab values ('test data')
5 into test_tab values ('other stuff')
6 select * from dual
7 /
4 rows created.
SCOTT@orcl_11gR2> create index ctxcat_idx on test_tab (test_col)
2 indextype is ctxsys.ctxcat
3 /
Index created.
SCOTT@orcl_11gR2> create index ctxrule_idx on test_tab (test_col)
2 indextype is ctxsys.ctxrule
3 /
Index created.
SCOTT@orcl_11gR2> set autotrace on explain
SCOTT@orcl_11gR2> select * from test_tab
2 where catsearch (test_col, 'test data', null) > 0
3 /
TEST_COL
test data
1 row selected.
Execution Plan
Plan hash value: 399706479
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 44 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| TEST_TAB | 1 | 44 | 3 (0)| 00:00:01 |
|* 2 | DOMAIN INDEX | CTXCAT_IDX | | | | |
Predicate Information (identified by operation id):
2 - access("CTXSYS"."CATSEARCH"("TEST_COL",'test data',NULL)>0)
Note
- dynamic sampling used for this statement (level=2)
SCOTT@orcl_11gR2> select * from test_tab
2 where matches (test_col, 'test data') > 0
3 /
TEST_COL
test
data
test data
3 rows selected.
Execution Plan
Plan hash value: 1476734355
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 44 | 1 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| TEST_TAB | 1 | 44 | 1 (0)| 00:00:01 |
|* 2 | DOMAIN INDEX | CTXRULE_IDX | | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("CTXSYS"."MATCHES"("TEST_COL",'test data')>0)
Note
- dynamic sampling used for this statement (level=2)
SCOTT@orcl_11gR2>
Message was edited by: BarbaraBoehmer -
About index memory parameter for Oracle text indexes
Hi Experts,
I am on Oracle 11.2.0.3 on Linux and have implemented Oracle Text. I am not an expert in this subject and need help about one issue. I created Oracle Text indexes with default setting. However in an oracle white paper I read that the default setting may not be right. Here is the excerpt from the white paper by Roger Ford:
URL:http://www.oracle.com/technetwork/database/enterprise-edition/index-maintenance-089308.html
"(Part of this white paper below....)
Index Memory As mentioned above, cached $I entries are flushed to disk each time the indexing memory is exhausted. The default index memory at installation is a mere 12MB, which is very low. Users can specify up to 50MB at index creation time, but this is still pretty low.
This would be done by a CREATE INDEX statement something like:
CREATE INDEX myindex ON mytable(mycol) INDEXTYPE IS ctxsys.context PARAMETERS ('index memory 50M');
Allow index memory settings above 50MB, the CTXSYS user must first increase the value of the MAX_INDEX_MEMORY parameter, like this:
begin ctx_adm.set_parameter('max_index_memory', '500M'); end;
The setting for index memory should never be so high as to cause paging, as this will have a serious effect on indexing speed. On smaller dedicated systems, it is sometimes advantageous to temporarily decrease the amount of memory consumed by the Oracle SGA (for example by decreasing DB_CACHE_SIZE and/or SHARED_POOL_SIZE) during the index creation process. Once the index has been created, the SGA size can be increased again to improve query performance."
(End here from the white paper excerpt)
My question is:
1) To apply this procedure (ctx_adm.set_parameter) required me to login as CTXSYS user. Is that right? or can it be avoided and be done from the application schema? This user CTXSYS is locked by default and I had to unlock it. Is that ok to do in production?
2) What is the value that I should use for the max_index_memory should it be 500 mb - my SGA is 2 GB in Dev/ QA and 3GB in production. Also in the index creation what is the value I should set for index memory parameter - I had left that at default but how should I change now? Should it be 50MB as shown in example above?
3) The white paper also refer to rebuilding an index at some interval like once in a month: ALTER INDEX DR$index_name$X REBUILD ONLINE;
--Is this correct advice? i would like to ask the experts once before doing that. We are on Oracle 11g and the white paper was written in 2003.
Basically while I read the paper, I am still not very clear on several aspects and need help to understand this.
Thanks,
OrauserNPerhaps it's time I updated that paper
1. To change max_index_memory you must be a DBA user OR ctxsys. As you say, the ctxsys account is locked by default. It's usually easiest to log in as a DBA and run something like
exec ctxsys.ctx_adm.set_parameter('MAX_INDEX_MEMORY', '10G')
2. Index memory is allocated from PGA memory, not SGA memory. So the size of SGA is not relevant. If you use too high a setting your index build may fail with an error saying you have exceeded PGA_AGGREGATE_LIMIT. Of course, you can increase that parameter if necessary. Also be aware that when indexing in parallel, each parallel process will allocated up to the index memory setting.
What should it be set to? It's really a "safety" setting to prevent users grabbing too much machine memory when creating indexes. If you don't have ad-hoc users, then just set it as high as you need. In 10.1 it was limited to just under 500M, in 10.2 you can set it to any value.
The actual amount of memory used is not governed by this parameter, but by the MEMORY setting in the parameters clause of the CREATE INDEX statement. eg:
create index fooindex on foo(bar) indextype is ctxsys.context parameters ('memory 1G')
What's a good number to use for memory? Somewhere in the region of 100M to 200M is usually good.
3. No - that's out of date. To optimize your index use CTX_DDL.OPTIMIZE_INDEX. You can do that in FULL mode daily or weekly, and REBUILD mode perhaps once a month. -
Error When Creating Oracle Text index using Lexer Keyword
Hi All,
I am getting following error when i creating oracle text index using lexer & stoplist keyword.
Pls Help me if any body know.
Thanks in Advance.
Error starting at line 1 in command:
CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
Post INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
Error at Command Line:1 Column:13
Error report:
SQL Error: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-11000: invalid keyword LEXER
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
29855. 00000 - "error occurred in the execution of ODCIINDEXCREATE routine"
*Cause: Failed to successfully execute the ODCIIndexCreate routine.
*Action: Check to see if the routine has been coded correctly.
Regards,
Jack R.Hi,
it works if you put an extra PARAMETERS clause at the end so the creation looks like:
CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') <== Added
Hope this helps
Herald ten Dam -
Oracle text indexed view is possible
Oracle text indexed view is possible???
ok,
My table name is T_DOC :
ID----------------> NUMBER(30)
DESCRIPTION-------> VARCHAR2(2000 BYTE)
DOC---------------> BLOB
FILENAME----------> VARCHAR2(2000 BYTE)
MIMETYPE----------> VARCHAR2(2000 BYTE)
LAST_UPDATE_DATE--> DATE
T_DOC
| Id | DESCRIPTION | DOC | FILENAME | MIMETYPE | LAST_UPDATE_DATE |
| 1 | THE DOG | *(!BLOB) | THE_CAT.PDF | application/pdf | 20/05/2010 15:06:15 |
| 2 | THE BIRD | **(!BLOB) | THE_BIRD.PDF | application/pdf | 20/05/2010 15:06:15 |
| 3 | THE HUMAN AND CAT | ***(!BLOB) | THE_HUMAN.PDF | application/pdf | 20/05/2010 15:06:15 |
* is a document .pdf with content: "the dog and cat"
** is a document .pdf with content: "the bird in house"
*** is a document .pdf with content: "the human from USA"
Index the columns DESCRIPTION, DOC (document content), FILENAME
begin
ctx_ddl.create_preference('idxDoc_lx', 'BASIC_LEXER');
ctx_ddl.set_attribute (' idxDoc_lx ', 'MIXED_CASE', 'NO');
end;
begin
ctx_ddl.create_preference('idxDoc_ds', 'MULTI_COLUMN_DATASTORE');
ctx_ddl.set_attribute ('idxDoc_ds', 'COLUMNS', 'DOC, FILENAME, DESCRIPTION');
end;
CREATE INDEX IDX_DOC
ON T_DOC (FILENAME)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS ('lexer idxDoc_lx
datastore idxDoc_ds
filter CTXSYS.AUTO_FILTER
sync (on commit)');Search Query:
select ID
from T_DOC
where CONTAINS (DOCUMENTO, 'CAT', 1) > 0 RESULT ID = 1
WHY NOT ALSO Returned ID 3 ??????
Maybe you are looking for
-
Message "waiting for device" on my Pc
hi, I've a N73 and i'm trying to use maps , but i can't make it works on my phone. Please, someone can send me the steps to instal the program and how to make a download of Brazil's map? Thanks.
-
OSX Mail only downloads 1 message at a time
For some reason, recently, Mail has started downloading only 1 email at a time. If I've been away from the computer, I have to keep hitting get mail over and over for each email to be downloaded into my box. I have other email accounts in Mail that
-
HT201304 In app purchase that doesn't download but takes your money
It charges me 60.00 for a in app purchase with out giving me anything..... Says " tap ok to download" but doesn't work... This is for Global war app from machine zone...
-
I have PSE 10 and recently got a new camera and started shooting in raw , but I don't seem to have Adobe Camera Raw installed . Where could iit be and how do I access it?
-
I continually get this message: The TM could not complete backup. The backup image "/Volumes/Data/....'s computer_001ec21b890f.sparsebundle" could not be accessed (error 1).?