Oracle OLAP:Same member values across dimensions
We had an enquiry from a client which mentions:
Per Essbase the same dimension member value cannot exist across multiple dimensions. e.g. if we have a account dimension with member 1001 , it is not possible to have product dimension with same member value 1001. This is essentially because Essbase implements it like a shared member. Apparently Essbase Excel-addin will not know what dimension to search for if both have same values.
As per our understanding there is no such limitation in Oracle OLAP both during cube build or querying via Excel Add-in. i.e we can have account dimension with member 1001 and same member value can exist in a product dimension. Please advise and if anybody has any reference to any documentation in this regard please let us know.
Hi there,
You are correct - there is no such limitation in Oracle OLAP.
A dimension value must be unique in any given dimension but can be repeated in other dimensions.
I do not have any documentation but this is really easy to prove using the OLAP worksheet in AWM, eg:
aw create test
define dim1 dimension text
maintain dim1 add 'MEMBER1'
report dim1
define dim2 dimension text
maintain dim2 add 'MEMBER1'
report dim2
aw detach test
aw delete testI hope this helps
Thanks,
Stuart Bunby
OLAP Blog: http://oracleOLAP.blogspot.com
OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
OLAP on OTN: http://www.oracle.com/technology/products/bi/olap/index.html
DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html
Similar Messages
-
First_value in Oracle olap based on non - time dimension
Hi Experts,
I am trying to figure out to do first_value kind of calculation in Oracle OLAP.
Here is the requirement -
Fact table -
cust_id valid_flag balance
1 y 1000
1 y 1500
2 N 0
2 y 2000
2 y 2500
If valid_flag ='N' and balance =0, then set balance =0 for other cells for the customer. This needs to be done for all the dimensions.
Any pointer would be useful.
Regards, NeeleshIf the switch is really based on a dimension attribute (named particular_value), then it should be easy to create a derived measure.
CASE
WHEN particular_dim.particular_value = 'N'
THEN 0
ELSE my_cube.balance
ENDBut perhaps what you mean is that there is another measure, IS_VALID say, and you need to get the value of IS_VALID for the current cust_id and the member named 'particular_value' of the particular_dim. In this case it would look something like this.
CASE
WHEN my_cube.is_valid[particular_dim = 'particular_value'] = 'N'
THEN 0
ELSE my_cube.balance
ENDI expect that neither of the above expressions is right, but it should give you some pointers as to the kinds of tricks you can use. -
ORACLE OLAP: trying to read french dimension attributes fails
We have set up the CHANNEL dimension of the GLOBAL AW to have a french translation for the attributes CHANNEL_SHORT_DESCRIPTION and CHANNEL_LONG_DESCRIPTION. Using the AW Manager we had verified that the french values are output correctly. Also when using the OLAP Worksheet we got the correct output. Unfortunately issuing the same sequence of commands via ODP.NET does not output the dimension attribute in the appropriate language. Does anybody know about this problem or have the same experience?
Here is the command stack of the Olap Worksheet
->RPR DOWN CHANNEL CHANNEL_SHORT_DESCRIPTION SKIP
--------------ALL_LANGUAGES--------------
----------------AMERICAN-----------------
CHANNEL_SHORT_DESCRI
CHANNEL PTION
1 All Channels
4 Internet
2 Direct Sales
3 Catalog
->LOCK_LANGUAGE_DIMS=no
->LMT ALL_LANGUAGES TO 'FRENCH'
->RPR DOWN CHANNEL CHANNEL_SHORT_DESCRIPTION SKIP
--------------ALL_LANGUAGES--------------
-----------------FRENCH------------------
CHANNEL_SHORT_DESCRI
CHANNEL PTION
1 All Channels
4 Internet
2 Ventes Directes
3 CatalogueJust to update this thread: while preparing a little test program, which should make this problem reproducable, I found an ALLSTAT command in our lengthy command stack. This caused the ALL_LANGUAGES_DIM to loose its limit on the selected language. Our parser in turn didn't have any trouble with this, but output the first language, which was the default. The problem was on our side and is solved now.
-
Has anyone setup BIEE with OLAP 10g using value-based dimension hierarchies
I just wanted to know if it is possible to setup BIEE with 10g using multple dimensions containing multiple value-based hierarchies?
I know this involves using the OLAP Cube View Generator to create an sql view of the cube data.
I have been able to get this to work with nine dimensions all containing a single value-based hierarchy bar one which had four value-based hierarchies. But as soon as i have multiple hierarchies in multiple dimensions it seems to go haywire and i cannot get the sql view to return correct data.
I thought i would post on the BI side to see if anyone has been successful in creating a BIEE setup like this?The simple answer to your question,
how robust is the 11g materialised views with multiple value-based hierarchies...?is that materialized views are not supported on top of value-based hierarchies in 11g. The reason is that it is not possible to write a reasonable SQL statement that aggregates a fact over a value-based hierarchy. Such a SQL statement is necessary if we want to create a rewritable MV on top of the cube.
But I suspect this is not what you are really asking. If you are trying to set up OBIEE on top of the cube in 10g using the view generator, then you will probably want to use the "ET VIEWS" that are generated automatically in 11g. These are generated whether or not you enable materialized views on top of your cube. I am not aware of any issues with the generated value-based hierarchy view support in 11g. Members may be shared between value hierarchies and you will not need to generate or modify limit maps. -
Physical size of dimensions and composites (Express and Oracle OLAP)
Hi, have a rather odd question re: the physical size (in bytes) of composites...are they affected by the dimension sizes?
I.e. if I define a dimension "Org" as:
define org dimension text width 10
will that result in smaller composites than if I define it as
define org dimension text width 30
? i.e. given that everything else if equal (same number of values, same # of tuples, etc.) does the physical definition of how wide a dimension is affect the size of the composites that use that dimension?
p.s. need to know this for Express, but if Oracle OLAP doesn't behave the same I'd like to know that also.
Thanks!
ScottA 5 dimensional composite has keys built of 5 4-byte dimension positions. There is a copy of the 20 byte value stored indexed by physical position that we use internally to determine the value of the base dimensions. Also there is a copy stored in a hash table used to take the base dimension values and convert those back to a physical position (that's 20 bytes for the key and 4 bytes for the physical position).
Finally, we have internal structures ("inversions") that we use to essentially do "limit composite to base dimensions" for looping (for each base dimension value, a list of physical positions that have that base value in it), at 4 bytes per dimension or another 20 bytes.
That's 64 bytes. Yeah, it's not cheap, but compared to a dense variable, you save a ton of space. I seem to remember a calculation someone did a long time ago that said that composites were net smaller for anything less than 20% dense.
I'm not surprised that under certain conditions you can find a better data layout. Certainly the overhead of storing dense data is tiny compared to a composite. If you are clever (or lucky) in your segmenting, you can take advantage of the "holes" in the data to improve the storage. The "holes" (large groups of NA values) can go for many pages, if the faster varying dimension size is large, and won't be stored.
Oracle OLAP contains various improvements over the Express code. I believe we now use compressed bitmaps to store the inversions, rather than lists of values, for a substantial savings. There may be other changes as well (I'm not current on the details of the dimension storage).
Hope this helps.
Jim -
Error in Running a dimension ( BIB-9509 Oracle OLAP did not create cursor.)
oracle.dss.dataSource.common.QueryRuntimeException: BIB-9509 Oracle OLAP did not create cursor.
oracle.express.ExpressServerExceptionError class: OLAPI
Server error descriptions:
DPR: Unable to create server cursor, Generic at TxsOqDefinitionManagerSince9202::crtCurMgrs4
OES: ORA-00938: not enough arguments for function
, Generic at TxsRdbRandomAccessQuery::TxsRdbRandomAccessQuery
help is appreciated
Thanks, PrasadThis is the patch: 2529822
"Best Practices for Tabular Cube Aggregation & Query Operations". Thanks very much for your advice.
I followed the instructions in the document, but it did not seem to make a difference when
trying to follow the tutorial instructions and using the SALES measure.
However, I selected the stock price measures and it worked ok.
Is there a size limit here? I am looking at Oracle OLAP and BIBeans to replace our Cognos installation,
which is expensive and unreliable on unix. Of course our managers and customers want every dimension
across a huge fact table to be available for end users... -
EIS : parent child - member load gives duplicate across dimensions message
<p>I am trying to do member load from EIS (version7.1) desktop using an ASO metaoutline. The outline does notget built properly for one of the dimensions.</p><p> </p><p>Message log shows one of the values is duplicate but there areno duplicate values.</p><p> </p><p>message log shows the sql similar to : ( backend database isOracle 9.2.0.4 connected with odbc/OCI)</p><p> </p><p>SELECT /*+ */ PARENT_ID, CHILD_ID, ALIAS_NAME,SEQUENCE_NUMBER from DIM1 order by 4 ASC</p><p> </p><p>Example data is:</p><p>CHILD_ID PAREN_ID SEQUENCE_NUMBER</p><p>ROOT 1</p><p>L1_1 ROOT 2</p><p>L1_2 ROOT 3</p><p>L1_3 ROOT 4</p><p>L2_1 L1_3 5</p><p>L2_2 L1_3 6</p><p>L1_4 ROOT 7</p><p>L1_5 ROOT 8</p><p> </p><p>Message log shows the following line twice:</p><p>Member "L1_3" is duplicate across all dimensions.</p><p>Member "L1_3" is duplicate across all dimensions.</p><p> </p><p>I checked all the dimensions and member value is unique acrossall dimensions.</p><p> </p><p>Outline gets created as follows: ( L1_1, L1_2 and L1_3 show upas siblings to DIM1 instead of children).</p><p> </p><p>Outline</p><p> DIM1</p><p> L1_2</p><p> L1_3</p><p> L1_4</p><p> L1_5</p><p> L1_1</p><p> L1_2</p><p> L1_3</p><p> </p><p>Dimension has recursion defined in the model with PARENT_ID asparent column and CHILD_ID as Child column.</p><p> </p><p> </p><p> </p>
Thanks John - still not quite working
I should give another detail / extra complexity
The "Geographic Location" dimensions looks like this:
"Geographic Location" (Gen 1)
"United States" (Gen 2)
"SC" (Gen 3)
"Unique Facility 1", "Unique Facility 2" etc (Gen 4)
The data I have would be for Facility 1, Facility 2 which are unique member names which just happen to roll up under SC in the outline. I would have thought it would just load directly to those members without needing to specify their parent values.
Do I need to specify [Geographic Location].[United States].[SC].[Facility 1] ? This seems like it's something that needs to be done in the source file rather than using the prefix/suffix features of the Rules File. -
OBIEE and Oracle OLAP Value Based Hierarchies
Hi there...
I have a value based dimension built on Oracle OLAP and want to map it on OBIEE Administration tool.
I've been using the above link as reference:
http://www.oracle.com/technology/obe/olap_biee/CreateBIEEMetadata.htm
There's no option to import from Oracle Multi-dimensional Database. Either to import/configure the view created by OLAP as an Unballanced or Ragged Dimension.
I also checked this example, but it uses ESSBASE as the multi-dimensional source....
http://www.rittmanmead.com/2008/08/27/ragged-hierarchy-handling-in-obiee/
How to map this Ragged Dimension created in OLAP workspace in OBIEE? Any suggestions or directions will be highly appreciated...
Thanks in advance
MarcosMark and others,
You can create OLAP_TABLE views with level columns on top of value-based hierarchies. BI Beans used to do that too behind the scenes in Discoverer Plus OLAP. If you trace the Discoverer session, where you are querying data from Value-based hierarchies, you will see that it also generates OLAP_TABLE views with level columns in it.
So the question is how to do it. Internally, even for Value-based hierarchies Oracle OLAP keeps track of the "depth" of each value by using a structure called GID_DIMENSION (i.e., Grouping Dimension). Here is an example of a view on top of a value-based hierarchy (CFC_ACCT_GAPP) for RPT_ACCOUNT dimension. You have to know how "deep" your value-based hierarchy is.
Similar kind of a thing is done by OLAP View Generator application, which I never use - since I always prefer to define my own OLAP_TABLE views.
This kind of a view can then be used in the RPD of OBIEE.
select *
FROM table(OLAP_TABLE ('AW duration session',
*'DIMENSION RPT_ACCT_ID FROM RPT_ACCOUNT WITH*
HIERARCHY RPT_ACCOUNT_GAAP_PARENT FROM RPT_ACCOUNT_PARENTREL(RPT_ACCOUNT_HIERLIST ''CFC_ACCT_GAAP'') INHIERARCHY RPT_ACCOUNT_INHIER
HATTRIBUTE RPT_ACCOUNT_GAAP_LVL_NUM FROM RPT_ACCOUNT_DEPTHVAL
FAMILYREL RPT_ACCOUNT_GAAP_LVL1,
RPT_ACCOUNT_GAAP_LVL2,
RPT_ACCOUNT_GAAP_LVL3,
RPT_ACCOUNT_GAAP_LVL4,
RPT_ACCOUNT_GAAP_LVL5,
RPT_ACCOUNT_GAAP_LVL6,
RPT_ACCOUNT_GAAP_LVL7,
RPT_ACCOUNT_GAAP_LVL8
FROM RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 127),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 63),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 31),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 15),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 7),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 3),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 1),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 0)
FAMILYREL RPT_ACCOUNT_GAAP_LVL1_DSC,
RPT_ACCOUNT_GAAP_LVL2_DSC,
RPT_ACCOUNT_GAAP_LVL3_DSC,
RPT_ACCOUNT_GAAP_LVL4_DSC,
RPT_ACCOUNT_GAAP_LVL5_DSC,
RPT_ACCOUNT_GAAP_LVL6_DSC,
RPT_ACCOUNT_GAAP_LVL7_DSC,
RPT_ACCOUNT_GAAP_LVL8_DSC
FROM RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 127),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 63),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 31),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 15),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 7),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 3),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 1),
RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 0)
LABEL RPT_ACCOUNT_LONG_DESCRIPTION
ATTRIBUTE ACCOUNT_LDSC FROM RPT_ACCOUNT_LONG_DESCRIPTION
ATTRIBUTE ACCOUNT_SDSC FROM RPT_ACCOUNT_SHORT_DESCRIPTION
ATTRIBUTE ACCOUNT_TYPE FROM RPT_ACCOUNT_TYPE
ATTRIBUTE SOURCE_LEVEL FROM RPT_ACCOUNT_LEVEL
ATTRIBUTE CALCULATION FROM RPT_ACCOUNT_CALCULATION
ATTRIBUTE CALC_DATA FROM RPT_ACCOUNT_CALC_DATA
ATTRIBUTE GAAP_SORT_ORDER FROM RPT_ACCOUNT_GAAP_SORT_ORDER
ATTRIBUTE RATIO FROM RPT_ACCOUNT_RATIO
ATTRIBUTE ACCOUNT_LEVEL FROM RPT_ACCOUNT_LEVELREL')) -
ORACLE olap - dimension with huge number of members.
Hi Experts,
I have modeling a ORACLE OLAP cube with 10 dimensions. I have one of the dimensions which have huge leaf members...(probably 1 billion).. How many dimension members i can have for one dimension. Is there any limitation to the dimension members ?
Thanks and Regards
SivaHi there,
I'm not sure of the theoretical limits, but I would never recommend trying to build a dimension with 1 billion members.
In situations were such granular data exists, it is common to leave this in table and load data into the OLAP cube at a more aggregate level.
Which business entity are you trying to model in a 1 billion member dimension?
Thanks,
Stuart Bunby
OLAP Blog: http://oracleOLAP.blogspot.com
OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
OLAP on OTN: http://www.oracle.com/technology/products/bi/olap/index.html
DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html -
Mapping whole dimension to single member of same member
Hi,
I am trying to copy all the values under dimension to single member.
Here is the scenario
U11211 -> "PR023" = @Relative("All units",0) -> @Relative("All_Project",0);
But this thing aren't working , the error message it says
"Cannot calculate dimension member [U11211] with restricted member [All units] Rule"
Any ideas how to approach this?You didn't post your full code. What that error message says to me that you've All Units in the FIX statement.
You cannot do this, it'll result in another error.
U11211 -> "PR023" = "All units" -> "All_Project",0;
This will give you the sum of all Units -> All projects into U11211 -> PR023
Regards
Celvin
http://www.orahyplabs.com -
Oracle SP for comparing 80 column values across 8 table pairs in 2 diff DBs
Hi All,
I have an Oracle SP for comparing 80 column values across 8 table pairs in 2 diff DBs.
However, it is taking hell lot of time around 6hours to process 10,000 records.
Can anyone suggest how to fine-tune this?
Thanks guys.Tables prefixed with X are the temp tables to store data of DB-A.
The report will be originally based on DB-B, so DB Links will not be required for @PROD1.WORLD tables.
This is a test region, so I have pointed to @PROD1.WORLD to test with Prod Data.
SEC_COMPARE_CONFIG is the config table containing the table_name to be reported, corresponding temp tables to store the data and the columns on which it is to be reported.
There are in total 8 tables- 90 rows and 8 temp tables.
SPOKE_TO_HUB_SEC_MTCH_TBL records the securities on which it is to be reported.
HIST_DATA_COMPARE_TBL is the final results table.
Here is the entire code:
CREATE OR REPLACE PACKAGE SECURITY_COMPARE AS
PROCEDURE PROCESS_RECORDS (IN_EFFECTIVE_DATE IN DATE,
IN_PRIMARY_ASSET_ID IN VARCHAR2 DEFAULT NULL);
PROCEDURE IDENTIFY_SECURITIES ( P_EFFECTIVE_DATE IN DATE,
P_PRIMARY_ASSET_ID IN VARCHAR2 DEFAULT NULL);
PROCEDURE RETREIVE_RECORDS_FROM_SPOKE;
PROCEDURE COMPARE_RECORDS(p_err_msg OUT VARCHAR2);
PROCEDURE INSERT_DATA_TO_TABLE ( v_target_table VARCHAR2, v_sql_to_run VARCHAR2, v_commit_after NUMBER);
END SECURITY_COMPARE;
CREATE OR REPLACE PACKAGE BODY SECURITY_COMPARE AS
/*Declared String for recording Dynamic SQL's*/
LC_SQL VARCHAR2 (20000);
PROCEDURE PROCESS_RECORDS(IN_EFFECTIVE_DATE IN DATE,
IN_PRIMARY_ASSET_ID IN VARCHAR2 DEFAULT NULL)
AS
L_EFF_DATE DATE;
L_PRIMARY_ASSET_ID VARCHAR2(100);
k_err_msg VARCHAR2(100); --Error message displayed in case of NO discretionary records found.
BEGIN
L_EFF_DATE := IN_EFFECTIVE_DATE;
L_PRIMARY_ASSET_ID := IN_PRIMARY_ASSET_ID;
IDENTIFY_SECURITIES(L_EFF_DATE,L_PRIMARY_ASSET_ID); --Calling the Identify_Securities procedure to identify the securities older by 90 days from report effective date
RETREIVE_RECORDS_FROM_SPOKE(); --Retreiving the historic records from the security tables into temporary tables.
COMPARE_RECORDS(p_err_msg=>k_err_msg); --Compare the records and report the discrepencies into HIST_DATA_COMPARE_TBL table
END PROCESS_RECORDS;
PROCEDURE IDENTIFY_SECURITIES(P_EFFECTIVE_DATE IN DATE,
P_PRIMARY_ASSET_ID IN VARCHAR2 DEFAULT NULL)
AS
P_EFF_DATE DATE; --Effective Date of the report
P_PRIMARY_ID VARCHAR2(100); --Primary AssetID which is used to search based on specific security
v_target_table VARCHAR2(500); --Variable indicating the Target table for inserting the data
v_sql_to_run VARCHAR2(5000); --Variable to store the Dynamic SQL to be executed
v_commit_after NUMBER; --Variable to define after how many records is COMMIT to be done
BEGIN
LC_SQL :='';
P_EFF_DATE := P_EFFECTIVE_DATE;
P_PRIMARY_ID := P_PRIMARY_ASSET_ID;
/*Deleting Old Entries from SPOKE_TO_HUB_SEC_MTCH_TBL table*/
LC_SQL := 'TRUNCATE TABLE SPOKE_TO_HUB_SEC_MTCH_TBL';
EXECUTE IMMEDIATE LC_SQL;
IF(P_PRIMARY_ID is NULL) --In case records do not need to be identified on basis of specific security
THEN
/*Identify Securities older by 90days from report effective date*/
v_target_table := ' SPOKE_TO_HUB_SEC_MTCH_TBL';
v_sql_to_run := 'WITH T AS ('||
' SELECT R.PRIMARY_ASSET_ID PRIMARY_ASSET_ID_R,'||
' R.SECURITY_ALIAS SECURITY_ALIAS_R,'||
' R.LAST_HELD_DATE LAST_HELD_DATE_R,'||
' R.PREV_HELD_DATE PREV_HELD_DATE_R,'||
' Q.PRIMARY_ASSET_ID PRIMARY_ASSET_ID_Q,'||
' Q.SECURITY_ALIAS SECURITY_ALIAS_Q,'||
' COUNT(*) OVER(PARTITION BY Q.PRIMARY_ASSET_ID) CNT'||
' FROM [email protected] R,'||
' [email protected] Q'||
' WHERE SYS_OP_MAP_NONNULL(R.last_held_date) <> '||q'!'FF'!'||
' and ceil(R.last_held_date-to_date('||''''||P_EFF_DATE||''''||')) >= 0'||
' and ceil(R.last_held_date-to_date('||''''||P_EFF_DATE||''''||')) <= 60'||
' and R.PRIMARY_ASSET_ID=Q.PRIMARY_ASSET_ID'||
' )'||
' SELECT PRIMARY_ASSET_ID_R,'||
' SECURITY_ALIAS_R,'||
' LAST_HELD_DATE_R,'||
' PREV_HELD_DATE_R,'||
' PRIMARY_ASSET_ID_Q,'||
' SECURITY_ALIAS_Q'||
' FROM T'||
' WHERE CNT =1';
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
ELSE
v_target_table := ' SPOKE_TO_HUB_SEC_MTCH_TBL';
v_sql_to_run := 'WITH T AS ('||
' SELECT R.PRIMARY_ASSET_ID PRIMARY_ASSET_ID_R,'||
' R.SECURITY_ALIAS SECURITY_ALIAS_R,'||
' R.LAST_HELD_DATE LAST_HELD_DATE_R,'||
' R.PREV_HELD_DATE PREV_HELD_DATE_R,'||
' Q.PRIMARY_ASSET_ID PRIMARY_ASSET_ID_Q,'||
' Q.SECURITY_ALIAS SECURITY_ALIAS_Q,'||
' COUNT(*) OVER(PARTITION BY Q.PRIMARY_ASSET_ID) CNT'||
' FROM [email protected] R,'||
' [email protected] Q'||
' where R.PRIMARY_ASSET_ID='||''''||P_PRIMARY_ID||''''||
' and R.PRIMARY_ASSET_ID=Q.PRIMARY_ASSET_ID'||
' )'||
' SELECT PRIMARY_ASSET_ID_R,'||
' SECURITY_ALIAS_R,'||
' LAST_HELD_DATE_R,'||
' PREV_HELD_DATE_R,'||
' PRIMARY_ASSET_ID_Q,'||
' SECURITY_ALIAS_Q'||
' FROM T'||
' WHERE CNT =1';
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
END IF;
LC_SQL := 'TRUNCATE TABLE HIST_DATA_COMPARE_TBL';
EXECUTE IMMEDIATE LC_SQL;
END IDENTIFY_SECURITIES;
PROCEDURE RETREIVE_RECORDS_FROM_SPOKE
AS
v_target_table VARCHAR2(500);
v_sql_to_run VARCHAR2(5000);
v_commit_after NUMBER;
BEGIN
LC_SQL :='';
LC_SQL:= 'TRUNCATE TABLE X_SECMASTER_HISTORY_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_SEC_MASTER_DTL_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_SECMASTER_DTL_EXT_HST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_EQUITY_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_EQUITY_DETAIL_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_FIXED_INCOME_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_FIXED_INCOME_DTL_EXT_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_DERIVATIVES_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
/*SECMASTER_HISTORY*/
v_target_table := 'X_SECMASTER_HISTORY_TBL';
v_sql_to_run := ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*SECURITY_MASTER_DETAIL_HIST*/
v_target_table := 'X_SEC_MASTER_DTL_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*SECMASTER_DETAIL_EXT_HIST*/
v_target_table := 'X_SECMASTER_DTL_EXT_HST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*EQUITY_HIST*/
v_target_table := 'X_EQUITY_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*EQUITY_DETAIL_HIST*/
v_target_table := 'X_EQUITY_DETAIL_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*FIXED_INCOME_HIST*/
v_target_table := 'X_FIXED_INCOME_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*FIXED_INCOME_DETAIL_EXT_HIST*/
v_target_table := 'X_FIXED_INCOME_DTL_EXT_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*DERIVATIVES_HIST*/
v_target_table := 'X_DERIVATIVES_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
END RETREIVE_RECORDS_FROM_SPOKE;
PROCEDURE COMPARE_RECORDS(p_err_msg OUT VARCHAR2)
AS
l_count NUMBER;
l_err_msg VARCHAR2(100);
TYPE T_SECURITIES is TABLE of HIST_DATA_COMPARE_TBL%rowtype;
ttype T_SECURITIES;
CURSOR C1
IS
SELECT TABLE_NAME, TEMP_TABLE, COLUMN_NAME from SEC_COMPARE_CONFIG
where column_name='EFFECTIVE_DATE';
CURSOR C2
IS
SELECT * FROM SEC_COMPARE_CONFIG where id <=82;
C_REC SEC_COMPARE_CONFIG%rowtype;
BEGIN
LC_SQL :='';
p_err_msg :='';
FOR C_REC in C1
loop
LC_SQL:= ' SELECT /*+DRIVING_SITE(B)*/ /*+PARALLEL(A,100)*/ B.SECURITY_ALIAS, to_char(C.SPOKE_PAID), A.SECURITY_ALIAS,to_char(C.HUB_PAID),'||''''||C_REC.TABLE_NAME||''''||','||q'!'EFFECTIVE_DATE'!'||','||
' NVL((cast(B.'||C_REC.COLUMN_NAME||' as VARCHAR2(100))),'||q'!'No Records Found'!'||'),'||
' NVL((cast(A.'||C_REC.COLUMN_NAME||' as VARCHAR2(100))),'||q'!'No Records Found'!'||')'||
' FROM '||C_REC.TEMP_TABLE||' A, SECURITYDBO.'||C_REC.TABLE_NAME ||'@PROD1.WORLD B,'||
' SPOKE_TO_HUB_SEC_MTCH_TBL C'||
' WHERE A.SRC_INTFC_INST=140'||
' AND B.SRC_INTFC_INST=140'||
' AND A.SECURITY_ALIAS=C.spoke_sec'||
' and b.security_alias=C.HUB_SEC'||
' AND a.effective_date <> (select max(h.effective_date) from SECURITYDBO.'||C_REC.TABLE_NAME||'@PROD1.WORLD H'||
' where h.security_alias=c.hub_sec and h.src_intfc_inst=140 )';
EXECUTE IMMEDIATE LC_SQL BULK COLLECT into ttype;
FORALL x in ttype.First..ttype.Last
insert into HIST_DATA_COMPARE_TBL values ttype(x);
commit;
end loop;
For C_REC in C2
loop
LC_SQL:= ' SELECT /*+DRIVING_SITE(B)*/ /*+PARALLEL(A,100)*/ B.SECURITY_ALIAS, to_char(C.SPOKE_PAID), A.SECURITY_ALIAS,to_char(C.HUB_PAID),'||''''||C_REC.TABLE_NAME||''''||','||''''||C_REC.COLUMN_NAME||''''||','||
' NVL((cast(B.'||C_REC.COLUMN_NAME||' as VARCHAR2(100))),'||q'!'No Records Found'!'||'),'||
' NVL((cast(A.'||C_REC.COLUMN_NAME||' as VARCHAR2(100))),'||q'!'No Records Found'!'||')'||
' FROM '||C_REC.TEMP_TABLE||' A, SECURITYDBO.'||C_REC.TABLE_NAME ||'@PROD1.WORLD B,'||
' SPOKE_TO_HUB_SEC_MTCH_TBL C'||
' WHERE A.SRC_INTFC_INST=140'||
' AND B.SRC_INTFC_INST=140'||
' AND A.SECURITY_ALIAS=C.spoke_sec'||
' and b.security_alias=C.HUB_SEC'||
' and b.effective_date=a.effective_date'||
' AND NVL((cast(A.'||C_REC.column_name||' as VARCHAR2(100))),'||q'!'No Records Found'!'||') <>'||
' NVL((cast(B.'||C_REC.column_name||' as VARCHAR2(100))),'||q'!'No Records Found'!'||')';
EXECUTE IMMEDIATE LC_SQL BULK COLLECT into ttype;
FORALL x in ttype.First..ttype.Last
insert into HIST_DATA_COMPARE_TBL values ttype(x);
commit;
end loop;
BEGIN
select count(*) into l_count from HIST_DATA_COMPARE_TBL;
if(l_count=0) then
l_err_msg :='No records found';
end if;
END;
END COMPARE_RECORDS;
NAME: INSERT_DATA_TO_TABLE
DESCRIPTION: This procedure will insert the records into the target table based based on the data fetched using the sql to run variable.
It also records the commit_after variable which defines that after how many records the insert needs to be committed.
PROCEDURE INSERT_DATA_TO_TABLE ( v_target_table VARCHAR2,
v_sql_to_run VARCHAR2,
v_commit_after NUMBER) IS
v_limit_sql1 VARCHAR2(300) := ' ';
v_limit_sql2 VARCHAR2(900) := ' ';
v_plsql_to_run VARCHAR2(32767);
BEGIN
IF NVL(v_commit_after,0) <> 0 THEN
v_limit_sql1:= ' LIMIT ' || TO_CHAR(v_commit_after) ;
v_limit_sql2:= ' IF MOD(v_number_of_rows, ' || TO_CHAR(v_commit_after) || ' ) = 0 THEN ' ||
' COMMIT; ' ||
' END IF; ' ;
END IF;
v_plsql_to_run:= ' ' ||
'DECLARE ' ||
' v_number_of_rows number:=0; ' ||
' ' ||
' TYPE MyType IS REF CURSOR; ' ||
' CV MyType; ' ||
' TYPE RecTyp IS TABLE OF ' || v_target_table || '%ROWTYPE; ' ||
' rec RecTyp; ' ||
' ' ||
'BEGIN ' ||
' ' ||
'OPEN CV FOR ' ||
' ' || REPLACE( v_sql_to_run, ';', ' ' ) || ' ; ' ||
' LOOP ' ||
' FETCH CV BULK COLLECT INTO rec ' || v_limit_sql1 || '; ' ||
' FORALL i IN 1..rec.COUNT ' ||
' INSERT /*+ APPEND */ INTO ' || v_target_table || ' VALUES rec(i); ' ||
' v_number_of_rows := v_number_of_rows + SQL%ROWCOUNT; ' ||
' ' || v_limit_sql2 || ' ' ||
' EXIT WHEN CV%NOTFOUND; ' ||
' ' ||
' END LOOP; ' ||
' COMMIT; ' ||
' CLOSE CV; ' ||
'END; ';
EXECUTE IMMEDIATE v_plsql_to_run;
COMMIT;
END INSERT_DATA_TO_TABLE;
END SECURITY_COMPARE; -
Limiting Dimension Values to Dimension Values used on Specfic Day
If I have a dimension with thousands of values. And within my cube, on a given day only a few of those dimension values are actually used. How can I limit the scope of my dimension values to be only the values that exist on that given day?
You can check OLAP DML Programs chapter (chapter 4 in 11g doc set) in Oracle OLAP DML Reference document. It's part of the standard olap documentation.
Also regd the parameterization question:
The code as pasted below is already parameterized. By parameterization, do you mean something other than passing value from front-end to the back-end (database)?
Typically the front end report/query will refer to a series of time dimension values -- say, 16-Jul-2012 to 22-Jul-2012 for time. The report would reference a measure with a formula referring to an olap dml program. This program is called repeatedly for each cell and the appropriate dimension member values are passed as input to the program.
argument _tm time <-- implies that the program accepts time dimension value (corresponding to a single cell) as input and works off the same in its calculation.
limit time to _tm <-- usually this is done within a tempstat context to make such changes temporary for calculation w/o affecting external time dimension status. This allows the program to set the context of calculation to current cell (say 18-Jul-2012)
"hence what follows for the rest of the program acts on the restricted status in order to calculate the current cell's value corresponding to time dimension value = 18-Jul-2012.
That's also why the same program can return a different value for each cell (different return value for 18-Jul-2012 compared to return value for 21-Jul-2012) although it's being looped over dimension status implicitly.
HTH
Shankar -
Oracle.olapi.metadata.DuplicateMetadataIDException Problem
Hello,
I am getting oracle.olapi.metadata.DuplicateMetadataIDException error when I try to explore existing dimensions. I ran example that is in OLAP API javadoc. To be more specific I ran example in Chapter 4 of that javadoc (SampleMetadataDiscoverer10g.java).
Does anyone have a solution for this problem ?
I'll appreciate any helpBe sure to use the latest OLAP API Javadoc for 10g. You can find the 10.1.0.4 version at:
http://www.oracle.com/technology/products/bi/olap/olap.html
What lines of the SampleMetadataDiscoverer10g program caused the DuplicateMetadataIDException?
Do you have more than one schema installed that has OLAP Catalog metadata or dynamic analytic workspace metadata?
Do two or more schemas that are owned by the same user have objects that have the same names?
In a dimension, each member must be unique across all levels. If the user has the OLAP_DBA role, try changing it to OLAP_USER. The OLAP_DBA sees all metadata. The OLAP_USER is limited to the metadata of user/schema. -
How to create a scenario in Oracle OLAP
Hi,
I am new to Oracle OLAP.
I have a requirement where in we need two values 'Vs LY' and 'Vs Plan' which are scenarios to be placed in a dimension.
According to the scenario selected measure values should change.
For example:
Vs LY and Vs Plan are values in scenario dimension and measure should have fomrula
case when Scenario.Member='Vs Plan' then Sales - Planned Sales
when Scenario.Member='Vs LY' the Sales - LY Sales
else
Sales
end
Could you please let me know how to achieve this scenario dimension.
ThanksThank you all for your inputs.
If we need to have Foriegn Key for scenario dimension in the measure we will have to duplicate the measure data for each scenario.
If the number of scenarios increase the data increases in the fact table.
Is there any way we can avoid this duplication. -
Oracle OLAP ExpressDataProvider Exceptions
Hi
I'm using Oracle 9i OLAP API. There's something strange going on here. I written a test program that accesses the metadata and displays all it's contents. It runs fine on my home PC. At college the same program running on the same settings as that of my home PC (including the jar files required) gives me the error shown by the staacktrace below:
Exception in thread "main" java.lang.AbstractMethodError: oracle.jdbc.driver.OracleConnection.getTypeMap()Ljava/util/Map;
at oracle.express.idl.util.TypeMapHelper.setTypeMap(TypeMapHelper.java:14)
at oracle.express.olapi.data.full.ExpressDataProvider.initialize(ExpressDataProvider.java:150)
at metadata.main(metadata.java:44)
Press any key to continue...
I am also sending the code below:
import java.sql.*;
import oracle.jdbc.driver.OracleSavepoint;
import com.sun.java.util.collections.Map;
import com.sun.java.util.collections.List;
import com.sun.java.util.collections.Iterator;
import oracle.express.olapi.transaction.ExpressTransactionProvider;
import oracle.express.olapi.data.full.ExpressDataProvider;
import oracle.olapi.data.source.Source;
import oracle.olapi.metadata.MetadataObject;
import oracle.express.*;
import oracle.olapi.*;
import oracle.jdbc.OracleConnection;
import oracle.express.mdm.*;
import oracle.dms.console.DMSConsole;
import oracle.jdbc.driver.DMSFactory;
class metadata
public static void main(String[] args)
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
String url="jdbc:oracle:thin:@ss14:1521:OLAP";
String user="sh";
String passwd="sh123";
OracleConnection conn=(oracle.jdbc.OracleConnection)DriverManager.getConnection(url,user,passwd);
ExpressTransactionProvider tp=new ExpressTransactionProvider();
ExpressDataProvider dp=new ExpressDataProvider(conn,tp);
dp.initialize();
MdmMetadataProvider mp=null;
mp=(MdmMetadataProvider)dp.getDefaultMetadataProvider();
MdmSchema root=mp.getRootSchema();
System.out.println("Created Root Schema object...[OK]");
Explorer ex=new Explorer(root);
}catch(Exception e)
e.printStackTrace();
class Explorer
MdmSchema root;
public Explorer(MdmSchema root)
this.root=root;
get_Dimensions();
public void get_Dimensions()
MdmDimension mdmDim=null;
List dim=root.getDimensions();
System.out.println("Listing Dimensions");
Iterator iter=dim.iterator();
while(iter.hasNext())
mdmDim=(MdmDimension)iter.next();
System.out.println(mdmDim.getName());
System.out.println("Getting the regions within dimensions");
MdmUnionDimensionDefinition unionDef=(MdmUnionDimensionDefinition)(mdmDim.getDefinition());
try{
List hierarchies=unionDef.getRegions();
System.out.println("Tapped Dimensional metadata..[OK]");
Iterator hieriter=hierarchies.iterator();
MdmHierarchy mdmHier=null;
while(hieriter.hasNext())
mdmHier=(MdmHierarchy)hieriter.next();
System.out.println(mdmHier.getName());
}catch(Exception npe)
System.out.println("No regions present");
System.out.println("Determining Dimension Type");
try{
MdmDimensionMemberType dim_memb_type=mdmDim.getMemberType();
//check for the type of member
if(dim_memb_type instanceof MdmStandardMemberType)
System.out.println("Dimension is a standard dimension");
if(dim_memb_type instanceof MdmTimeMemberType)
System.out.println("Dimension is a TIME dimension");
if(dim_memb_type instanceof MdmMeasureMemberType)
System.out.println("Dimension is a Measure Member Type");
}catch(Exception e)
System.out.println("Exception:"+e);
//finally to finish off let's tap the attributes of each dimension
try{
List attrList=mdmDim.getAttributes();
MdmAttribute attribute=null;
Iterator attrIter=attrList.iterator();
while(attrIter.hasNext())
attribute=(MdmAttribute)attrIter.next();
System.out.println("Attribute:"+attribute.getName());
}catch(Exception e)
System.out.println("Exception:"+e);
I dunno what's happening.Someone help with this please.
It's urgent
Thanx
Prahalad DeshpandeGood questions and I have put them to the docs team to (1) update the online docs and (2) respond here. Let's see if they do.
Maybe you are looking for
-
Wpc content in KM tab in portal
HI when i am working with webpage compsoser in order to create a website i have enabled wpc_editor_role but inside the website management i could see nothing. Instead i did not find any wpccontent in teh KM content tab Can anyone please let me know h
-
Planned order not getting generated at plant level
Hi experts, When i run MRP for a particular plant in T- code (MD01) Planned order is not getting generated but when MRP is done against a material in T - code (MD02) in the same plant planned order gets generated... Is there any customizing to
-
Hello Gurus, I never done the extraction of data from CRM to BW. I am very new to CRM area. I need to work on Services, Warranty, Call Center, IBase, Interaction Center, Opportinuties. Can you guys please help me to provide any kind of document or he
-
Custom Property Editors in jDev
Hello, I have a custom property editor for a component in the viewer window. How do I access the component from my custom property editor? The propety editor does not have any reference of the component, since it is used to set the value of the prope
-
I am using an Inbound Async Java Proxy to send via socket three strings, via SXMB_MONI and RWB->MM->MDT I can see message was successfully delivered to JP System that for me is the XI J2EE engine, the JP is not sending anything (the logic is very sim