How to execute exact match & contains text search simultaneoulsy in Oracle 10g
Hi,
We have scenario where there are more than 50 million rows in a table with description column length as 1000 character. We have a web interface from where we generate a rule of comma separated keywords like
"Standard", Single, Cancel, "deal" & so on. The words in quotes needs to be checked for exact match & the one without quotes will be searched using contains.
The problem is that we can have a rule of such a combination as large as 4000 characters of inclusion & 2000 such characters for exclusion (not to consider the description under exclusion) and this search when run on the table with millions of rows does not work using oracle regular expression, but works with smaller no. of search keywords.
Is there a better way to do such a kind of search in Oracle or if not then outside oracle using any other tool
Thanks,
AP
Please find below the table script, few insert statements along with the SP & function. Please help.
-- Create Table
CREATE TABLE Roomdescriptionmaster
ID long,
ROOMDESCRIPTION nvarchar2, --- max 1000 charaters
Createddate datetime
----- Insert statements
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Double Room (2 Adults + 2 Children) | FREE cancellation before Mar 16, 2014 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Double or Twin Room | FREE cancellation before Feb 1, 2014 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Quadruple Room (3 Adults + 1 Child) | FREE cancellation before Mar 16, 2014 PAY LATER Full board included [ Included:10 % VAT] Meals:Breakfast, lunch & dinner included.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Triple Room with Lateral Sea View (2 Adults + 1 Child) | FREE cancellation before Dec 6, 2013 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Single Room with Lateral Sea View | FREE cancellation before Dec 6, 2013 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
--SP
CREATE OR REPLACE PROCEDURE
SP_PGHGETROOMDESCRIPTION(v_BId number,
v_DaysOfData integer,
v_Incl1 nvarchar2,
v_Incl2 nvarchar2,
v_Incl3 nvarchar2,
v_Excl1 nvarchar2,
v_CurrentIndex integer,
v_RecordPerPage integer,
v_IndexMultiplier integer,
ref_recordset out sys_refcursor
) as
start_index integer;
end_index integer;
Incl1 nvarchar2(2000);
Incl2 nvarchar2(2000);
Incl3 nvarchar2(2000);
Excl1 nvarchar2(2000);
v_desc_utf_value VARCHAR2(10);
begin
v_desc_utf_value:= 'utf8';
if v_incl1 is null or trim(v_incl1) = '' then
--dbms_output.put_line('include 1 is null or blank');
Incl1 := '';
else
Incl1 := lower(v_Incl1);
end if;
if v_incl2 is null or trim(v_incl2) = '' then
--dbms_output.put_line('include 2 is null or blank');
Incl2 := '';
else
Incl2 := lower(v_Incl2);
end if;
if v_incl3 is null or trim(v_incl3) = '' then
--dbms_output.put_line('include 3 is null or blank');
Incl3 := '';
else
Incl3 := lower(v_Incl3);
end if;
if v_Excl1 is null or trim(v_Excl1) = '' then
--dbms_output.put_line('Exclude 1 is null or blank');
Excl1 := '';
else
Excl1 := lower(v_Excl1);
end if;
-- Old code
-- and regexp_like(lower(ROOMDESCRIPTION), Incl1, 'i')
-- and regexp_like(lower(ROOMDESCRIPTION), Incl2, 'i')
-- and regexp_like(lower(ROOMDESCRIPTION), Incl3, 'i')
-- and not regexp_like(lower(ROOMDESCRIPTION), Excl1, 'i')
--- First call to SP
if v_CurrentIndex = 1 then
start_index := v_RecordPerPage * v_IndexMultiplier;
end_index := (v_CurrentIndex - 1 + v_IndexMultiplier) * v_RecordPerPage;
open ref_recordset for
select * from (
select ROOMDESCRIPTION, Createddate, rownum as rn
from roomdescriptionmaster
where BID = v_BId
and TO_NUMBER(trunc(sysdate) - to_date(to_char(createddate, 'yyyy-mm-dd'),'yyyy-mm-dd')) <= v_DaysOfData
and length(FN_GET_RESTRICTION(lower(ROOMDESCRIPTION),Incl1,Incl2,Incl3,Excl1,v_desc_utf_value)) > 0
and row_num <= v_RecordPerPage * v_IndexMultiplier
order by row_num;
else
--- Subsequent calls to SP using paging from UI
start_index := (v_CurrentIndex - 1) * v_RecordPerPage + 1;
end_index := (v_CurrentIndex - 1 + v_IndexMultiplier) * v_RecordPerPage;
open ref_recordset for
select * from (
select ROOMDESCRIPTION, Createddate, rownum as rn
from roomdescriptionmaster
where BID = v_BId
and TO_NUMBER(trunc(sysdate) - to_date(to_char(createddate, 'yyyy-mm-dd'),'yyyy-mm-dd')) <= v_DaysOfData
and length(FN_GET_RESTRICTION(lower(ROOMDESCRIPTION),Incl1,Incl2,Incl3,Excl1,v_desc_utf_value)) > 0
order by roomdescriptionmasterid desc
where rn >= start_index
and rn <= end_index
order by rn;
end if;
commit;
end SP_PGHGETROOMDESCRIPTION;
--Function
CREATE OR REPLACE FUNCTION FN_GET_RESTRICTION(
v_rate_description IN NVARCHAR2,
v_include_1 IN NVARCHAR2,
v_include_2 IN NVARCHAR2,
v_include_3 IN NVARCHAR2,
v_exclude IN NVARCHAR2, v_desc_utf_value IN VARCHAR2)
RETURN NVARCHAR2
IS
CURSOR include_1_cur IS
select regexp_substr(str, '[^,]+', 1, level) str
from (select v_include_1 str from dual)
connect by level <= length(str)-length(replace(str,','))+1;
CURSOR include_2_cur IS
select regexp_substr(str, '[^,]+', 1, level) str
from (select v_include_2 str from dual)
connect by level <= length(str)-length(replace(str,','))+1;
CURSOR include_3_cur IS
select regexp_substr(str, '[^,]+', 1, level) str
from (select v_include_3 str from dual)
connect by level <= length(str)-length(replace(str,','))+1;
CURSOR exclude_cur IS
select regexp_substr(str, '[^,]+', 1, level) str
from (select v_exclude str from dual)
connect by level <= length(str)-length(replace(str,','))+1;
include_1_rec include_1_cur%rowtype;
include_2_rec include_2_cur%rowtype;
include_3_rec include_3_cur%rowtype;
exclude_rec exclude_cur%rowtype;
tmp_var NVARCHAR2(200);
tmp_var_int NUMBER;
tmp_flag_int NUMBER;
return_str NVARCHAR2(200);
tmp_length NUMBER;
tmp_length_include_1 NUMBER;
tmp_length_include_2 NUMBER;
tmp_length_include_3 NUMBER;
tmp_length_exclude NUMBER;
tmp_regex_pattern VARCHAR2(1000);
flag_include_1_match INTEGER;
flag_include_2_match INTEGER;
flag_include_3_match INTEGER;
flag_exclude_match INTEGER;
BEGIN
tmp_length_include_1 := nvl(length(v_include_1),0);
tmp_length_include_2 := nvl(length(v_include_2),0);
tmp_length_include_3 := nvl(length(v_include_3),0);
tmp_length_exclude := nvl(length(v_exclude),0);
flag_include_1_match := 0;
flag_include_2_match := 0;
flag_include_3_match := 0;
flag_exclude_match := 0;
IF tmp_length_include_1>0 OR tmp_length_include_2 >0
OR tmp_length_include_3 >0 OR tmp_length_exclude >0 THEN
IF v_desc_utf_value ='utf8' THEN
----------------------------------------------------- UTF 8 STARTED --------------
----------------------------------------- INCLUDE 1
tmp_length := tmp_length_include_1;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
FOR include_1_rec in include_1_cur
LOOP
tmp_var := trim('' || include_1_rec.str);
--dbms_output.put_line(tmp_var);
tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_1_match := 1;
EXIT;
END IF;
END LOOP;
ELSE
flag_include_1_match := 1;
END IF;
-------------------------------------------- INCLUDE 2
tmp_length := tmp_length_include_2;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
IF flag_include_1_match =1 THEN
FOR include_2_rec in include_2_cur
LOOP
tmp_var := trim('' || include_2_rec.str);
tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_2_match := 1;
EXIT;
END IF;
END LOOP;
END IF;
ELSE
flag_include_2_match := 1;
END IF;
-------------------------------------------- INCLUDE 3
tmp_length := tmp_length_include_3;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
IF flag_include_2_match =1 THEN
FOR include_3_rec in include_3_cur
LOOP
tmp_var := trim('' || include_3_rec.str);
tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_3_match := 1;
EXIT;
END IF;
END LOOP;
END IF;
ELSE
flag_include_3_match := 1;
END IF;
-------------------------------------------- EXCLUDE
tmp_length := tmp_length_exclude;
IF tmp_length > 0 and flag_include_3_match =1 THEN
FOR exclude_rec in exclude_cur
LOOP
tmp_var := trim('' || exclude_rec.str);
tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int := -1;
return_str := '';
EXIT;
END IF;
END LOOP;
END IF;
ELSE
----------------------------------------------------- UTF 16 STARTED --------------
----------------------------------------- INCLUDE 1
tmp_length := tmp_length_include_1;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
FOR include_1_rec in include_1_cur
LOOP
tmp_var := trim('' || include_1_rec.str);
--dbms_output.put_line(tmp_var);
tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_1_match := 1;
EXIT;
END IF;
END LOOP;
ELSE
flag_include_1_match := 1;
END IF;
-------------------------------------------- INCLUDE 2
tmp_length := tmp_length_include_2;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
IF flag_include_1_match =1 THEN
FOR include_2_rec in include_2_cur
LOOP
tmp_var := trim('' || include_2_rec.str);
tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_2_match := 1;
EXIT;
END IF;
END LOOP;
END IF;
ELSE
flag_include_2_match := 1;
END IF;
-------------------------------------------- INCLUDE 3
tmp_length := tmp_length_include_3;
IF tmp_length > 0 THEN
tmp_flag_int :=0;
IF flag_include_2_match =1 THEN
FOR include_3_rec in include_3_cur
LOOP
tmp_var := trim('' || include_3_rec.str);
tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int :=1;
flag_include_3_match := 1;
EXIT;
END IF;
END LOOP;
END IF;
ELSE
flag_include_3_match := 1;
END IF;
-------------------------------------------- EXCLUDE
tmp_length := tmp_length_exclude;
IF tmp_length > 0 and flag_include_3_match =1 THEN
FOR exclude_rec in exclude_cur
LOOP
tmp_var := trim('' || exclude_rec.str);
tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
IF (tmp_var_int <> 0) THEN
tmp_flag_int := -1;
return_str := '';
EXIT;
END IF;
END LOOP;
END IF;
END IF;
IF tmp_flag_int = 1 THEN
return_str := 'truely matched';
ELSE
return_str := '';
END IF;
ELSE
return_str := '';
END IF;
return return_str;
EXCEPTION
WHEN OTHERS THEN
--dbms_output.put_line('Exception');
RAISE;
END FN_GET_RESTRICTION;
Similar Messages
-
How fast text search field in Oracle without using Intermedia?
How fast text search field in Oracle without using Intermedia? Thank you, Paul.
yes,it is overriden in VOImpl
public void executeQuery()
setQuery((new StringBuilder()).append(selectStmt).append(" order by ").append(getOrderByClause()).toString());
OAApplicationModuleImpl oaapplicationmoduleimpl = (OAApplicationModuleImpl)getApplicationModule();
OAApplicationModuleImpl _tmp = oaapplicationmoduleimpl;
if(oaapplicationmoduleimpl.isLoggingEnabled(1))
OAApplicationModuleImpl _tmp1 = oaapplicationmoduleimpl;
oaapplicationmoduleimpl.writeDiagnostics((new StringBuilder()).append(getClass().getName()).append(".executeQuery").toString(), (new StringBuilder()).append(" Query:").append(getQuery()).toString(), 1);
super.executeQuery();
But I have extended VO and substituted the VO . In the substituted VOImpl, instead of executeQuery(),I have written
public void customExecuteQuery()
setQuery((new StringBuilder()).append(selectStmt).append(" order by ").append(getOrderByClause()).toString());
executeQuery();
Will this work,or do I need to do any changes?
Thanks, -
How to get exact match when working with Oracle Text?
Hi,
I'm running Oracle9i Database R2.
I would like to know how do I get exact match when working with Oracle Text.
DROP TABLE T_TEST_1;
CREATE TABLE T_TEST_1 (text VARCHAR2(30));
INSERT INTO T_TEST_1 VALUES('Management');
INSERT INTO T_TEST_1 VALUES('Busines Management Practice');
INSERT INTO T_TEST_1 VALUES('Human Resource Management');
COMMIT;
DROP INDEX T_TEST_1;
CREATE INDEX T_TEST_1_IDX ON T_TEST_1(text) INDEXTYPE IS CTXSYS.CONTEXT;
SELECT * FROM T_TEST_1 WHERE CONTAINS(text, 'Management')>0;
The above query will return 3 rows. How do I make Oracle Text to return me only the first row - which is exact match because sometimes my users need to look for exact match term.
Please advise.
Regards,
Jap.But I would like to utilize the Oracle Text index. Don't know your db version, but if you slightly redefine your index you can achieve this (at least on my 11g instance) :
SQL> create table t_test_1 (text varchar2(30))
2 /
Table created.
SQL> insert into t_test_1 values ('Management')
2 /
1 row created.
SQL> insert into t_test_1 values ('Busines Management Practice')
2 /
1 row created.
SQL> insert into t_test_1 values ('Human Resource Management')
2 /
1 row created.
SQL>
SQL> create index t_test_1_idx on t_test_1(text) indextype is ctxsys.context filter by text
2 /
Index created.
SQL> set autotrace on explain
SQL>
SQL> select text, score (1)
2 from t_test_1
3 where contains (text, 'Management and sdata(text="Management")', 1) > 0
4 /
TEXT SCORE(1)
Management 3
Execution Plan
Plan hash value: 4163886076
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 29 | 4 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| T_TEST_1 | 1 | 29 | 4 (0)| 00:00:01 |
|* 2 | DOMAIN INDEX | T_TEST_1_IDX | | | 4 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("CTXSYS"."CONTAINS"("TEXT",'Management and
sdata(text="Management")',1)>0)
Note
- dynamic sampling used for this statementJust read that you indeed mentioned your db version in your first post.
Not sure though if above method is already available in 9i ...
Message was edited by:
michaels -
How to execute code from a text file?
Hello all!
How to execute some code lines from a text file? For example my file is:
String varname = "somecontents";
JFrame frame = new JFrame();
frame.setVisible(true);How can I get contents of this file and parse them if I want get new JFrame and access to the variable varname?I mean the PHP would generate a readable Java source,
for example some variables with some data, and I just
dont know what to do with file if I want generate the
xls file from my saved data, could You help? :)Some variables, some data, PHP, Java, XLS file??? Al rather vague.
You need to explain in more detail what it is you're trying to do if you want an answer to your question! -
ITunes 10 search for exact match or Boolean Searches
Is there a way to force an exact match when performing a search in iTunes?
I tried putting "" around my search and get no results.
The goal would be to search Artists for the artist "Hem", and only show results for only "Hem" and not both "Hem" and "Edie Brickel and the New Bohemians"
As far as I can tell there are no Boolean search options in here either.
iTunes 10.1 (54)Mad.Macs wrote:
Thanks,
I know Smart Playlists is a workaround for this, but that is about that is about 6 clicks plus typing to accomplish what could be done by simply typing in "hem" in the search field. If you use Smart Playlists for this, you would also need to go back and delete the playlist when you are done.
Yep, like I said I leave it there for next time....
I wonder why they would leave what is now a universally understood search option out of iTunes?
Who knows? Feature requests go to iTunes Feedback.
tt2 -
How to create an image contains text
hello folks,
I want create a zoomable gaphical application that contains text. By a simple example, I will put the paragraph of text in a rectangle. I used BufferedImage and Graphics2D for draw the rectangle and using function drawString(String, X, Y) for draw Text but I have met a wrap problem when the rectangle is zoomed. I want that when the rectangle is zooming there is not the difference of wrapping of two rectangles. (there is only the change of zoom ratio of 2 rectangles)
Pls, give me a solution.
many thanks,
jav
PS: Sorry for my bad english. :-)met a wrap problemIf you want to clarify your problem for audience of the forum, you shoul post a small demo code that is generally compilable, runnable and could reproduce your problem. See: http://homepage1.nifty.com/algafield/sscce.html and this wiki.
As a stabbing in the dark, I'd say the problem could be solved by constantly recreating/redrawing the text-image during the zoom operation. Optimization might be preloading of the images. -
How to insert a JPG file from file system to Oracle 10g?
I have developed a schema to store photos as BLOB which store the text description as CLOB original filename, file size.
I also use ctxsys.context to index TEXT_DESCRIPTION in order to perform Oracle Text Search and it works.
I would like to insert some JPG file from say C:\MYPHOTO\Photo1.jpg as a new record. How can I do this in SQL PLus and/or Loader?
How can I retrieve the PHOTO_IMAGE back to the file system using SQL Plus and/or command line in DOS?
See the following script:
create user myphoto identified by myphoto;
grant connect, resource, ctxapp to myphoto;
connect myphoto/myphoto@orcl;
PROMPT Creating Table PHOTOS
CREATE TABLE PHOTOS
(PHOTO_ID VARCHAR2(15) NOT NULL,
PHOTO_IMAGE BLOB,
TEXT_DESCRIPTION CLOB,
FILENAME VARCHAR2(50),
FILE_SIZE NUMBER NOT NULL,
CONSTRAINT PK_PHOTOS PRIMARY KEY (PHOTO_ID)
create index idx_photos_text_desc on
PHOTOS(TEXT_DESCRIPTION) indextype is ctxsys.context;
INSERT INTO PHOTOS VALUES
('P00000000000001', empty_blob(), empty_clob(),
'SCGP1.JPG',100);
INSERT INTO PHOTOS VALUES
('P00000000000002', empty_blob(), 'Cold Play with me at the concert in Melbourne 2005',
'COLDPLAY1.JPG',200);
INSERT INTO PHOTOS VALUES
('P00000000000003', empty_blob(), 'My parents in Melbourne 2001',
'COLDPLAY1.JPG',200);
EXEC CTX_DDL.SYNC_INDEX('idx_photos_text_desc');
SELECT PHOTO_ID ,TEXT_DESCRIPTION
FROM PHOTOS;
SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
FROM PHOTOS
WHERE CONTAINS(TEXT_DESCRIPTION,'parents',1)> 0
ORDER BY score(1) DESC;
SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
FROM PHOTOS
WHERE CONTAINS(TEXT_DESCRIPTION,'cold play',1)> 0
ORDER BY score(1) DESC;
SELECT score(1),score(2), PHOTO_ID ,TEXT_DESCRIPTION
FROM photos
WHERE CONTAINS(TEXT_DESCRIPTION,'Melbourne',1)> 0
AND CONTAINS(TEXT_DESCRIPTION,'2005',2)> 0
ORDER BY score(1) DESC;Hi
You can use the following to insert an image:
create table imagetab(id number primary key,imagfile blob, fcol varchar2(10));
create or replace directory imagefiles as 'c:\'
declare
v_bfile BFILE;
v_blob BLOB;
begin
insert into imagetab (id,imagfile,fcol)
values (3,empty_blob(),'BINARY')
return imagfile into v_blob;
v_bfile := BFILENAME ('IMAGEFILES', 'MyImage.JPG');
Dbms_Lob.fileopen (v_bfile, Dbms_Lob.File_Readonly);
Dbms_Lob.Loadfromfile (v_blob, v_bfile, Dbms_Lob.Getlength(v_bfile));
Dbms_Lob.Fileclose(v_bfile);
commit;
end;
/ -
Text trucated in report oracle 10g
Hi,
I have problem with report, when a execute my report in web my text trucated.
Any ideas ?
Thank in advanceWell, instead of being confused, you could go to http://www.oracle.com/pls/db102/portal.portal_db?selected=1 and look at
1) the licensing document, which would tell you whether you need a separate license, and
2) under the 'Books' tab, look at the Text Application Developer's Guide or the Text Reference manuals for details.
You could also look for the Oracle Text forum (from the http://forums.oracle.com page, under Database - More, or Text and ask the people who concentrate on that set of features.
In general, Oracle Text is a set of extensions, the definitions for which are stored under user ctxsys. You would use these extensions by creating your own objects that are based on the extensions.
For example, suppose your tables contain varchar2 columns. Create indexes that are based on ctxsys's 'context index type' and your application can then use the 'CONTAINS' keyword search capability (which is effectively a ctxsys-owned extension to the select)
However, you would never log on to ctxsys and do anythibng with that as you risk changing the template code that Oracle has supplied.
Message was edited by:
Hans Forbrich
PS: Yes, Oracle Text is included as part of the base database. Most of it is even included in the free Oracle XE database. -
How can I solve memory lick, which occurs when operate Oracle 10g DB ?
I'm using Dell power Edge2850 server(dual CPU, 4GB Ram), RedHat AS 3 and Oracle 10g SE ONE. When I started the server, transaction speed was very fast. But after several day, the system has been getting slower seriously.
So I monitored my system using 'top'. And I've found that almost 30MB swap memory has been used and CPU usage has been only 23%. But there has been 2GB idle Ram memory. Besides when Oracle don't execute any operation, swap memory is not freed. After I started my server, swap memory allocated has been getting larger and larger. And the speed of my system has been getting slower and slower.
I think that it is very strange thing not to free swap memory when there is no operation on the server.
Of course, swapping which rise with large transaction is not problem. But it is a serious problem not to free swap memory when there is no transaction.
How can I solve this ploblem? Thanks.This means the the URL for database control will use the http protocol. To convert to the https protocol (using the included SSL certificate), use the steps documented above. Before doing so, pl review MOS Doc 1222603.1
HTH
Srini -
How to increasethe throughput of the I/O subsystem in Oracle 10g?
How to increase the throughput of the I/O subsystem in oracle 10g.
OS : Windows 2003 ServerI think your ADDM report may well be wrong.
In another thread you've reported the ADDM for this 23 hours as showing::
This is my ADDM report:
Analysis Period: from 06-MAY-2008 09:30 to 07-MAY-2008 08:30
Database Version: 10.2.0.1.0
Snapshot Range: from 2656 to 2679
Database Time: 100249 seconds
Average Database Load: 1.2 active sessions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FINDING 1: 100% impact (100249 seconds)
Significant virtual memory paging was detected on the host operating system.
RECOMMENDATION 1: Host Configuration, 100% benefit (100249 seconds)
ACTION: Host operating system was experiencing significant paging but no
particular root cause could be detected
At the same time, your extract from the matching AWR report shows:
Event Waits Time(s) Avg Wait(ms) % Total Call Time Wait Class
db file scattered read 20,665,706 48,083 2 48.0 User I/O
CPU time 30,114 30.0
db file sequential read 3,661,225 14,740 4 14.7 User I/O
read by other session 454,471 2,933 6 2.9 User I/O
db file parallel write 485,625 1,426 3 1.4 System I/O
So the AWR in these 5 events shows 97,000 seconds of time, but 100% of the total DB time is supposed to be related to Host swap time. The two sets of numbers are not consistent.
Moreover, the wait times are showing "db file scattered reads" with an average time of slightly less than 2.4 milliseconds. It would be a little surprising if you have a swapping problem AND I/O times that were operating at cache speeds. (Your db file sequential reads also have a very good average wait time).
23 hours is not a helpful interval though - the average may be hiding shorter periods of nasty activity when reponse time is bad. So (as Charles Hooper indicated) - where, or when, do you perceive a performance issue; and what do you get from ADDM or AWR for a shorter time-range around that period.
My first thought, looking at the numbers you've supplied, is that if you think some critical SQL is running slowly is that you're probably working too hard because you are missing (or not using) some critical indexes. In your place, I'd run off a few one-hour AWR reports in that 23 hours, and look at 'SQL ordered by elapsed time' or 'SQL ordered by reads' for the top few statements, then pick up their execution plans by running the awrsqrpt.sq report.
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
P.S. Please check the FAQ (see top right of page) for details on how to use the PRE tag to supply code and reports in a fixed font that makes them more readable. -
How do I connect from Crystal Report version XI to Oracle 10G express?
I'm new to oracle 10G express and I'm developing an application that needs reports to preview some data from oracle tables.
The oracle database is installed on the server and I installed the client on my machine. I need to use the crystal report 11 to report the output. Thus, I designed a crystal report that should simply read a table on oracle and though I need to be able to connect to the oracle 10G Express Edition database. I tried to create a connection from the crystal report using the Database Expert >> Create New Connection >> Oracle Server and I include the following parameters.:
- Service: host:1521/XE
- Username: username
- Password: password
Then when I tried to connect the crystal report crashes always.
Is there any way to create a connection to the Oracle Database 10G express from Crystal Report 11?
Please advise...Thank you bala,
First, How I should start the Listener on the database server?
Listener.ora content:
SID_LIST_LISTENER =
+(SID_LIST =+
+(SID_DESC =+
+(SID_NAME = PLSExtProc)+
+(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)+
+(PROGRAM = extproc)+
+)+
+(SID_DESC =+
+(SID_NAME = CLRExtProc)+
+(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)+
+(PROGRAM = extproc)+
+)+
+)+
LISTENER =
+(DESCRIPTION_LIST =+
+(DESCRIPTION =+
+(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))+
+(ADDRESS = (PROTOCOL = TCP)(HOST = Daoud-PC)(PORT = 1521))+
+)+
+)+
DEFAULT_SERVICE_LISTENER = (XE)
How to configure the tnsnames.ora on the client side?
tnsnames.ora content:
XE =
+(DESCRIPTION =+
+(ADDRESS = (PROTOCOL = TCP)(HOST = Daoud-PC)(PORT = 1521))+
+(CONNECT_DATA =+
+(SERVER = DEDICATED)+
+(SERVICE_NAME = XE)+
+)+
+)+
EXTPROC_CONNECTION_DATA =
+(DESCRIPTION =+
+(ADDRESS_LIST =+
+(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))+
+)+
+(CONNECT_DATA =+
+(SID = PLSExtProc)+
+(PRESENTATION = RO)+
+)+
+)+
ORACLR_CONNECTION_DATA =
+(DESCRIPTION =+
+(ADDRESS_LIST =+
+(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))+
+)+
+(CONNECT_DATA =+
+(SID = CLRExtProc)+
+(PRESENTATION = RO)+
+)+
+)+
Now I`m trying to initialize this on one machine (database & client) and so the crystal report will be on the same machine where the database exist; Additionally, this machine has OS Windows 7 Ultimate 64bit and include the Oracle 10g Express Database & Oracle 10g Express Client software.
Please check the files content I included above and give me the way on how to establish a connection from the crystal report to the database where both are installed on the same machine.
Thanks in advance... -
How to find exception occured while using LOGON function in oracle 10g
Hi,
I am using LOGON function to login with a different user name in oracle 10g forms.
LOGON ( User, Pass@tns, FALSE)
The third parameter is passed as 'FALSE' to avoid the login screen to be opened. If any of the other parameter ( User Name, Password, TNS) is passed wrong, connection is not established but no exception is occurred. The value for 'FORM_FAILURE' is set to 'TRUE'.
What i need is the ORA error for connection failure. The error message related to user name/password (ORA-01017) or connection identifier (ORA-12155).
How i can get this error code if connection is failed. Is there any other way to login in oracle forms other than 'LOGON'.
HabibHabib Ahmad wrote:
Hi,
I am using LOGON function to login with a different user name in oracle 10g forms.
LOGON ( User, Pass@tns, FALSE)
The third parameter is passed as 'FALSE' to avoid the login screen to be opened. If any of the other parameter ( User Name, Password, TNS) is passed wrong, connection is not established but no exception is occurred. The value for 'FORM_FAILURE' is set to 'TRUE'.
What i need is the ORA error for connection failure. The error message related to user name/password (ORA-01017) or connection identifier (ORA-12155).
How i can get this error code if connection is failed. Is there any other way to login in oracle forms other than 'LOGON'.As salamu alikum, Habib
If you pass FALSE in login you can't catch anything. Want to catch the error ?
Then change
LOGON ( User, Pass@tns, FALSE)
to
LOGON ( User, Pass@tns, TRUE) Now Create On-Error trigger at form level
and try the following code
if error_code=01017 then
message('invalid user name or password');
message('invalid user name or password');
raise form_trigger_failure;
elsif error_code=12154 or error_code=1215 then
message('invalid connection string');
message('invalid connection string');
raise form_trigger_failure;
end if;Hopes this helps
If someone's response is helpful or correct, please mark it accordingly. -
How to trace the flow of plsql procedures/functions in oracle 10g
Hi All,
Recently I came to know that there is dbms_hprof PL/SQL built-in package in Oracle 11g which can be used to trace PL/SQL calls in a Hierarchical way. (acts as a PL/SQL Hierarchical Profiler).
Steps are given in -
http://www.oracle-base.com/articles/11g/PlsqlHierarchicalProfiler_11gR1.php
I would like to know whether there is a similar package in Oracle 10g because I want to trace the flow of plsql procedure and function calls in order to generate an output in a hierarchical way (for debug purposes).
The following example shows the flow of procedure calls when I execute PACKAGE_A.Proceudure_A. I want to generate that kind of an output.
Ex -
PACKAGE_A.Proceudure_A
----|_PACKAGE_A.Proceudure_B
----|------|_PACKAGE_B.Proceudure_C
----|_PACKAGE_B.Proceudure_M
----|------|_PACKAGE_A.Proceudure_B
----|-------------|_PACKAGE_C.Proceudure_C
----|_PACKAGE_Z.Proceudure_Z
If there is no similar package in *10g* I would really appreciate if someone can provide me directions to get the job done using the exsting packages and tables in Oracle 10g. Thanks in advance.
Edited by: user8326781 on Nov 28, 2008 8:57 PM
Edited by: user8326781 on Nov 28, 2008 8:58 PM
Edited by: user8326781 on Nov 29, 2008 12:19 AMI am not sure that this would serve the purpose or not but still, I guess its worth to atleast be mentioned,
http://www.oracle-base.com/articles/9i/DBMS_TRACE.php
HTH
Aman.... -
How to transfer database tables from sql server 2000 to oracle 10g
Hi,
I have a database and tables in sql server 2000. I have to transfer those data to Oracle 10g. I have installed Oracle warehouse Builder ETL Tool. Using this how can i transfer data. Any help is vary helpful for me.
Thanks in advance.you have to do it using ODBC HS.
1. Configure ODBC connection through gateway.
2. Create a initxxx.ora file with HS config.
restart gateway listener services
3. on target o/s add entries to your tnsnames.ora
4. On your target o/s create a db link
restart listener on target
cheeck this out.Non-Oracle connection through HS issue
Edited by: Darthvader-647181 on Jan 29, 2009 2:02 AM -
How to run Pro*C application with Instant Client in Oracle 10g
i am try to run but Pro*C application give error orasql10.dll
i have downlod Instant Client in Oracle 10g from site. i have unzip and maked environmental virable in PC.
but application not run. given error orasql10.dll .......
my problem is thrat i want to run Pro*C application with Instant Client in Oracle 10g .....
oracle say that run but how........According to this thread, it does not work on Windows:
Does Instant Client 10.1.0.4 for Windows 32 support ProC ?
Maybe you are looking for
-
Hi everyone, Hope you can help me out on a couple of issues I've been experiencing during the initial stages of a project to upgrade an on premise Exchange 2007 to 2013. On Monday last week I installed the first Exchange 2013 server into the network
-
Hi Group, I am using Record ser per message to split my large volume messages,but in my input I have one header,unbounded items,one tailor when I am using record set message it is splitting items and getting error in the MONI that Header target not a
-
Hi Experts , I am working on Pre trip approval workflow. Functionality : Employee signs in the portal and send the request for trip plan . Manager has 3 options 1. approve 2. reject 3. send back for correction . Issue : approve and reject is working
-
We've created communication server using java nio socket where you can create clients of any language using socket to communicate to the server(java nio) application we made. The communication server can handle thousands of concurrent connected clien
-
How do change security questions and rescue email ( Forgot! )
Help me Please This wil mean so much thx