EL function invocation
Hello,
I'm attempting to call a function in a top-level JSP file. I get the error, "Method getMsg for function func1 not found in class myELFuncClass." EL is enabled by default.
Could anyone please suggest what may be the problem?
Thanks for providing that resource URL but it's eye-blinding vague. After thorough experimentation, I realized that the class of the function must be in a named package. Is that correct?
Similar Messages
-
DRG-11110: matches does not support functional invocation
Hi all,
We are working on the some prototype and we hit this road block.
When 'matches' was included with other conditions in query and used in pl/sql we are getting this error.
Oracle Text error: DRG-11110: matches does not support functional invocation
We tried including the hint /*+ index(t2 t2x) */ * (t2 table and t2x index ) in query but it didn't help.
The query works fine from SQL developer, but included in pl/sql gives the error 9 out of 10times.
Is there something that anyone can help
Regards,
Chaitanya.The optimizer tends to choose functional invocation, which will cause the query to fail, when the structured portion of the query is most restrictive. So you will need to stop it from selecting what might otherwise be the most efficient plan at the times when you might have otherwise gained the most performance benefit from it. You want to try to force the optimizer to use the domain index to select the rows based on the matches criteria first, then evaluate the other conditions. You will need to experiment with things like your date filter to see if that causes funcitonal invocation or not. It will depend on how restricitve that is, whether there is an index on the date column and whether there is a small enough amount of data to do a full table scan benficially. You might benefit from hints but the "rownum > 0" seems to have the most consistent effect. You can use "explain plan for" on a query that fails to see what it was trying to do. Notice the difference in the execution plans below for the first failed query and the second working query that uses the domain index.
SCOTT@orcl_11g> SET AUTOTRACE ON EXPLAIN
SCOTT@orcl_11g> SELECT req_id, request, query_id, query_string
2 FROM queries, requests, tmptab
3 WHERE matches (query_string, request) > 0
4 AND tmptab.ID = query_id
5 /
SELECT req_id, request, query_id, query_string
ERROR at line 1:
ORA-20000: Oracle Text error:
DRG-11110: matches does not support functional invocation
SCOTT@orcl_11g> SET AUTOTRACE OFF
SCOTT@orcl_11g> EXPLAIN PLAN FOR
2 SELECT req_id, request, query_id, query_string
3 FROM queries, requests, tmptab
4 WHERE matches (query_string, request) > 0
5 AND tmptab.ID = query_id
6 /
Explained.
SCOTT@orcl_11g> SELECT * FROM TABLE (DBMS_XPLAN.DISPLAY)
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 3854985881
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 855 | 13 (8)| 00:00:01 |
| 1 | NESTED LOOPS | | 1 | 855 | 13 (8)| 00:00:01 |
|* 2 | HASH JOIN | | 3 | 1320 | 7 (15)| 00:00:01 |
| 3 | TABLE ACCESS FULL| TMPTAB | 3 | 39 | 3 (0)| 00:00:01 |
| 4 | TABLE ACCESS FULL| QUERIES | 300 | 125K| 3 (0)| 00:00:01 |
|* 5 | TABLE ACCESS FULL | REQUESTS | 1 | 415 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("TMPTAB"."ID"="QUERY_ID")
5 - filter("CTXSYS"."MATCHES"("QUERY_STRING","REQUEST")>0)
Note
- dynamic sampling used for this statement
22 rows selected.
SCOTT@orcl_11g> DELETE plan_table
2 /
6 rows deleted.
SCOTT@orcl_11g> SET AUTOTRACE ON EXPLAIN
SCOTT@orcl_11g> SELECT req_id, request, query_id, query_string
2 FROM (SELECT req_id, request, query_id, query_string
3 FROM queries, requests
4 WHERE matches (query_string, request) > 0
5 AND ROWNUM > 0),
6 tmptab
7 WHERE tmptab.ID = query_id
8 /
REQ_ID REQUEST QUERY_ID QUERY_STRING
1 A B C 699 A | B
2 B C 699 A | B
Execution Plan
Plan hash value: 615182442
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 45 | 37935 | 14 (8)| 00:00:01 |
|* 1 | HASH JOIN | | 45 | 37935 | 14 (8)| 00:00:01 |
| 2 | TABLE ACCESS FULL | TMPTAB | 3 | 39 | 3 (0)| 00:00:01 |
| 3 | VIEW | | 45 | 37350 | 10 (0)| 00:00:01 |
| 4 | COUNT | | | | | |
|* 5 | FILTER | | | | | |
| 6 | NESTED LOOPS | | 45 | 37890 | 10 (0)| 00:00:01 |
| 7 | TABLE ACCESS FULL | REQUESTS | 3 | 1245 | 3 (0)| 00:00:01 |
| 8 | TABLE ACCESS BY INDEX ROWID| QUERIES | 15 | 6405 | 10 (0)| 00:00:01 |
|* 9 | DOMAIN INDEX | QUERY_STRING_IDX | | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - access("TMPTAB"."ID"="QUERY_ID")
5 - filter(ROWNUM>0)
9 - access("CTXSYS"."MATCHES"("QUERY_STRING","REQUEST")>0)
Note
- dynamic sampling used for this statement
SCOTT@orcl_11g> -
DRG-10849 catsearch does not support functional invocation
I have this error message: DRG-10849 catsearch does not support functional invocation
this is my query:
SELECT *
FROM
(SELECT
/*+ FIRST_ROWS(50) */
NTQ.*,
ROWNUM RNUM1
FROM
(SELECT
/*+ INDEX(DL_TSD_DEFTR_CI) */
FROM ima_ol.DL_TSD_SITUATION s
WHERE (CATSEARCH(DEF_TRANS,'milano ',NULL)>0)
AND (s.FORECAST = 0)
AND (s.STATE IN (1,0,4))
AND (s.ARCH_STATE = 0)
ORDER BY s.VET_TS DESC
) NTQ
WHERE ROWNUM <=50
WHERE RNUM1 >=1
my oracle and system version:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
"CORE 11.1.0.7.0 Production"
TNS for Solaris: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
have suggested that to solve the problem I should alter the statistics of the offending table to force to use this index how do I do?
thanks in advancethere is a topic which is older. maybe it helped.
Oracle Text 10g Release 2 -
Functional invocation error-no joins involved
Windows server 2003
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
"CORE 10.2.0.1.0 Production"
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SELECT NAME,EMAIL,ADDRESS1,ADDRESS2,CONTACT_NAME,MOBILE,TELEPHONE
FROM (SELECT NAME,EMAIL,ADDRESS1,ADDRESS2,CONTACT_NAME,MOBILE,TELEPHONE
FROM MV_CAT_SEG_REG_PROD WHERE CATSEARCH(CAT_IDS,'1,' ,NULL)>0
AND ACT_STATUS='Y'
order by DBMS_RANDOM.value)
WHERE rownum < 8;
ORA-20000: Oracle Text error:
DRG-10849: catsearch does not support functional invocation
20000. 00000 - "%s"
*Cause: The stored procedure 'raise_application_error'
was called which causes this error to be generated.
*Action: Correct the problem as described in the error message or contact
the application administrator or DBA for more information.
the same query returns rows in our test environment which is
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
"CORE 10.2.0.1.0 Production"
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
differences between the two environments
these are the indexes in production environment
LOOKING4 CAT_IDS_IDX CAT_IDS NONUNIQUE VALID DOMAIN N NO NO
LOOKING4 CAT_TYPES_IDX CAT_TYPES NONUNIQUE VALID DOMAIN N NO NO
LOOKING4 ACT_STATUS_IDX ACT_STATUS NONUNIQUE VALID NORMAL N NO NO
and these are the ones in test environment
LOOKING4 CAT_IDS_IDX CAT_IDS NONUNIQUE VALID DOMAIN N NO NO
LOOKING4 CAT_TYPES_IDX CAT_TYPES NONUNIQUE VALID DOMAIN N NO NO
ok, one more difference,,, the test environment is a 32 bit machine and the production environment is a 64 bit
a bit of background
i need these 7 records(randomly selected from nearly 200 records each time) to send mail to all the people who access our website
there is no join involved here thats the little difference
please let me know if you need some other information
thanks in advance
also check
Re: oracle text error when generating random rows
thanks
Edited by: 946207 on Oct 8, 2012 8:25 PM946207 wrote:
Ok
how about
SELECT * FROM
SELECT NAME,CAT_IDS,ACT_STATUS,ADDRESS1,ADDRESS2,CONTACT_NAME,MOBILE,TELEPHONE
FROM MV_CAT_SEG_REG_PROD WHERE CATSEARCH(CAT_IDS,'99,' ,NULL)>0
WHERE ACT_STATUS='Y'and rownum<3
order by DBMS_RANDOM.value
thanks in advanceWhat about it?
"WHERE ACT_STATUS='Y'" is the structured part of your query. Depending on how much that limits the rows, which is dependent upon the distribution of data, the optimizer may or may not choose functional invocation, which would cause the query to fail. The solution is to use a context index and contains. There is no reliable way to rewrite a query using a ctxcat index and catsearch to prevent it from failing at unpredictable times.
Additionally, the way that query is written, it will take the first 3 rows returned, then display them in random order. It will not order them randomly, then display the first rows from that randomly ordered set. -
Function and procedure call overhead in PL/SQL
( I come from a programming background - java/c++ etc and not much PL/SQL )
Im trying to get a feel of how much extra cycles are spent if something is wrapped inside a function or procedure. I mean will it become considerably inefficient if the logic is within a function as opposed to be directly inline ?I did some timings a few years ago and found procedure calls to be slightly more efficient than function calls, presumably due to the fact that functions must pass values back through the function invocation and procedures don't. This may have changed in more recent releases but you can check it yourself.
Set up a function and a procedure and use dbms_utility to get a starting and ending time marker (this will be the number of seconds from an arbitrary start point as microseconds; you will have to convert). Get a start time, loop through the calls a lot of times, get and end time, and subtract the end time from the start time.
The prevailing though is that use functions to return values and procedures to perform actions. You can use functions in SQL if written correctly but not procedures. -
Using "v" function in row-level triggers
I have row-level triggers that do
l_user := nvl(v('APP_USER'),user);
to get the user that is running the app and record that in the table or wherever.
Since it is a row-level trigger, the "v" function will be called for each and every row even though it is going to be the same.
Is there a way to avoid this repeated execution of the v function?
ThanksTo avoid calls to the V function, put the values in hidden database text items in the HTML DB page and allow the normal insert/update HTML DB process pass it to your triggers. Then you refer to their values in table triggers with the ":new" method. Doing it this way you remove your V function invocations from your table-level triggers so the triggers do not have to determine from what environment they were being fired.
Example: In our applications we track user ID and date/time for row creates and last row modifications. The HTML DB page has a default value of :APP_USER for the row create user ID text item and default of TO_CHAR(SYSDATE,'DD-MON-RR') for the row create date text item. It also has conditional computations with the same values for last row modification user ID and last row modification date. -
Is Using Static functions advisable from performance(speed) point of view
I was wondering if using a static function would be slower than using a normal function, especially when the function is to be accessed by multiple threads since the same memory area is used each time the static function is accessed from any of the threads. Thus is it right if I say that static functions are not suitable for multiThreaded access ?
I was wondering if using a static function would be
slower than using a normal function,Static functions are linked at compile time, while normal functions have to be linked based on the runtime type of the object they are called on. This lookup means that static function invocations are likely to be faster.
especially when
the function is to be accessed by multiple threads
since the same memory area is used each time the
static function is accessed from any of the threads.If you are talking about the code segment, where the function definition is held, there is only a single copy of each "normal" function as well. The code segment is also read-only, so there are no issues with multiple threads reading and executing the same code at the same time.
There are the normal issues with multi-threaded access to variables in static functions that exist with normal functions.
Thus is it right if I say that static functions are
not suitable for multiThreaded access ?Static functions are no safer than non-static functions in terms of thread safety. On the other hand, it is no more dangerous having multiple threads calling a static function than having multiple threads calling a non-static function on the same object. Exactly the same thread safety techniques apply whether you are working in a static or a non-static context.
With the above in mind, there is a great deal of design difference between static functions and non-static functions. They mean very different things when creating a system, and an operation that is suited for a static function is very likely not appropriate in a non-static context, and vice versa. The important thing is to make sure the design is appropriate for what the system is trying to do.
The most common use of static functions is for object creation... The Factory design pattern uses static methods to create objects of a given type, the Singleton design pattern uses static methods to allow access to itself. -
There are no functions containing returntype = 'query' and access!
Hi there
I am trying to add a recordset after defining a datasource and I keep getting the error when I do a CFC query search
there are no functions containing returntype = 'query' and access!. I have attached an image to show the error messag I get.
Can someone help me fix this? my datasource shows up as correctly configured in cold fusion and the mysql database is well configured as well.okay, adding another function to the CFC and saving it makes
it suddenly, magically visible to the function invocation window?
I don't understand. -
Passing enums to functions without knowing the specific enum type
My application needs the function invocation feature by using reflection mechanism. The function parameters are restricted to string, int, float and enums. I am facing problems with enums.
Is there a way to invoke the function by passing specific enum type as parameter to the function.
For eg:
public void doProcess(int i, COLOR.RED){
I should be able to invoke the above function using reflections. How dynamic casting to COLOR can be done is the question here?The application takes XML file as an input. This file has processing instructions. The processing instruction provides data about the class name, function name and parameters specifications like
Classname_FunctionName("String param", 123, COLOR.RED)
The application should invoke the corresponding library function by passing these parameters after assessing the correct types. -
Can a mock method use it's argument in a callback function?
This question isn’t directly related to FlexUnit, but I assume someone can give me advice on this problem or an alternative. The problem is that I am trying to pass an instance of an object (AIRLoaderRequest) to a mocked object and need this mock object to invoke a method with the AIRLoaderRequest instance to the class (QueueManager) I am testing.
Hopefully the code below will highlight my attempt using Mockolate.
var request_a:AIRLoaderRequest = new AIRLoaderRequest("dummy_uri_a");
var loader:AIRLoader = nice(AIRLoader);
mock(loader).method("sendRequest").args( instanceOf(AIRLoaderRequest) )
.calls(function(request:AIRLoaderRequest):void
queuemanager.sendNextRequest(request);
queuemanager.airloader = loader;
queuemanager.queueRequest(request_a);//this will call loader.sendRequest()
The request parameter above is never defined. I understand that calls() takes a second parameter of an array that will be passed to the anonymous function, but I need something that will return the argument that queuemanager passed to it.
There is a 2-way composition relationship between QueueManager and AIRLoader, so they’re tightly coupled to each other. At any rate, to clarify, I need a test double to use its argument to invoke a method of the class being tested.
Thanks. If you need me to explain in more detail let me know, as l am sill learning the basics of unit testing and mocking.myIP, there is at least two ways to do what you want at the moment.
The first is to use a CallsWithInvocation Answer which will call the given function with an Invocation object containing the name, arguments, and return value.
var request_a:AIRLoaderRequest = new AIRLoaderRequest("dummy_uri_a");
var loader:AIRLoader = nice(AIRLoader);
mock(loader).method("sendRequest").args( instanceOf(AIRLoaderRequest) )
.answers(new CallsWithInvocationAnswer(function(invocation:Invocation):void {
var request:AIRLoaderRequest = invocation.arguments[0] as AIRLoaderRequest;
queuemanager.sendNextRequest(request);
queuemanager.airloader = loader;
queuemanager.queueRequest(request_a);//this will call loader.sendRequest()
The second is to use argument capturing using a Capture instance and the capture argument matcher.
var request_a:AIRLoaderRequest = new AIRLoaderRequest("dummy_uri_a");
var captured:Capture = new Capture();
var loader:AIRLoader = nice(AIRLoader);
mock(loader).method("sendRequest").args(capture(captured))
.calls(function():void {
var request:AIRLoaderRequest = captured.value as AIRLoaderRequest;
queuemanager.sendNextRequest(request);
queuemanager.airloader = loader;
queuemanager.queueRequest(request_a);//this will call loader.sendRequest()
I'll add .callsWithInvocation(fn:Function) and .callsWithArguments(fn:Function) shortcuts to help with this scenario. -
Text Index works fine consistently with Table, but not on underlying View
Hi,
We are facing weird issue relating to Oracle Text Indexes. Search using Oracle Text Index
works fine on a Table, but when running query on View it gives sometimes (not consistently)
ORA-20000: Oracle Text error:
DRG-10849: catsearch does not support functional invocation
DRG-10599: column is not indexed
Sometimes it works.
All of the below steps are run using User IR2OWNER:
STEP 1: Table CPF_CUSTOMER created as follows (3 Non Text Indexes defined at time of creation )
**Please note no Public Synonym is created for this Table**
** There is already another Table by same name CPF_CUSTOMER under different Owner (CDROWNER)
and that Table has Public Synonym CPF_CUSTOMER created. Other Table CPF_CUSTOMER does not
have any Views **
create table CPF_CUSTOMER
CPF_CUSTOMER_UUID NUMBER(20) not null,
SAP_ID VARCHAR2(10 CHAR) not null,
IRIS2_ID VARCHAR2(7 CHAR),
NAME VARCHAR2(70 CHAR) not null,
DRAFT_IND NUMBER(1) not null,
ACTIVE_IND NUMBER(1) not null,
REPLACED_BY_CUST VARCHAR2(10 CHAR),
CRE_DT_GMT DATE,
CRE_DT_LOC DATE,
TIME_ZONE VARCHAR2(3 CHAR),
CRE_USR VARCHAR2(8 CHAR),
CHG_DT_GMT DATE,
CHG_DT_LOC DATE,
CHG_TIME_ZONE VARCHAR2(3 CHAR),
CHG_USR VARCHAR2(8 CHAR),
VFY_DT_GMT DATE,
VFY_DT_LOC DATE,
VFY_USR VARCHAR2(8 CHAR),
DIVISION VARCHAR2(20 CHAR),
SALES_ADMIN VARCHAR2(3 CHAR),
MF_CUST_CDE VARCHAR2(14 CHAR),
CR_CTRL_OFCE VARCHAR2(3 CHAR),
DEFAULT_INV_CCY VARCHAR2(3 CHAR),
AUTOBILL_OVRRD_IND NUMBER(1) not null,
AUTOBILL NUMBER(1) not null,
AUTOPRT_OVRRD_IND NUMBER(1) not null,
AUTOPRT NUMBER(1) not null,
AVE_PYMT_DAY NUMBER(3),
TTL_INV_VAL NUMBER(12,2),
INHERIT_CR_TERM_ASSGMT NUMBER(1) not null,
NORMALIZED_NME VARCHAR2(70 CHAR),
OB_PYMT_OFCE VARCHAR2(3 CHAR),
IB_PYMT_OFCE VARCHAR2(3 CHAR),
CGO_SMART_ID VARCHAR2(20 CHAR),
REC_UPD_DT TIMESTAMP(6),
NCPF_CUST_ID VARCHAR2(7) not null,
CPF_CUST_LEVEL_UUID NUMBER(20) not null
tablespace DBCPFP1_LG_DATA LOGGING;
CREATE UNIQUE INDEX CPF_CUSTOMERI1 ON CPF_CUSTOMER
(SAP_ID ASC) TABLESPACE DBCPFP1_LG_INDX;
ALTER TABLE CPF_CUSTOMER
ADD CONSTRAINT CPF_CUSTOMERI1 UNIQUE (SAP_ID);
CREATE UNIQUE INDEX CPF_CUSTOMERI2 ON CPF_CUSTOMER
(CPF_CUSTOMER_UUID ASC) TABLESPACE DBCPFP1_LG_INDX;
ALTER TABLE CPF_CUSTOMER
ADD CONSTRAINT CPF_CUSTOMERI2 UNIQUE (CPF_CUSTOMER_UUID);
CREATE INDEX CPF_CUSTOMER_IDX2 ON CPF_CUSTOMER (UPPER(NAME))
TABLESPACE DBCPFP1_LG_INDX;
STEP 2: Create View CPF_CUSTOMER_RVW on above Table (and Public Synonym on View)
This View is created under same OWNER as Table created in STEP 1 (IR2OWNER)
create or replace view cpf_customer_rvw as
select
CPF_CUSTOMER_UUID,
SAP_ID,
IRIS2_ID,
NAME,
DRAFT_IND,
ACTIVE_IND,
REPLACED_BY_CUST,
CRE_DT_GMT,
CRE_DT_LOC,
TIME_ZONE,
CRE_USR,
CHG_DT_GMT,
CHG_DT_LOC,
CHG_TIME_ZONE,
CHG_USR,
VFY_DT_GMT,
VFY_DT_LOC,
VFY_USR,
DIVISION,
SALES_ADMIN,
MF_CUST_CDE,
CR_CTRL_OFCE,
DEFAULT_INV_CCY,
AUTOBILL_OVRRD_IND,
AUTOBILL,
AUTOPRT_OVRRD_IND,
AUTOPRT,
AVE_PYMT_DAY,
TTL_INV_VAL,
INHERIT_CR_TERM_ASSGMT,
NORMALIZED_NME,
OB_PYMT_OFCE,
IB_PYMT_OFCE,
CGO_SMART_ID,
NCPF_CUST_ID,
CPF_CUST_LEVEL_UUID,
REC_UPD_DT
from CPF_CUSTOMER;
CREATE OR REPLACE PUBLIC SYNONYM CPF_CUSTOMER_RVW FOR CPF_CUSTOMER_RVW;
STEP 3: Insert Test row
insert into cpf_customer (CPF_CUSTOMER_UUID, SAP_ID, IRIS2_ID, NAME, DRAFT_IND, ACTIVE_IND, REPLACED_BY_CUST, CRE_DT_GMT, CRE_DT_LOC, TIME_ZONE, CRE_USR, CHG_DT_GMT, CHG_DT_LOC, CHG_TIME_ZONE, CHG_USR, VFY_DT_GMT, VFY_DT_LOC, VFY_USR, DIVISION, SALES_ADMIN, MF_CUST_CDE, CR_CTRL_OFCE, DEFAULT_INV_CCY, AUTOBILL_OVRRD_IND, AUTOBILL, AUTOPRT_OVRRD_IND, AUTOPRT, AVE_PYMT_DAY, TTL_INV_VAL, INHERIT_CR_TERM_ASSGMT, NORMALIZED_NME, OB_PYMT_OFCE, IB_PYMT_OFCE, CGO_SMART_ID, NCPF_CUST_ID, CPF_CUST_LEVEL_UUID, REC_UPD_DT)
values (2.26283572796028E15, '6588125000', '6588125', 'S M Mooseen And Sons(PVT) Limited', 0, 1, '', to_date('15-03-2005 08:55:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('15-03-2005 14:25:00', 'dd-mm-yyyy hh24:mi:ss'), 'IST', 'licr2', to_date('19-02-2007 00:33:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('19-02-2007 06:03:00', 'dd-mm-yyyy hh24:mi:ss'), 'IST', 'BaseAdmi', to_date('15-03-2005 09:03:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('15-03-2005 14:33:00', 'dd-mm-yyyy hh24:mi:ss'), 'ninwasa', '', '', 'SRI06588125000', '463', '', 0, 0, 0, 0, null, null, 0, 'SMMOOSEENANDSONSPVTLIMITED', '', '', '', '6588125', 109966195050333, '14-JAN-09 02.49.28.325774 PM');
commit;
STEP 4: Create Oracle Text Index on Table CPF_CUSTOMER
EXEC CTX_DDL.DROP_PREFERENCE('CTXCAT_IR2_STORAGE');
EXEC CTX_DDL.CREATE_PREFERENCE('CTXCAT_IR2_STORAGE', 'BASIC_STORAGE');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'I_INDEX_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'I_INDEX_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'K_TABLE_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'R_TABLE_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'I_ROWID_INDEX_CLAUSE', 'TABLESPACE COMMON_SM_INDX storage (INITIAL 5M)');
-- Define IR2_AB_LEXER to handle Special Characters.
EXEC ctx_ddl.drop_preference('IR2_AB_LEXER');
EXEC ctx_ddl.create_preference('IR2_AB_LEXER', 'BASIC_LEXER');
EXEC ctx_ddl.set_attribute ('IR2_AB_LEXER', 'printjoins', ',_!$~%?=({;|&+-:/)}.@`^');
--Drop Indexes
drop index CPF_CUSTOMER_DIDX1;
-- CATSEARCH INDEX on CPF_CUSTOMER.NAME
CREATE INDEX CPF_CUSTOMER_DIDX1 ON CPF_CUSTOMER(NAME) INDEXTYPE IS CTXSYS.CTXCAT PARAMETERS ('STORAGE CTXCAT_IR2_STORAGE STOPLIST CTXSYS.EMPTY_STOPLIST LEXER IR2_AB_LEXER');
commit;
STEP 5: Run Query to use Oracle Text Index on Base Table (works fine always. No issues seen so far)
SELECT a.sap_id||'|'||a.name||'|' CUSTOMER_STR
FROM cpf_customer a
WHERE (catsearch(a.name, 'Mooseen'||'*', '')>0);
CUSTOMER_STR
6588125000|S M Mooseen And Sons(PVT) Limited|
STEP 6: Run Query to use Oracle Text Index on View created under Table (get below error periodically)
ORA-20000: Oracle Text error:
DRG-10849: catsearch does not support functional invocation
DRG-10599: column is not indexed
But it works sometimes as in STEP 5 and returns 1 row. It is never consistent. We would like to
provide access to this Table using View only. That is why we would like to get this query working consistently
using View.
Any help or tips would be greatly appreciated
Thanks
AuroThis is a known issue with CTXCAT indexes. Sometimes the optimizer will "drive" the query off another index, and request results from the CTXCAT index on a row-by-row basis ("does the row with rowid NNNN satisfy this CATSEARCH condition?"). That's known as a functional lookup, and is not supported by the CTXCAT indextype.
The only solution is to try to persuade the optimizer to use a different plan which does not use a functional lookup. This can be achieved by the use of hints, or sometimes by collecting or deleting statistics on the table. -
ORA-04021 while granting sys privilege to an object
Hello,
While granting a system privilege to an object using the TOAD software, ORA-04021 error arised, ORA-00600 was written in the alert.log, and a new trace file appeared. Can you help understand the reason for the error
Here is the trace file:
mis64_ora_2210.trc
Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
ORACLE_HOME = /mis64/ora/oracle
System name: HP-UX
Node name: ncdb001
Release: B.11.11
Version: U
Machine: 9000/800
Instance name: MIS64
Redo thread mounted by this instance: 1
Oracle process number: 17
Unix process pid: 2210, image: oracle@ncdb001 (TNS V1-V3)
*** SESSION ID:(31.923) 2004-12-03 13:04:03.754
*** 2004-12-03 13:04:03.754
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [qerfxFetch_01], [], [], [], [], [], [], []
Current SQL statement for this session:
SELECT
s.username,
s.osuser,
S.PROGRAM "Program",
s.serial# "Serial#",
s.sql_address "address", s.sql_hash_value "Sql hash",
lk.sid, DECODE(lk.TYPE,
'MR', 'Media Recovery',
'RT', 'Redo Thread',
'UN', 'User Name',
'TX', 'Transaction',
'TM', 'DML',
'UL', 'PL/SQL User Lock',
'DX', 'Distributed Xaction',
'CF', 'Control File',
'IS', 'Instance State',
'FS', 'File Set',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'TS', 'Temp Segment',
'IV', 'Library Cache Invalidation',
'LS', 'Log Start or Switch',
'RW', 'Row Wait',
'SQ', 'Sequence Number',
'TE', 'Extend Table',
'TT', 'Temp Table',
'BL','Buffer hash table instance',
'CI','Cross-instance function invocation instance',
'CU','Cursor bind',
'DF','Data file instance',
'DL','Direct loader parallel index create',
'DM','Mount/startup db primary/secondary instance',
'DR','Distributed recovery process',
'HW','Space management operations on a specific segment',
'IN','Instance number',
'JQ','Job queue',
'KK','Thread kick',
'LA','Library cache lock instance lock namespace A',
'LB','Library cache lock instance lock namespace B',
'LC','Library cache lock instance lock namespace C',
'LD','Library cache lock instance lock namespace D',
'LE','Library cache lock instance lock namespace E',
'LF','Library cache lock instance lock namespace F',
'LG','Library cache lock instance lock namespace G',
'LH','Library cache lock instance lock namespace H',
'LI','Library cache lock instance lock namespace I',
'LJ','Library cache lock instance lock namespace J',
'LK','Library cache lock instance lock namespace K',
'LL','Library cache lock instance lock namespace L',
'LM','Library cache lock instance lock namespace M',
'LN','Library cache lock instance lock namespace N',
'LO','Library cache lock instance lock namespace O',
'LP','Library cache lock instance lock namespace P',
'MM','Mount definition global enqueue',
'NA','Library cache pin instance A',
'NB','Library cache pin instance B',
'NC','Library cache pin instance C',
'ND','Library cache pin instance D',
'NE','Library cache pin instance E',
'NF','Library cache pin instance F',
'NG','Library cache pin instance G',
'NH','Library cache pin instance H',
'NI','Library cache pin instance I',
'NJ','Library cache pin instance J',
'NK','Library cache pin instance K',
'NL','Library cache pin instance L',
'NM','Library cache pin instance M',
'NN','Library cache pin instance N',
'NO','Library cache pin instance O',
'NP','Library cache pin instance P',
'NQ','Library cache pin instance Q',
'NR','Library cache pin instance R',
'NS','Library cache pin instance S',
'NT','Library cache pin instance T',
'NU','Library cache pin instance U',
'NV','Library cache pin instance V',
'NW','Library cache pin instance W',
'NX','Library cache pin instance X',
'NY','Library cache pin instance Y',
'NZ','Library cache pin instance Z',
'PF','Password File',
'PI',' PS Parallel operation',
'PR','Process startup',
'QA','Row cache instance A',
'QB','Row cache instance B',
'QC','Row cache instance C',
'QD','Row cache instance D',
'QE','Row cache instance E',
'QF','Row cache instance F',
'QG','Row cache instance G',
'QH','Row cache instance H',
'QI','Row cache instance I',
'QJ','Row cache instance J',
'QK','Row cache instance K',
'QL','Row cache instance L',
'QM','Row cache instance M',
'QN','Row cache instance N',
'QO','Row cache instance O',
'QP','Row cache instance P',
'QQ','Row cache instance Q',
'QR','Row cache instance R',
'QS','Row cache instance S',
'QT','Row cache instance T',
'QU','Row cache instance U',
'QV','Row cache instance V',
'QW','Row cache instance W',
'QX','Row cache instance X',
'QY','Row cache instance Y',
'QZ','Row cache instance Z',
'SC','System commit number instance',
'SM','SMON',
'SN','Sequence number instance',
'SS','Sort segment',
'SV','Sequence number value',
'TA','Generic enqueue',
'US','Undo segment DDL',
'WL','Being-written redo log instance',
lk.TYPE) lock_type,
DECODE(lk.lmode,
0, 'None',
1, 'Null',
2, 'Row-S (SS)',
3, 'Row-X (SX)',
4, 'Share',
5, 'S/Row-X (SSX)',
6, 'Exclusive',
TO_CHAR(lk.lmode)) mode_held,
DECODE(request,
0, 'None',
1, 'Null',
2, 'Row-S (SS)',
3, 'Row-X (SX)',
4, 'Share',
5, 'S/Row-X (SSX)',
6, 'Exclusive',
TO_CHAR(lk.request)) mode_requested,
TO_CHAR(lk.id1) lock_id1,
TO_CHAR(lk.id2) lock_id2,
s.USERNAME "DB User", s.sid,
OWNER||'.'||OBJECT_NAME "Object"
FROM v$lock lk, v$session s
, DBA_OBJECTS ao
WHERE
lk.lmode > 1
AND s.username is not null
AND lk.sid = s.sid
AND ao.OBJECT_ID(+) = lk.id1
ORDER BY 1, "Object"
----- Call Stack Trace -----
calling call entry argument values in hex
location type point (? means dubious value)
ksedmp()+184 ? ksedst() 80000001001B14C8 ?
000000000 ? 000000000 ?
000000000 ?
ksfdmp()+32 ? ksedmp() 000007FFE ? 000000000 ?
800000010000BD40 ?
40000000026CE5A7 ?
kgerinv()+152 ? ksfdmp() 800000010000BD40 ?
40000000026CE5A7 ?
8000000100149370 ?
000000000 ?
kgeasnmierr()+88 ? kgerinv() 000000000 ? 000000000 ?
40000000004F57D0 ?
C000000018380C38 ?
qerfxFetch()+2760 ? kgeasnmierr() 800000010012AB70 ?
400000000066848A ?
400000000070A490 ?
A900748690 ?
rwsfcd()+120 ? qerfxFetch() 000000000 ?
C0000000116641B8 ?
00121EDA7 ?
400000000156A43B ?
qeruaFetch()+240 ? rwsfcd() 8000000100149370 ?
000000002 ?
800000010012C370 ?
800003FB800653A8 ?
qervwFetch()+160 ? qeruaFetch() 0000000E0 ?
4000000000D9A748 ?
800003FFFF7F6F98 ?
100000080 ?
rwsfcd()+120 ? qervwFetch() 8000000100149370 ?
C000000011663EC0 ?
800003FFFF7F6F98 ?
800000010000 ?
qeruaFetch()+240 ? rwsfcd() 8000000100149370 ?
8000000100149370 ?
000000000 ? 30001001C42E0 ?
qervwFetch()+160 ? qeruaFetch() 8000000100143BA8 ?
800003FB8007F5B0 ?
8000000100144CF8 ?
055555555 ?
qerjoFetch()+480 ? qervwFetch() 40000000010530DB ?
8000000100000018 ?
4000000001400253 ?
8000000100144CF8 ?
rwsfcd()+120 ? qerjoFetch() 20000010C ? 000000000 ?
000000000 ?
400000000121EF73 ?
qerhjFetch()+1216 ? rwsfcd() C000000010B6B898 ?
400000000140ED7F ?
C00000000028DB33 ?
800003FB800603E0 ?
qersoFetch()+696 ? qerhjFetch() 80000001001C0720 ?
C000000000280A13 ?
80000001001623C0 ?
000000000 ?
opifch2()+3304 ? qersoFetch() 000000000 ?
8000000100149370 ?
40000000010675DF ?
8000000100143898 ?
opiall0()+3584 ? opifch2() 4E1D000023A3 ?
8000000100149370 ?
C000000018311A98 ?
000000000 ?
kpoal8()+3448 ? opiall0() 8000000100149370 ?
000000000 ? 000000000 ?
000000000 ?
opiodr()+2332 ? kpoal8() 000000D00 ?
40000000015460D7 ?
72000696F6E00 ?
1000000000000000 ?
ttcpip()+1880 ? opiodr() 000000000 ?
692E7369642C2073 ?
80000001001B19F0 ?
000000000 ?
opitsk()+1248 ? ttcpip() 00000001E ?
800003FDC0002ED8 ?
00000001E ?
800003FC800142E0 ?
opiino()+1464 ? opitsk() 000000000 ? 000000000 ?
000000000 ? 000000000 ?
opiodr()+2332 ? opiino() 000000000 ? 000000000 ?
000000000 ?
800003FDC0002ED8 ?
opidrv()+752 ? opiodr() 8000000100143A24 ?
000000000 ?
8000000100143A24 ?
80000001001D5AC8 ?
sou2o()+40 ? opidrv() 800003FFBFFFF480 ?
C0000000000218B3 ?
000000000 ?
C00000000030105B ?
main()+228 ? sou2o() 000000000 ?
C00000000030105B ?
000000002 ? 000000230 ?
$START$()+160 ? main() 21408130800 ?
800003FFFF7F04AB ?
800003FFFF7F03F3 ?
800003FFFF7F0017 ?
--------------------- Binary Stack Dump -----------------
========== FRAME [1] (ksedmp()+184 -> ksedst()) ==========
Dump of memory from 0x800003FFFF7F7FC0 to 0x800003FFFF7F8360
800003FFFF7F7FC0 80000001 001449DC 40000000 0041F7F8 [[email protected]..]
800003FFFF7F7FD0 800003FF FF7F7BF0 800003FB 80065338 [......{.......S8]
800003FFFF7F7FE0 40000000 00668488 40000000 00664980 [@[email protected].]
800003FFFF7F7FF0 80000001 0000B870 00000000 00000140 [.......p.......@]
800003FFFF7F8000 80000001 00144D88 00000000 0000000E [......M.........]
800003FFFF7F8010 80000001 00143AE8 80000001 00144DC0 [......:.......M.]
800003FFFF7F8020 00000000 00000001 80000001 001449F0 [..............I.]
800003FFFF7F8030 00000000 00000009 C0000000 1826D1F8 [.............&..]
........................................................Hi,
It's a possible bug id 2306106.8 (affect OEM) which fix in 9.2.0.2.
Nicolas. -
CATSEARCH only works with AND not with Or
Hello,
If I run the following query against my database it runs absolutely fine
SELECT * FROM
LOAD
WHERE ((catsearch (WILDCARD_SURNAMES, 'BRUCE', '') > 0)) AND PARSED_FORENAME1='ANTHONY'
But if I replace the "AND" with an "OR"
SELECT * FROM
LOAD
WHERE ((catsearch (WILDCARD_SURNAMES, 'BRUCE', '') > 0)) OR PARSED_FORENAME1='ANTHONY'
I get an Oracle error
ORA-20000: Oracle Text error:
DRG-10849: catsearch does not support functional invocation
DRG-10599: column is not indexed
I don't understand this, why can't I use OR?
Thanks for any help
MarkThe optimizer has chosen to drive the query from an index on parsed_forename1 or by doing a full table scan.
This causes it to try to invoke the ctxcat index in "functional lookup" mode - effectively saying "does rowid XXX match have the word "BRUCE" in WILDCARD_SURNAMES?"
However, CTXCAT indexes do not support functional lookups, so this is impossible.
The solution is to use a hint which persuades the optimizer to always drive the query from the CTXCAT index.
I know this is kind of messy, but our developers tell me there is no simple way to tell the optimizer that such as call is impossible (or infinitely expensive). -
Using 2 catsearch in where clause
Hi all,
I have problem using 2 catsearch in where clause, am not sure if there is any solution this. i have created a simple test data as below:-
-- Test Code
create table cust_catalog (
id number(16),
firstname varchar2(80),
surname varchar2(80),
birth varchar2(25),
age numeric )
INSERT ALL
INTO cust_catalog VALUES ('1','John','Smith','Glasgow','52')
INTO cust_catalog VALUES ('2','Emaily','Johnson','Aberdeen','55')
INTO cust_catalog VALUES ('3','David','Miles','Leeds','53')
INTO cust_catalog VALUES ('4','Keive','Johnny','London','45')
INTO cust_catalog VALUES ('5','Jenny','Smithy','Norwich','35')
INTO cust_catalog VALUES ('6','Andy','Mil','Aberdeen','63')
INTO cust_catalog VALUES ('7','Andrew','Smith','London','64')
INTO cust_catalog VALUES ('8','John','Smith','London','54')
INTO cust_catalog VALUES ('9','John','Henson','London','56')
INTO cust_catalog VALUES ('10','John','Mil','London','58')
INTO cust_catalog VALUES ('11','Jon','Smith','Glasgow','57')
INTO cust_catalog VALUES ('12','Jen','Smith','Glasgow','60')
INTO cust_catalog VALUES ('13','Chris','Smith','Glasgow','59')
SELECT * FROM DUAL
EXEC CTX_DDL.create_index_set('cust_iset');
EXEC CTX_DDL.CREATE_PREFERENCE ('cust_lexer', 'BASIC_LEXER');
EXEC CTX_DDL.SET_ATTRIBUTE('cust_lexer', 'SKIPJOINS' , ',''."+-()/');
EXEC CTX_DDL.Create_Preference('cust_wildcard_pref', 'BASIC_WORDLIST');
EXEC CTX_DDL.set_attribute('cust_wildcard_pref', 'prefix_index', 'YES');
EXEC CTX_DDL.ADD_INDEX('cust_iset','id');
EXEC CTX_DDL.ADD_INDEX('cust_iset','birth');
EXEC CTX_DDL.ADD_INDEX('cust_iset','age');
CREATE INDEX FIRSTNAME_IDX ON cust_catalog(firstname) INDEXTYPE IS CTXSYS.CTXCAT
PARAMETERS ('index set cust_iset LEXER cust_lexer Wordlist cust_wildcard_pref');
CREATE INDEX SURNAME_IDX ON cust_catalog(surname) INDEXTYPE IS CTXSYS.CTXCAT
PARAMETERS ('index set cust_iset LEXER cust_lexer Wordlist cust_wildcard_pref');
EXEC DBMS_STATS.GATHER_TABLE_STATS('WORKAROUND', 'CUST_CATALOG', cascade=>TRUE);
-- For removing test data
drop table cust_catalog;
EXEC CTX_DDL.DROP_INDEX_SET('cust_iset');
EXEC CTX_DDL.DROP_PREFERENCE('cust_lexer');
EXEC CTX_DDL.DROP_PREFERENCE('cust_wildcard_pref');
DROP INDEX FIRSTNAME_IDX ;
DROP INDEX SURNAME_IDX ;
------- QUESTIONS IN HERE -------------------------------------------------
SELECT * FROM cust_catalog WHERE ctxsys.catsearch (firstname, 'John','age BETWEEN 40 AND 70 AND birth=''Glasgow''')>0
I have no problem running above query
BUT if i add 2 catsearch on both firstname and surname, i have error ~ catsearch does not support function invocation
SELECT * FROM cust_catalog WHERE ctxsys.catsearch (firstname, 'John','age BETWEEN 40 AND 70 AND birth=''Glasgow''')>0 AND
ctxsys.catsearch (surname, 'Smith','age BETWEEN 40 AND 70 AND birth=''Glasgow''')>0
:(The following expands the example to include the birth (as part of the multi_column_datastore) and age (using filter by during index creation and sdata in the query) and show the execution plan. I have provided the script and execution separately.
-- script:
DROP TABLE cust_catalog
EXEC CTX_DDL.DROP_PREFERENCE ('cust_lexer')
EXEC CTX_DDL.DROP_PREFERENCE ('cust_wildcard_pref')
EXEC CTX_DDL.DROP_PREFERENCE ('your_datastore')
EXEC CTX_DDL.DROP_SECTION_GROUP ('your_sec')
CREATE TABLE cust_catalog
(id NUMBER (16),
firstname VARCHAR2 (80),
surname VARCHAR2 (80),
birth VARCHAR2 (25),
age NUMERIC)
INSERT ALL
INTO cust_catalog VALUES (1, 'John', 'Smith', 'Glasgow', 52)
INTO cust_catalog VALUES (2, 'Emaily', 'Johnson', 'Aberdeen', 55)
INTO cust_catalog VALUES (3, 'David', 'Miles', 'Leeds', 53)
INTO cust_catalog VALUES (4, 'Keive', 'Johnny', 'London', 45)
INTO cust_catalog VALUES (5, 'Jenny', 'Smithy', 'Norwich', 35)
INTO cust_catalog VALUES (6, 'Andy', 'Mil', 'Aberdeen', 63)
INTO cust_catalog VALUES (7, 'Andrew', 'Smith', 'London', 64)
INTO cust_catalog VALUES (8, 'John', 'Smith', 'London', 54)
INTO cust_catalog VALUES (9, 'John', 'Henson', 'London', 56)
INTO cust_catalog VALUES (10, 'John', 'Mil', 'London', 58)
INTO cust_catalog VALUES (11, 'Jon', 'Smith', 'Glasgow', 57)
INTO cust_catalog VALUES (12, 'Jen', 'Smith', 'Glasgow', 60)
INTO cust_catalog VALUES (13, 'Chris', 'Smith', 'Glasgow', 59)
SELECT * FROM DUAL
EXEC CTX_DDL.CREATE_PREFERENCE ('cust_lexer', 'BASIC_LEXER')
EXEC CTX_DDL.SET_ATTRIBUTE ('cust_lexer', 'SKIPJOINS' , ',''."+-()/')
EXEC CTX_DDL.Create_Preference ('cust_wildcard_pref', 'BASIC_WORDLIST')
EXEC CTX_DDL.set_attribute ('cust_wildcard_pref', 'prefix_index', 'YES')
EXEC CTX_DDL.CREATE_PREFERENCE ('your_datastore', 'MULTI_COLUMN_DATASTORE')
EXEC CTX_DDL.SET_ATTRIBUTE ('your_datastore', 'COLUMNS', 'firstname, surname, birth')
EXEC CTX_DDL.CREATE_SECTION_GROUP ('your_sec', 'BASIC_SECTION_GROUP')
EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'firstname', 'firstname', TRUE)
EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'surname', 'surname', TRUE)
EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'birth', 'birth', TRUE)
CREATE INDEX context_idx
ON cust_catalog (firstname)
INDEXTYPE IS CTXSYS.CONTEXT
FILTER BY age
PARAMETERS
('DATASTORE your_datastore
SECTION GROUP your_sec
LEXER cust_lexer
WORDLIST cust_wildcard_pref')
COLUMN firstname FORMAT A10
COLUMN surname FORMAT A10
COLUMN birth FORMAT A10
SET AUTOTRACE ON EXPLAIN
SELECT * FROM cust_catalog
WHERE CONTAINS
(firstname,
'(John WITHIN firstname)
AND (Glasgow WITHIN birth)
AND (SDATA (age BETWEEN 40 AND 70))') > 0
SET AUTOTRACE OFF-- execution:
SCOTT@orcl_11gR2> DROP TABLE cust_catalog
2 /
Table dropped.
SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('cust_lexer')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('cust_wildcard_pref')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('your_datastore')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_SECTION_GROUP ('your_sec')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> CREATE TABLE cust_catalog
2 (id NUMBER (16),
3 firstname VARCHAR2 (80),
4 surname VARCHAR2 (80),
5 birth VARCHAR2 (25),
6 age NUMERIC)
7 /
Table created.
SCOTT@orcl_11gR2> INSERT ALL
2 INTO cust_catalog VALUES (1, 'John', 'Smith', 'Glasgow', 52)
3 INTO cust_catalog VALUES (2, 'Emaily', 'Johnson', 'Aberdeen', 55)
4 INTO cust_catalog VALUES (3, 'David', 'Miles', 'Leeds', 53)
5 INTO cust_catalog VALUES (4, 'Keive', 'Johnny', 'London', 45)
6 INTO cust_catalog VALUES (5, 'Jenny', 'Smithy', 'Norwich', 35)
7 INTO cust_catalog VALUES (6, 'Andy', 'Mil', 'Aberdeen', 63)
8 INTO cust_catalog VALUES (7, 'Andrew', 'Smith', 'London', 64)
9 INTO cust_catalog VALUES (8, 'John', 'Smith', 'London', 54)
10 INTO cust_catalog VALUES (9, 'John', 'Henson', 'London', 56)
11 INTO cust_catalog VALUES (10, 'John', 'Mil', 'London', 58)
12 INTO cust_catalog VALUES (11, 'Jon', 'Smith', 'Glasgow', 57)
13 INTO cust_catalog VALUES (12, 'Jen', 'Smith', 'Glasgow', 60)
14 INTO cust_catalog VALUES (13, 'Chris', 'Smith', 'Glasgow', 59)
15 SELECT * FROM DUAL
16 /
13 rows created.
SCOTT@orcl_11gR2> EXEC CTX_DDL.CREATE_PREFERENCE ('cust_lexer', 'BASIC_LEXER')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.SET_ATTRIBUTE ('cust_lexer', 'SKIPJOINS' , ',''."+-()/')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.Create_Preference ('cust_wildcard_pref', 'BASIC_WORDLIST')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.set_attribute ('cust_wildcard_pref', 'prefix_index', 'YES')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.CREATE_PREFERENCE ('your_datastore', 'MULTI_COLUMN_DATASTORE')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.SET_ATTRIBUTE ('your_datastore', 'COLUMNS', 'firstname, surname, birth')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.CREATE_SECTION_GROUP ('your_sec', 'BASIC_SECTION_GROUP')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'firstname', 'firstname', TRUE)
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'surname', 'surname', TRUE)
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> EXEC CTX_DDL.ADD_FIELD_SECTION ('your_sec', 'birth', 'birth', TRUE)
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> CREATE INDEX context_idx
2 ON cust_catalog (firstname)
3 INDEXTYPE IS CTXSYS.CONTEXT
4 FILTER BY age
5 PARAMETERS
6 ('DATASTORE your_datastore
7 SECTION GROUP your_sec
8 LEXER cust_lexer
9 WORDLIST cust_wildcard_pref')
10 /
Index created.
SCOTT@orcl_11gR2> COLUMN firstname FORMAT A10
SCOTT@orcl_11gR2> COLUMN surname FORMAT A10
SCOTT@orcl_11gR2> COLUMN birth FORMAT A10
SCOTT@orcl_11gR2> SET AUTOTRACE ON EXPLAIN
SCOTT@orcl_11gR2> SELECT * FROM cust_catalog
2 WHERE CONTAINS
3 (firstname,
4 '(John WITHIN firstname)
5 AND (Glasgow WITHIN birth)
6 AND (SDATA (age BETWEEN 40 AND 70))') > 0
7 /
ID FIRSTNAME SURNAME BIRTH AGE
1 John Smith Glasgow 52
1 row selected.
Execution Plan
Plan hash value: 495863752
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 136 | 4 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| CUST_CATALOG | 1 | 136 | 4 (0)| 00:00:01 |
|* 2 | DOMAIN INDEX | CONTEXT_IDX | | | 4 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("CTXSYS"."CONTAINS"("FIRSTNAME",'(John WITHIN firstname)
AND (Glasgow WITHIN birth) AND (SDATA (age BETWEEN 40 AND 70))')>0)
Note
- dynamic sampling used for this statement (level=2)
SCOTT@orcl_11gR2> SET AUTOTRACE OFF -
Hi,
While trying to compile a package i am receiving an error
CREATE OR REPLACE Package BODY Etl AS
ERROR at line 1:
ORA-04021: timeout occurred while waiting to lock object
OWNER.ETL
But when i am compliling the package with a different name its getting compiled successfully.
Why its behaving in such a fashion?
Kindly answer?
Thanks in advance.Hi Sid,
The below query will help you check if your resource is being locked
SELECT /*+ ordered */
--b.kaddr,
c.sid,
lock_waiter.waiting_session,
lock_blocker.holding_session,
c.program,
c.osuser,
c.machine,
c.process,
DECODE(u.name,
NULL,'',
u.name||'.'||o.name
) OBJECT,
c.username,
DECODE
b.TYPE,
'BL', 'Buffer hash table instance lock',
'CF', 'Control file schema global enqueue lock',
'CI', 'Cross-instance function invocation instance lock',
'CU', 'Cursor bind lock',
'DF', 'Data file instance lock',
'DL', 'direct loader parallel index create lock',
'DM', 'Mount/startup db primary/secondary instance lock',
'DR', 'Distributed recovery process lock',
'DX', 'Distributed transaction entry lock',
'FS', 'File set lock',
'IN', 'Instance number lock',
'IR', 'Instance recovery serialization global enqueue lock',
'IS', 'Instance state lock',
'IV', 'Library cache invalidation instance lock',
'JQ', 'Job queue lock',
'KK', 'Thread kick lock',
'LA','Library cache lock instance lock (A..P=namespace);',
'LB','Library cache lock instance lock (A..P=namespace);',
'LC','Library cache lock instance lock (A..P=namespace);',
'LD','Library cache lock instance lock (A..P=namespace);',
'LE','Library cache lock instance lock (A..P=namespace);',
'LF','Library cache lock instance lock (A..P=namespace);',
'LG','Library cache lock instance lock (A..P=namespace);',
'LH','Library cache lock instance lock (A..P=namespace);',
'LI','Library cache lock instance lock (A..P=namespace);',
'LJ','Library cache lock instance lock (A..P=namespace);',
'LK','Library cache lock instance lock (A..P=namespace);',
'LL','Library cache lock instance lock (A..P=namespace);',
'LM','Library cache lock instance lock (A..P=namespace);',
'LN','Library cache lock instance lock (A..P=namespace);',
'LO','Library cache lock instance lock (A..P=namespace);',
'LP','Library cache lock instance lock (A..P=namespace);',
'MM', 'Mount definition global enqueue lock',
'MR', 'Media recovery lock',
'NA', 'Library cache pin instance lock (A..Z=namespace)',
'NB', 'Library cache pin instance lock (A..Z=namespace)',
'NC', 'Library cache pin instance lock (A..Z=namespace)',
'ND', 'Library cache pin instance lock (A..Z=namespace)',
'NE', 'Library cache pin instance lock (A..Z=namespace)',
'NF', 'Library cache pin instance lock (A..Z=namespace)',
'NG', 'Library cache pin instance lock (A..Z=namespace)',
'NH', 'Library cache pin instance lock (A..Z=namespace)',
'NI', 'Library cache pin instance lock (A..Z=namespace)',
'NJ', 'Library cache pin instance lock (A..Z=namespace)',
'NK', 'Library cache pin instance lock (A..Z=namespace)',
'NL', 'Library cache pin instance lock (A..Z=namespace)',
'NM', 'Library cache pin instance lock (A..Z=namespace)',
'NN', 'Library cache pin instance lock (A..Z=namespace)',
'NO', 'Library cache pin instance lock (A..Z=namespace)',
'NP', 'Library cache pin instance lock (A..Z=namespace)',
'NQ', 'Library cache pin instance lock (A..Z=namespace)',
'NR', 'Library cache pin instance lock (A..Z=namespace)',
'NS', 'Library cache pin instance lock (A..Z=namespace)',
'NT', 'Library cache pin instance lock (A..Z=namespace)',
'NU', 'Library cache pin instance lock (A..Z=namespace)',
'NV', 'Library cache pin instance lock (A..Z=namespace)',
'NW', 'Library cache pin instance lock (A..Z=namespace)',
'NX', 'Library cache pin instance lock (A..Z=namespace)',
'NY', 'Library cache pin instance lock (A..Z=namespace)',
'NZ', 'Library cache pin instance lock (A..Z=namespace)',
'PF', 'Password File lock',
'PI', 'Parallel operation locks',
'PS', 'Parallel operation locks',
'PR', 'Process startup lock',
'QA','Row cache instance lock (A..Z=cache)',
'QB','Row cache instance lock (A..Z=cache)',
'QC','Row cache instance lock (A..Z=cache)',
'QD','Row cache instance lock (A..Z=cache)',
'QE','Row cache instance lock (A..Z=cache)',
'QF','Row cache instance lock (A..Z=cache)',
'QG','Row cache instance lock (A..Z=cache)',
'QH','Row cache instance lock (A..Z=cache)',
'QI','Row cache instance lock (A..Z=cache)',
'QJ','Row cache instance lock (A..Z=cache)',
'QK','Row cache instance lock (A..Z=cache)',
'QL','Row cache instance lock (A..Z=cache)',
'QM','Row cache instance lock (A..Z=cache)',
'QN','Row cache instance lock (A..Z=cache)',
'QP','Row cache instance lock (A..Z=cache)',
'QQ','Row cache instance lock (A..Z=cache)',
'QR','Row cache instance lock (A..Z=cache)',
'QS','Row cache instance lock (A..Z=cache)',
'QT','Row cache instance lock (A..Z=cache)',
'QU','Row cache instance lock (A..Z=cache)',
'QV','Row cache instance lock (A..Z=cache)',
'QW','Row cache instance lock (A..Z=cache)',
'QX','Row cache instance lock (A..Z=cache)',
'QY','Row cache instance lock (A..Z=cache)',
'QZ','Row cache instance lock (A..Z=cache)',
'RT', 'Redo thread global enqueue lock',
'SC', 'System commit number instance lock',
'SM', 'SMON lock',
'SN', 'Sequence number instance lock',
'SQ', 'Sequence number enqueue lock',
'SS', 'Sort segment locks',
'ST', 'Space transaction enqueue lock',
'SV', 'Sequence number value lock',
'TA', 'Generic enqueue lock',
'TS', 'Temporary segment enqueue lock (ID2=0)',
'TS', 'New block allocation enqueue lock (ID2=1)',
'TT', 'Temporary table enqueue lock',
'UN', 'User name lock',
'US', 'Undo segment DDL lock',
'WL', 'Being-written redo log instance lock',
b.TYPE
) lock_type,
DECODE
b.lmode,
0, 'None', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share', /* S */
5, 'S/Row-X (SRX)', /* C */
6, 'Exclusive', /* X */
TO_CHAR(b.lmode)
) mode_held,
DECODE
b.request,
0, 'None', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Exclusive', /* X */
TO_CHAR(b.request)
) mode_requested
FROM
v$lock b
,v$session c
,sys.USER$ u
,sys.obj$ o
,( SELECT * FROM sys.dba_waiters) lock_blocker
,( SELECT * FROM sys.dba_waiters) lock_waiter
WHERE
b.sid = c.sid
AND u.USER# = c.USER#
AND o.obj#(+) = b.id1
AND lock_blocker.waiting_session(+) = c.sid
AND lock_waiter.holding_session(+) = c.sid
AND c.username != 'SYS'
ORDER BY kaddr, lockwait
The query is from the following site http://www.orafaq.com/scripts/performance/lockall.txt
Unless, the object you are trying to create/replace is being locked by another database object, i dont see how you ll get this error... are you using read write / file access or any such code? can you share your code? it may be accessing a resource that is locked..
Do let me know if this helps
Maybe you are looking for
-
Photoshop CS6 crashes when using burn tool, crop tool, and dodge tool?
Just recently upgraded from Photoshop CS5.5 64bit to Photoshop CS6 64 bit. Crashes when using burn tool, crop tool, or dodge tool? Thanks for your help!
-
Setting up RDP on Cisco 861 HELP !
Hi, Before I installed the Cisco 861 I used a simple Linksys router and RDP worked just fine. I just forwarded port 3389 to the servers IP 192.168.0.1 and everything worked, I could log in into the server. Now I'm trying to set up RDP on a Cisco 861,
-
There is any table which makes the relation between sold to party and ship
Hi Gurus, There is any table which show the relation between ship to party and sold to party. regards gursharan
-
Generating DLL with LabVIEW - A basic question
Hi everybody ! I'm trying to generate a simple DLL with LV. I have read as much as I could on the subject, prepared a small test vi (calculate x*x), built the corresponding dll, inserted and configured the ddl into another vi... Every thing seems to
-
I'm trying to reinstall Elements 10 after a new install of Windows 7 OS. During the installation, the Elements installation field says I'm missing the file archive and to download it. The Adobe reinstall page doesn't say anything about archives. I