How to use Oracle Hints in OBIEE
Hello guys
I have a report that is running forever and I have reviewed the explain plan over and over, which makes me think that the join between these 2 tables are slowing everything down --- The fact table has 10Billion records and the Dim has 10 Millions records. Even if the report has filters on various columns of the 2 tables, it is still taking forever. The explain is showing that its doing a nested loop join of these 2 tables which takes a lot of time.
I am thinking of using some Hint to force the query to scan the dimension table first (with the filter condition I defined, it will return 80 rows only from Dim table), and then use the result set of the scanning to go and look for matching records only in the fact table. Its should help speed up the query..
I'd like to know what kind of hints can help with that kind of operation, also how to define these kind of hints in OBIEE. Now I know that in Physical Layers, I can include hints in physical table property, but how to determine which table (fact or dim) to embed the join hints?
Need advice from anybody who have experience working with hints?
Much appreciation!
Just an update:
I have tried a couple of join operation hints like USE_NL and USE_HASH hints, it changes the join method but didn't help with performance at all.
The original SQL that OBIEE generates is: ----------Takes about 20 mins to return a dozen rows
select sum(T991020.LP Amount) as c1,
T991021.DAYOFWEEK as c2,
T991021.PU DATES as c3
from RD_Grant.PU_DATES T991021, Dimension -----Huge
PU_Grant.PU_FACTS_9 T991020 FACT ----Gigantic
where (T991020.COMPANY = T991021.COMPANY
and T991020.DATES = T991021.DATES
and T991020.DATES between "10/10/2009" and "31/10/2009"
and T991021.DAYOFWEEK = 'Sunday'
and T991021.DATES between '09/13/2009' and '11/03/2009')
group by T991021.PU DATES, T991021.DAYOFWEEK
Basically I am still thinking of finding a way to force the query to scan the dimension table first (with the filter condition I defined, it will return 80 rows only from Dim table), and then use the result set of the scanning to go and look for matching records only in the fact table. Its should help speed up the query..
Any suggestions?
Thanks
Edited by: user7276913 on Nov 5, 2009 7:07 PM
Edited by: user7276913 on Nov 5, 2009 7:22 PM
Similar Messages
-
How to use oracle fusion middleware for integration project ?
hi all,
in my projects, customer (a bank) already has many applications (bankend & frontend) that are complicatedly connected. I intend to use oracle fusion middleware to integrate all applications and make adding new applications in the future easier. I have worked through documents in the oracle website but I still have no idea how to use oracle fusion middleware to address the requirement, besides oracle fusion middleware includes a bundle of applications I don't know which one I would need.
could anyone give me some instructions ? appreciate your help.
thank very much,Hi,
For this short description of environment, could be ODI is a incredible tool to help you...
Take a look into my blog that has a lot of concepts and "how to do" instructions.... http://odiexperts.com
However to try help you, what are the used technologies?
Where are you from?
Cezar Santos
http://odiexperts.com -
How to use Oracle partitioning with JPA @OneToOne reference?
Hi!
A little bit late in the project we have realized that we need to use Oracle partitioning both for performance and admin of the data. (Partitioning by range (month) and after a year we will move the oldest month of data to an archive db)
We have an object model with an main/root entity "Trans" with @OneToMany and @OneToOne relationships.
How do we use Oracle partitioning on the @OneToOne relationships?
(We'd rather not change the model as we already have millions of rows in the db.)
On the main entity "Trans" we use: partition by range (month) on a date column.
And on all @OneToMany we use: partition by reference (as they have a primary-foreign key relationship).
But for the @OneToOne key for the referenced object, the key is placed in the main/source object as the example below:
@Entity
public class Employee {
@Id
@Column(name="EMP_ID")
private long id;
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="ADDRESS_ID")
private Address address;
EMPLOYEE (table)
EMP_ID FIRSTNAME LASTNAME SALARY ADDRESS_ID
1 Bob Way 50000 6
2 Sarah Smith 60000 7
ADDRESS (table)
ADDRESS_ID STREET CITY PROVINCE COUNTRY P_CODE
6 17 Bank St Ottawa ON Canada K2H7Z5
7 22 Main St Toronto ON Canada L5H2D5
From the Oracle documentation: "Reference partitioning allows the partitioning of two tables related to one another by referential constraints. The partitioning key is resolved through an existing parent-child relationship, enforced by enabled and active primary key and foreign key constraints."
How can we use "partition by reference" on @OneToOne relationsships or are there other solutions?
Thanks for any advice.
/MatsCrospost! How to use Oracle partitioning with JPA @OneToOne reference?
-
Using Oracle Hints in Selects......
Hello,
Are there any after effects/side effects by using Oracle Hints in a SQL select ??? (hints such as Cache, NOCache, all_rows)
Can anyone let me know whether there are any good documentation or site on Oracel SQL hints..
thanks
KanchiHi!
There is an exception, that I think is a bug in Oracle, but I4m not sure. If you use the PARALLEL HINT in a select that will be use in a Cursor, in order to insert the results in other table, and the results come in groups built following a group by sentence, there are possibilities that two childs (a child is a parallel process) take portions of this whole group, and built each one one group.
If the new table use certain number of columns as a primary key, this may cause an duplicated primary key trigger.
I4m going to write and document this case, in order to show it to oracle support.
I hope this help. Bye.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by kanchana Hettiarachchi ([email protected]):
Hello,
Are there any after effects/side effects by using Oracle Hints in a SQL select ??? (hints such as Cache, NOCache, all_rows)
Can anyone let me know whether there are any good documentation or site on Oracel SQL hints..
thanks
Kanchi<HR></BLOCKQUOTE>
null -
How to use Oracle refcursor dataset output parameter from SP
Can I request for help on how to use Oracle Output parameter from a stored procedure as a source. I need the output tobe stored in a flat file
Thanks
Abhijit
Message was edited by:
Abhijit77yes I would like to use it for ODI.. I would like the ouput of the refcursor to be fed to a text file using ODI. How to handle the records returned by the refcursor and map with txt file.
-
How to Use Oracle 8i with MapX?
I am trying to work with oracle 8i 1.6 and mapX 4.5 but un-able to do so. I tried by adding server layer but couldn't do so.
Help !!Crossposted: Re: How to use Oracle partitioning with JPA @OneToOne reference?
-
How to configure Oracle SSO for OBIEE
Hi all
Can anyone help me saying how to configure Oracle Single Sign-on with OBIEE?
Basically I want to enable a common login for Dashboard and answers using SSO.
I am using OBIEE 10.1.3.4 on a Redhat Linux
thanks in advanceHi...
See this, hope this what you want...??
If not .. ignore...
Thanks & Regards
Kishore Guggilla -
How to use Google Chart in OBIEE
Hi Experts,
How we can use google chart in OBIEE 10g or OBIEE 11g.
ThanksHi ,
If you refer to Google Maps then refer the following link.
http://obiee101.blogspot.in/search?q=google
Google organization Chart
Oracle Business Intelligence by Sandeep Venu: Google Organization Chart in OBIEE 11G
Google Chart
Oracle BI Solutions: OBIEE - Google Charts
Thanks,
Pavani -
How to insert ORACLE HINT into select statement....
Hi team,
Can you please suggest me how to add an Oracle hint to point the Program to BSAD~1.
Index BSAD1 has all three fields MANDT, BUKRS, AUGDT which are there in the where clause. But as per the execution plan index BSAD0 is being used which is the primary one.
Also the stats for this table are are current.
Thanks in Advance.
Puneet.Hi punnet, look at this example:
SELECT MAX( kkop~augbd )
INTO it_gen_docs-augbd
FROM ( fkkvkp AS vkp INNER JOIN dfkkop AS kkop
ON vkpvkont = kkopvkont ) INNER JOIN dfkkko AS kkko
ON kkopaugbl = kkkoopbel
WHERE vkp~exvko = ti_cuentas-exvko
AND kkop~bukrs = p_bukrs
AND kkop~blart IN r_blart
AND kkop~augst = '9'
AND kkko~blart IN r_blartd
%_HINTS ORACLE 'INDEX("DFKKOP" "DFKKOP~Z07")'.
DFKKOP is the table name and DFKKOP~Z07 is the index.
I hope this helps you. -
How to connect Oracle 10g from OBIEE on Linux?
- OBIEE 10.1.3.4.0 is running on Cent 5 Linux M1 (*64* bit). My Oracle database is running another similar machine M2.
- I installed oracle 64 bit client on M1 but could not connect to run the report, connection issue. Even nqcmd didn't helped.
- I guess it was because OBIEE is *32* bit application and hence need 32 bit client.
- I tried installing Oracle 32 bit Linux client on M1 but installation fails with some dependency (Not sure if we can install 32 bit client on 64 bit machine)
Q1 - Any suggestion at this point?
Q2 - Is there any way we could connect OBIEE to Oracle via ODBC drivers. I could not found any odbc driver/so file when I wan installed 64 bit client. Any suggestion for this?
Thanks in Advance!The computer running XE server does not need a client installed.
If you are trying to connect from another computer, install the XE client and create file C:\XEClient\NETWORK\ADMIN\TNSNAMES.ORA with the following contents (replace ip_address as appropriate):
XE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ip_address)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = XE)
{code}Test with
{code:java}
sqlplus SYSTEM/password@XE
{code}
Regards,
Georger
wrote:user_7000018
Hi ,
i am using oracle 10g express edition. i installed oracle 10 xe server it is working fine but how can i connect oracle 10g xe client to this server becouse there is no net configuaration nad Migration tools and also net configuation Assistant . can you explain
Regards,
Dharmendra -
How to use Oracle Table Type values in Select Statement.
Hi,
I am fetching initial set of values into Oracle Table of Records Type and want to use list of values in the Select statement.
For example, try something like the following:
TYPE t_record IS RECORD (
ID TABLEA.ID%type,
NO TABLEA.NO%type,
v_record t_record;
TYPE t_table IS TABLE OF v_record%TYPE;
v_table t_table;
-- Code to populate the values in v_table here.
SELEC ID,NO, BULK COLLECT INTO <some other table variabes here> FROM TABLEA
WHERE ID IN v_table(i).ID;
I want to know how to use the values from Oracle Table Type in the Select Statement.Something like this:
create or replace type t_record as object (
id number,
no number
CREATE or replace type t_table AS TABLE OF t_record;
set serveroutput on
declare
v_table t_table := t_table();
v_t1 t_table := t_table();
begin
v_table.extend(1);
v_table(1).ID := 1;
v_table(1).No := 10;
v_table.extend(1);
v_table(2).ID := 2;
v_table(2).ID := 20;
SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
from TableA
FROM TABLEA
WHERE ID IN (select t.ID from table(v_Table) t);
for i in 1..v_t1.count loop
dbms_output.put_line(v_t1(i).ID);
dbms_output.put_line(v_t1(i).No);
end loop;
end;
/Untested!
P;
Edited by: bluefrog on Mar 5, 2010 5:08 PM -
How to use oracle collection type with JDBC?
I try to use oracle collection type in java program. So I made some package and java program, however Java program was not found "package.collectiontype"(JDBC_ERP_IF_TEST.NUM_ARRAY) . please, show me how to use this.
Java Version : Java 1.4
JDBC Driver : Oracle Oci Driver
DB: Oracle 9i
No 1. Package
===========================================
create or replace package JDBC_ERP_IF_TEST AS
type NUM_ARRAY is table of number;
procedure JDBC_ERP_IF_ARRAY_TEST(P_NUM_ARRAY IN NUM_ARRAY, ERR_NO OUT NUMBER, ERR_TEXT OUT VARCHAR2);
procedure TEST(ABC IN NUMBER);
END JDBC_ERP_IF_TEST;
==================================================
No 2. Package Body
===============================================
CREATE OR REPLACE package BODY JDBC_ERP_IF_TEST is
procedure JDBC_ERP_IF_ARRAY_TEST(p_num_array IN NUM_ARRAY,
ERR_NO OUT NUMBER,
ERR_TEXT OUT VARCHAR2) is
begin
ERR_NO := 0;
ERR_TEXT := '';
dbms_output.enable;
for i in 1 .. p_num_array.count() loop
dbms_output.put_line(p_num_array(i));
insert into emp (empno) values (p_num_array(i));
commit;
end loop;
EXCEPTION
WHEN OTHERS THEN
ERR_NO := SQLCODE;
ERR_TEXT := ERR_TEXT ||
' IN JDBC INTERFACE TEST FOR ORACLE ERP OPEN API..';
ROLLBACK;
RETURN;
end JDBC_ERP_IF_ARRAY_TEST;
procedure TEST(ABC IN NUMBER) IS
begin
insert into emp(empno) values (ABC);
commit;
end TEST;
end JDBC_ERP_IF_TEST;
===============================================
NO 3. Java Program
===============================================
ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("JDBC_ERP_IF_TEST.NUM_ARRAY", getConnection());
ARRAY array = new ARRAY(descriptor, getConnection(), arrs);
cstmt = getConnection().prepareCall(LQueryFactory.getInstance().get("Meta/Basic/testJdbcErpArrayIf").getSql());
cstmt.setArray(1, array);
cstmt.registerOutParameter(2, Types.INTEGER);
cstmt.registerOutParameter(3, Types.VARCHAR);
====================================================
couldn't find this phase => JDBC_ERP_IF_TEST.NUM_ARRAY
what can i do for this package and program? please help me..Something like this:
create or replace type t_record as object (
id number,
no number
CREATE or replace type t_table AS TABLE OF t_record;
set serveroutput on
declare
v_table t_table := t_table();
v_t1 t_table := t_table();
begin
v_table.extend(1);
v_table(1).ID := 1;
v_table(1).No := 10;
v_table.extend(1);
v_table(2).ID := 2;
v_table(2).ID := 20;
SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
from TableA
FROM TABLEA
WHERE ID IN (select t.ID from table(v_Table) t);
for i in 1..v_t1.count loop
dbms_output.put_line(v_t1(i).ID);
dbms_output.put_line(v_t1(i).No);
end loop;
end;
/Untested!
P;
Edited by: bluefrog on Mar 5, 2010 5:08 PM -
How to use Oracle database in CR XI R2!!!
Hi All,
I am having Oracle database in onsite machine.
I need to design the report without DSN and installing Oracle in my machine.
I dont know how to use connection String and Find DSN file option.
Please anyone help me to solve the issue.
Thanks in advance
Saravanakumar.hI,
Thank you for your reply.
1. I tried to give connection string, but i couldnt succeed.
2.If is give OLE(ODBC) I dono how the connection is established. Will it refer to TNSNAMES.ORA file, because it is simpy asking data source, use ID and password.
it will be helpful if you clarify me on the doubts.
Thank you,
Saravanakumar. -
How to use oracle OCIANYDATASET?
Hi, All
When I try to update oracle example "Pipelined Table Functions Example: C Implementation" to return OCIANYDATASET, but from oracle documnet, I cannot find any example about how to use OCIANYDATASET, would you please help me out of this issue, any example or advice is benefit for this issue. thanks.
The PL/SQL below works OK now:
member function ODCITableFetch(self in out StockPivotImpl, nrows in number, record_out out anydataset) return number is
rc SYS_REFCURSOR;
value pls_integer;
cur StockTable%ROWTYPE;
begin
record_out := null;
DBMS_ODCI.RestoreRefCursor(rc, self.cur_n);
if row_was_returned = 1 then
return ODCIconst.success;
end if;
row_was_returned := 1;
anydataset.begincreate(dbms_types.typecode_object, self.row_types, record_out);
loop
fetch rc into cur;
EXIT WHEN rc%NOTFOUND;
record_out.addinstance;
record_out.piecewise();
-- Setting the returned values:
record_out.setvarchar2(cur.ticker);
record_out.setnumber (cur.openprice);
record_out.setnumber (nrows);
record_out.setvarchar2('new_column');
end loop;
close rc;
record_out.endcreate;
return odciconst.success;
end;But how to implement below C function, especially how to append value into OCIAnyDataSet and return it?
-- Create table function
CREATE FUNCTION StockPivot(p refcur_pkg.refcur_t) RETURN anydataset
PIPELINED USING StockPivotImpl;
SELECT * FROM TABLE(StockPivot(CURSOR(SELECT * FROM StockTable)));
MEMBER FUNCTION ODCITableFetch(self IN OUT StockPivotImpl, nrows IN NUMBER,
record_out out anydataset) RETURN PLS_INTEGER
AS LANGUAGE C
LIBRARY StockPivotLib
NAME "ODCITableFetch"
WITH CONTEXT
PARAMETERS (
context,
self,
self INDICATOR STRUCT,
nrows,
record_out,
record_out INDICATOR,
RETURN INT
int ODCITableFetch(OCIExtProcContext* extProcCtx, StockPivotImpl* self,
StockPivotImpl_ind* self_ind, OCINumber* nrows,
OCIAnyDataSet* outSet, short* outSet_ind)Edited by: BluShadow on 11-Apr-2013 10:42
added {noformat}{noformat} tags for readability. Please read the FAQ: {message:id=9360002} and learn to do this yourself in future.Thanks for your reply, Yes, I have read the doc, but it seems like that doesn't work in my code. I'm not sure whether I missed something. My steps below:
int ODCITableFetch(OCIExtProcContext* extProcCtx, StockPivotImpl* self,
StockPivotImpl_ind* self_ind, OCINumber* nrows,
OCIAnyDataSet* outSet, short* outSet_ind)
OCIAnyData* myData = (OCIAnyData*)0;
status = OCIAnyDataSetBeginCreate(handles.svchp, handles.errhp, OCI_TYPECODE_OBJECT, (OCIType *)self->out, OCI_DURATION_SESSION, &outSet);
status = OCIAnyDataSetAddInstance(handles.svchp, handles.errhp, outSet, &myData);
//AAA
OCIStringAssignText(handles.envhp, handles.errhp, (text *)"CA", 2, &str);
checkerr(&handles, OCIAnyDataAttrSet(handles.svchp, handles.errhp, (OCIAnyData*)myData, (OCITypeCode)OCI_TYPECODE_VARCHAR2,(OCIType *)0, (dvoid *)&indp, (void*)str, sizeof(str), FALSE)); // Crashed here
//BBB
status = OCIAnyDataSetEndCreate(handles.svchp,handles.errhp, outSet);
//CCC
return ODCI_SUCCESS;
It crashed in function OCIAnyDataAttrSet(), but when I added the function OCITypeByName() and OCIAnyDataBeginCreate() in AAA and OCIAnyDataEndCreate() in BBB, no error happened again and I can get the instance in CCC with function OCIAnyDataSetGetInstance() and I also can get the value via function OCIAnyDataAttrGet() after CCC from the instance, but when I run the query, it is no rows selected, why? -
I'm storing files in a blob field in a 9i database, sometimes I need to query using the details stored in the database about the file and sometimes I need to search the files to find matches with some text (like search engine), I was told that oracle text can help me accomplish this functionality , however I don't know if it supports arabic text and I don't know how to use it from my application developed in 9i.
Regards.Friend by using these step you can easily use Oracle inter text media
j a h a n z e b
[email protected]
Oracle Developer
6th Floor, State Bank of Pakistan
I.I.Chundrigar Road, Karachi.
Please note that in SqlPlus you can use '?' in stead of $ORACLE_HOME, and this works on Unix and Windows so if you want to execute $ORACLE_HOME/rdbms/admin/catalog.sql you can simply use:
on Unix sql> @?/rdbms/admin/catalog.sql
on Windows sql> @?\rdbms\admin\catalog.sql
5.2.1 Explanation of installation steps
1. Connected to database as SYSDBA and create CTXSYS user:
Ctxsys user is created by calling following script:
@?/ctx/admin/dr0csys.sql <ctxsys> <system> <temp>
Where:
change_on_install - is the ctxsys user password
DRSYS - is the default tablespace for ctxsys
TEMP - is the temporary tablespace for ctxsys
This will create user CTXSYS and grants full privileges to CTXSYS in order to create and insert into result tables, execute callbacks, rewrite queries, and perform system cleanup. At this point CTXSYS will not own any objects.ss
2. Connected to database as CTXSYS and create all necessary objects
All necessary object are creates by calling following script:
connect CTXSYS/change_on_install
@?/ctx/admin/dr0inst <replace with $ORACLE_HOME>/ctx/lib/libctxx9.so;
Please not that you have to put full path to your ORACLE_HOME, for example home as paramter
On Solaris/Aix/Linux with $ORACLE_HOME of /u01/app/oracle/product/8.1.7
@?/ctx/admin/dr0inst.sql /u01/app/oracle/product/8.1.7/ctx/lib/libctxx8.so
On HP-UX with $ORACLE_HOME of /u01/app/oracle/product/8.1.7
@?/ctx/admin/dr0inst.sql /u01/app/oracle/product/8.1.7/ctx/lib/libctxx8.sl
Windows NT/2000 with D:\oracle\product\8.1.7
@?/ctx/admin/dr0inst.sql D:\oracle\product\8.1.7\bin\oractxx8.dll
This will installs all Oracle database objects required by the Oracle Text system. This includes:
a) Data dictionary tables, views, sequence, packages
b) Server management tables, views and packages
c) Dispatcher packages
d) Service queue objects
3) Install appropriate language-specific default preferences.
The next step is to install appropriate language-specific default preferences.When you use CREATE INDEX to create an index or ALTER INDEX to manage an index, you can optionally specify indexing preferences in the parameter string. There are seven preference classes:
- Lexer, defines the language being indexed. ( language specific )
- Wordlist, defines the expantion of stem and fuzzy queries. ( language specific )
- Stoplist, defines words and themes that are not be indexed. ( language specific )
- Datastore, defines document storage.
- Filter, defines standards for converion of documents to plaintext.
- Storage, defines the storage of the index tables.
- Section group, enables possibilities to define document sections.
There is script which creates language-specific default preferences for every language Oracle text supports in <ORACLE_HOME>/ctx/admin/defaults directory, such as English(US), Danish(DK), Dutch(NL), Finnish(SF), French(FR), German(DE), Italian(IT), Portuguese(PR), Spanish(ES), and Swedish(S). They are named in the form drdefXX.sql, where XX is the language code. To manually install US default preferences, for example, log into sqlplus as CTXSYS, and run 'drdefus.sql' as described below:
@?/ctx/admin/defaults/drdefus.sql
create user textuser identified by textuser
default tablespace users
temporary tablespace temp;
-- You must grant 'ctxapp' role to textuser
grant connect, resource, ctxapp to textuser;
connect textuser/textuser
drop table quick;
create table quick (
quick_id number
constraint quick_pk primary key,
text varchar2(80) );
insert into quick ( quick_id, text ) values (1,'The cat sat on the mat');
insert into quick ( quick_id, text ) values (2,'The quick brown fox jumps over the lazy dog' );
insert into quick ( quick_id, text ) values (3,'The dog barked like a dog');
commit;
create index quick_text on quick ( text )
indextype is ctxsys.context;
col text format a45
col s format 999
select text, score(42) s from quick
where contains ( text, 'dog', 42 ) > 0
order by s desc;
Maybe you are looking for
-
Hello Guys, I hope some of you will be using the LdB FMF and the many SAP reports that use FMF. It is in Funds Management, specifically for Public sectors. There are some transactions for the program RFFMEPGAX. When any of these transactions or progr
-
Speichern mit unterschiedlichen Start-Triggern?
Hallo! Ich würde gern Daten auf definierte Ereignisse hin in Kanäle und Dateien speichern. Die Ereignisse, die eine Speicherung hervorrufen, seien allerdings unterschiedliche. Wenn ich meinen Schaltplan so aufbaue, dass theoretisch so gespeichert wür
-
Fetch Report Program names for a given Package
Hi, I need to fetch all the report program names for a given pakage. I tired TADIR table but couldnt fetch report details alone.. thanks, sri Moderator message: very basic, please do more own research before asking, e.g. look at a few TADIR entrie
-
Why can't I see the masking options in certain effects in Premiere Pro 7.2.0
I am working with PP CC 7.2.0 and have heard that there is vers. 7.2.2. But I have also heard from others that the problem still occurs. Anyone with possible answers???
-
Hi All, I have a Data Source "0CA_TS_IS_1" (Time Sheet Approved). I haven't find this DS in RSA6,RSA5 but, I find it RSA3. I need to extract LGART (Wage type) from This Data Source. Is it possiable? Thanks, KN