<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MacLochlainns Weblog &#187; CTXSYS.TEXTINDEXMETHODS</title>
	<atom:link href="http://blog.mclaughlinsoftware.com/tag/ctxsystextindexmethods/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mclaughlinsoftware.com</link>
	<description>Michael McLaughlin's Technical Blog</description>
	<lastBuildDate>Wed, 28 Jul 2010 00:02:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Lexers and privileges errors</title>
		<link>http://blog.mclaughlinsoftware.com/2008/07/05/lexers-and-privileges-errors/</link>
		<comments>http://blog.mclaughlinsoftware.com/2008/07/05/lexers-and-privileges-errors/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 23:25:14 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[context index]]></category>
		<category><![CDATA[CTXAPP]]></category>
		<category><![CDATA[CTXSYS.DRUE]]></category>
		<category><![CDATA[CTXSYS.TEXTINDEXMETHODS]]></category>
		<category><![CDATA[DRG-10700]]></category>
		<category><![CDATA[english_lexer]]></category>
		<category><![CDATA[ODCIINDEXCREATE]]></category>
		<category><![CDATA[ORA-06512]]></category>
		<category><![CDATA[ORA-29855]]></category>

		<guid isPermaLink="false">http://maclochlainn.wordpress.com/?p=68</guid>
		<description><![CDATA[I got in a hurry while building an Oracle Text sample case. It triggered an error because of missing privileges. When I google&#8217;d it, I found there wasn&#8217;t a clean answer. Here&#8217;s a quick answer and the two dependencies. 1. You must have choosen one of the correct lexer (they&#8217;re found in the Oracle Text manual). [...]]]></description>
			<content:encoded><![CDATA[<p>I got in a hurry while building an Oracle Text sample case. It triggered an error because of missing privileges. When I google&#8217;d it, I found there wasn&#8217;t a clean answer. Here&#8217;s a quick answer and the two dependencies.</p>
<p>1. You must have choosen one of the correct lexer (they&#8217;re found in the Oracle Text manual). They are only 10 in the list. Western European languages are typically managed by the <code>BASIC_LEXER</code> or <code>MULTI_LEXER</code>. The former for a single language and the latter for mixed languages. When you create a <code>CONTEXT</code> index.</p>
<p>2. You must have the <code>CTXAPP</code> role granted to your user.</p>
<p>The choice of a wrong lexer is illustrated in the <a title="Incorrect Lexer" href="http://forums.oracle.com/forums/thread.jspa?threadID=639457&amp;tstart=60" target="_blank">Oracle forum</a>. The following illustrates the error stack raised when you don&#8217;t have the right role privileges.</p>
<p>Create a <code>CONTEXT</code> index without the <code>CTXAPP</code> role:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">INDEX</span> regexp_index <span style="color: #993333; font-weight: bold;">ON</span> sample_regexp<span style="color: #66cc66;">&#40;</span>story_thread<span style="color: #66cc66;">&#41;</span>
INDEXTYPE <span style="color: #993333; font-weight: bold;">IS</span> CTXSYS<span style="color: #66cc66;">.</span>CONTEXT
PARAMETERS<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'LEXER english_lexer STOPLIST ctxsys.default_stoplist'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>It creates a corrupt index but raises the following error stack:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">INDEX</span> regexp_index <span style="color: #993333; font-weight: bold;">ON</span> sample_regexp<span style="color: #66cc66;">&#40;</span>story_thread<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">*</span>
ERROR at line <span style="color: #cc66cc;">1</span>:
ORA<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">29855</span>: error occurred <span style="color: #993333; font-weight: bold;">IN</span> the execution of ODCIINDEXCREATE routine
ORA<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">20000</span>: Oracle Text error:
DRG<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">10700</span>: preference does <span style="color: #993333; font-weight: bold;">NOT</span> exist: english_lexer
ORA<span style="color: #66cc66;">-</span>06512: at <span style="color: #ff0000;">&quot;CTXSYS.DRUE&quot;</span><span style="color: #66cc66;">,</span> line <span style="color: #cc66cc;">160</span>
ORA<span style="color: #66cc66;">-</span>06512: at <span style="color: #ff0000;">&quot;CTXSYS.TEXTINDEXMETHODS&quot;</span><span style="color: #66cc66;">,</span> line <span style="color: #cc66cc;">365</span></pre></div></div>

<p>The word <em>&#8220;preference&#8221; </em>indicates the missing privilege. Grant the user the <code>CTXAPP</code>, drop the index, and recreate it. Basically, the <code>CTXAPP</code> runs an external procedure that reads the Inxight lexers. They&#8217;re found in directories within the <code>$ORACLE_HOME/ctx/data</code> directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2008/07/05/lexers-and-privileges-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
