Performance problem while creating table at runtim

I have pl/sql block like
Begin
Exceute immediate 'drop table x '
Execute immediate 'create table x as select .... stament (complex select by joining 7-8 tables);
Execute immediate ('create index ind1 on table x'); -- i am not writing the full syntax
End;
The select statement used in create table is fetching 10 millions of rows (approx).
The above pl/sql block is taking 30-45 minutes.
Without going in depth of query used in select (as i have to explain the functionality otherwise),
Could any one please suggest to create a table in fatset way like nolooging or seperate tablespace with bigger block size or any change in any DB parameter etc.
The db server is having excelent hardware configuration 32GB ram , multi CPU (16 CPUs) , Huge hardisk.
Thanks

CREATE OR REPLACE VIEW VW_CUST_ACCT_BUS_REQ AS
SELECT FC.V_CUST_NUMBER,
FC.V_ACCT_NUMBER,
FC.V_ACCT_CUST_ROLE_CODE
from Fct_Acct_Cust_Roles FC --current schema table
join dim_jurisdiction DC on DC.V_JURISDICTION_CODE = FC.V_SRC_CNTRY_CODE
JOIN VW_APPLN_PARAMS APP ON APP.V_PARAM_CATEGORY = 'KYC'
AND APP.V_PARAM_IDENTIFIER =
'KYC_PROCESSING_DATE'
AND APP.N_CNTRY_KEY = DC.N_JURISDICTION_KEY
AND FC.FIC_MIS_DATE = APP.d_Param_Date
UNION
SELECT BUS_CUST_ACCT.CUST_INTRL_ID,
BUS_CUST_ACCT.ACCT_INTRL_ID,
BUS_CUST_ACCT.CUST_ACCT_ROLE_CD
FROM BUS_CUST_ACCT --another schema's table containing rows in millions.
--Can you tell me any other method to acheive the above select
CREATE TABLE vw_kyc_dr_ip as
SELECT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
FCU.V_CUST_NUMBER v_cust_id,
FACRS.V_CUST_NUMBER v_ip_cust_id,
ROLS.F_CONTROLLING_ROLE f_cntrl_role
FROM VW_CUST_BUS_REQ FCU -- This is another Mview it contains data approx 50,000
JOIN VW_CUST_ACCT_BUS_REQ FACR/* see above view definition, contains rows in millions */ ON FCU.V_CUST_NUMBER = FACR.V_CUST_NUMBER
JOIN VW_CUST_ACCT_BUS_REQ FACRS ON FACR.V_ACCT_NUMBER = FACRS.V_ACCT_NUMBER
JOIN DIM_ACCT_CUST_ROLE_TYPE ROLS ON ROLS.V_ACCT_CUST_ROLE_CODE =FACRS.V_ACCT_CUST_ROLE_CODE
UNION
(SELECT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
FCU.V_CUST_NUMBER v_cust_id,
FCR.V_RELATED_CUST_NUMBER v_ip_cust_id,
'N' f_cntrl_role
FROM VW_CUST_BUS_REQ FCU
JOIN VW_CUST_CUST_BUS_REQ FCR ON FCU.V_CUST_NUMBER =
FCR.V_CUST_NUMBER
JOIN VW_APPLN_PARAMS P ON P.V_PARAM_IDENTIFIER = 'KYC_PROCESSING_DATE'
AND P.V_PARAM_CATEGORY = 'KYC'
AND FCR.D_RELATIONSHIP_EXPIRY_DATE >=
P.D_PARAM_DATE
JOIN DIM_JURISDICTION ON DIM_JURISDICTION.N_JURISDICTION_KEY =
P.N_CNTRY_KEY
AND DIM_JURISDICTION.V_JURISDICTION_CODE =
FCU.V_SRC_CNTRY_CODE
MINUS
SELECT DISTINCT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
FCU.V_CUST_NUMBER v_cust_id,
FACRS.V_CUST_NUMBER v_ip_cust_id,
'N'
FROM VW_CUST_BUS_REQ FCU
JOIN VW_CUST_ACCT_BUS_REQ FACR ON FCU.V_CUST_NUMBER =
FACR.V_CUST_NUMBER
JOIN VW_CUST_ACCT_BUS_REQ FACRS ON FACR.V_ACCT_NUMBER =
FACRS.V_ACCT_NUMBER
JOIN DIM_ACCT_CUST_ROLE_TYPE ROLS ON ROLS.V_ACCT_CUST_ROLE_CODE =
FACRS.V_ACCT_CUST_ROLE_CODE
AND ROLS.F_CONTROLLING_ROLE = 'Y'
UNION
(SELECT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
FCU.V_CUST_NUMBER v_cust_id,
FCR.V_CUST_NUMBER v_ip_cust_id,
'N' f_cntrl_role
FROM VW_CUST_BUS_REQ FCU
JOIN VW_CUST_CUST_BUS_REQ FCR ON FCU.V_CUST_NUMBER =
FCR.V_RELATED_CUST_NUMBER
JOIN VW_APPLN_PARAMS P ON P.V_PARAM_IDENTIFIER = 'KYC_PROCESSING_DATE'
AND P.V_PARAM_CATEGORY = 'KYC'
AND FCR.D_RELATIONSHIP_EXPIRY_DATE >=
P.D_PARAM_DATE
JOIN DIM_JURISDICTION ON DIM_JURISDICTION.V_JURISDICTION_CODE =
FCU.V_SRC_CNTRY_CODE
AND DIM_JURISDICTION.N_JURISDICTION_KEY =
P.N_CNTRY_KEY
MINUS
SELECT DISTINCT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
FCU.V_CUST_NUMBER v_cust_id,
FACRS.V_CUST_NUMBER v_ip_cust_id,
'N'
FROM VW_CUST_BUS_REQ FCU
JOIN VW_CUST_ACCT_BUS_REQ FACR ON FCU.V_CUST_NUMBER =
FACR.V_CUST_NUMBER
JOIN VW_CUST_ACCT_BUS_REQ FACRS ON FACR.V_ACCT_NUMBER =
FACRS.V_ACCT_NUMBER
JOIN DIM_ACCT_CUST_ROLE_TYPE ROLS ON ROLS.V_ACCT_CUST_ROLE_CODE =
FACRS.V_ACCT_CUST_ROLE_CODE
AND ROLS.F_CONTROLLING_ROLE = 'Y'
Kindlt advice me on technical side , i think it is difficult to make you understand functionality.

Similar Messages

  • Problem while creating table dynamically using stored procedure

    Hi all
    When i try to execute the following lines get insufficient privilege error.
    FYI: i m able to create table statically.(i.e without using stored procedure)
    CREATE OR REPLACE PROCEDURE pcalling IS
    str varchar2(60);
    BEGIN
    str:='create table t15(tno number,tname varchar2(5))';
    execute immediate str;
    END;
    Thanks in advance
    Satya

    hi
    SQL> CREATE OR REPLACE PROCEDURE runddl (ddl_in in VARCHAR2)
      2     AUTHID CURRENT_USER
      3  IS
      4  BEGIN
      5     EXECUTE IMMEDIATE ddl_in;
      6  END;
      7  .
    SQL> /
    Procedure created.AUTHID CURRENT_USER clause before the IS keyword which runddl executes, it should run under the authority of the invoker, or current user not the authority of the definer.
    if you omit it then it will no longer will be run if the creator doesnt have privelege to run this ddl regardless invoker has or not.
    i hope you got it
    Khurram Siddiqui
    [email protected]

  • Problem while creating Table control with wizard

    Hi All,
    I am using the table control wizard.
    Following is the declared data :
    TYPES: BEGIN OF test_str,
            name TYPE string,
            city TYPE string,
          END OF test_str.
    DATA: lt_str TYPE STANDARD TABLE OF test_str,
          ls_str TYPE test_str.
    I activated the program after declaring this..
    then I created a screen.
    while generating the table control , i give the internal table name as lt_str and work area as  ls_str(both of these are also coming in F4 help) , i am getting the following error :
    the table work area  ls_str does not exist or is not a structure.
    Please help.
    Regards
    Panneer

    HI Selvam
    In the wizard please choose the radio button internal program table. I hope you might have choosen the dictonary table.
    And activate the program before generating the wizard.
    Please try this and let me know if any issues.
    Thanks
    Praveen
    Edited by: Praveen Kumar on Feb 4, 2010 4:34 AM

  • Problem while creating table maintenance generator using two step

    Hello All,
    I have created a Z table in which I have 7 fields, out of which 6 are character fields and 7th field is of type INT4
    Now when I create the maintenance generator using TWO STEP approach, the 7th field i.e., of type INT4 is not available in the first screen (the table control screen). This screen only has 6 fields for display.
    But when I click NEW ENTRIES button, I get the next screen which has all the 7 fields.
    But if I create the maintenance generator using SINGLE STEP, all 7 fields are displayed in the first screen.
    Please suggest. Let me know if you require some more explaination.
    Thanks & Regards,
    Tarun

    Hi Tarun,
    Go to the layout and increase the size of the Screen. or at the screen attributes change the length and width values.
    You know that initially the screen occupies default size only.
    Hope this would serve your purpose.
    Cheerz
    Ram

  • Error while creating table "EDISEGMENT' entry 'BIC/CIBA0PLANT_ATTR

    While loading master data for 0PLANT, its giving me following error.
    "error while creating table "EDISEGMENT' entry 'BIC/CIBA0PLANT_ATTR"
    Please help me out.
    Thanks

    steve,
    Can you give the solution you used to correct this problem?
    This error occurred in BW during import.
    Raj.

  • Source sys Restore "error while creating table EDISEGMENT "

    Dear All,
    I am Basis person and recently we have refreshed data of Test BI system from Development BI system. we normally carry out these Refresh but In this case we have also changed Hostname and SID for Test BI system.
    We have done all BW refresh steps as per guide and during Restore of source system we
    are getting errors during datasource activation as  " error while creating table EDISEGMENT ".
    we have checked RFC and Partner profiles and working fine.
    We have 2 clients connected from source system to our Test BI box.strange thing is we got one source system activated without any errors and for second
    source system we are getting above mentioned error.
    We have reviewed notes 339957 , 493422 but our BI fuctional team is not sure whether
    those apply to our OLTP system , as one source system from same OLTP system got
    successfully activated and source system for other client giving this issue .
    Please help us out with this problem.
    we are running on BI 7.0 platform and ECC 6.0 for source.
    Regards,
    Rr

    check the relevant profiles in We20 t code and also in sm59 if the remote connection with autorisation is sucssessfull, connection is ok otherwise you need to check th paramters.
    hope this helps
    regards
    santosh

  • Erro: "Error while creating table 'EDISEGMENT'"

    Pessoal bom dia,
    quando eu vou Ativar uma Regra de Transferência retona o seguinte erro:
    Error while creating table 'EDISEGMENT'
    não estou conseguindo desvendar o que pode ser isto, e a regra não ativa de jeito nenhum.
    Alguém já passou pelo problema?

    Please post this in the Portuguese Forum...
    Regards
    Juan

  • Error: "Error while creating table 'EDISEGMENT'"

    Hi,
    When I activate a Transfer Rule return the following error:
    Error while creating table 'EDISEGMENT'
    Someone has passed the problem?

    Bom dia Marques,
    Na SAP Note 339957 tem o síntoma descrito por você.
    Solução:
    In the system where the error occurs (usually the OLTP), create and run the report RS_CHECK_TS_EDISEGMENT (with SENDING and RECEIVING LOGSYS as an entry).
    Entretanto esta nota foi substituida pela SAP Note 493422, com bem mais detalhes e indica um programa Z
    Atenciosamente,
    Fernando Da Rós
    PS: Fórum em português.

  • Error while creating table 'EDISEGMENT' entry '/BIC/CIWA0TRZONE_TEXT'

    Hi experts,
    when I import my transport request to QA, I am getting this error
    "Error while creating table 'EDISEGMENT' entry '/BIC/CIWA0TRZONE_TEXT'"
    the performance assistance reads as below..
    Message no. EA201
    Diagnosis
    An attempt was made to create the entry '/BIC/CIWA0TRZONE_TEXT' in table 'EDISEGMENT'. The attempt failed.
    System response
    The operation was canceled.
    Procedure
    Please check whether the relevant entry already exists
    I have an entry for '/BIC/CIWA0TRZONE_TEXT'  in the table 'EDISEGMENT' do need to delete it before importing the transport. How to delete this entry, I donot see the options in SE11 /SE16..
    thanks in advance
    D Bret

    Hi,
    can you please be more precise with your enquiry?
    As far as I read the note, it is quite explanatory....
    What is your source system release?
    You'll need to implement this prog in your source system and execute it there.
    If everything works and is fine, import to program in your QA/PROD source systems and rexecute it as specified in the note...
    does it answer your question
    Olivier.

  • Error while creating table 'EDISEGMENT' entry '/BIC/CIBB0DISTR_CHAN_TEXT'

    When I am activating the transfer rules of 0divison_text giving me the error
    Error while creating table 'EDISEGMENT' entry '/BIC/CIBB0DISTR_CHAN_TEXT'
    Message no. EA201
    Diagnosis
    An attempt was made to create the entry '/BIC/CIBB0DISTR_CHAN_TEXT' in table 'EDISEGMENT'. The attempt failed.
    System Response
    The operation was canceled.
    Procedure
    Please check whether the relevant entry already exists.
    I have checked the note 493422 but I did not understand it can any one help me in this
    I am  working on 7.o with  SP SAPKW70010

    Hi Priya,
    Delete entries for the data source in ROOSGEN,  EDISEGMENT and EDSAPPL tables, both on ECC and BI sides.
    Try activating the infosource again.  This should solve your problem.
    Sasi

  • Dbms_xmlschema.registerschema, (ORA-31084: error while creating table )..

    Hello,
    I have some problems with dbms_xmlschema.registerschema
    My database is: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    My XSD schema is (SEPA pain.002.001.03.xsd) also available on this url: http://code.google.com/p/leontestbed/source/browse/trunk/bc2/sample/Schema/pain.002.001.03.xsd?r=241
    After
    begin
       DOK_XML_UTIL.p_vnesi_xsd_blob(401941242); -- store a XSD on file system from blob field
       dbms_xmlschema.registerschema(
        schemaurl => 'http://localhost/TEST1.XSD',
        schemadoc => bfilename('ETAX_LOAD','TEST1.XSD'),
        csid => nls_charset_id('AL32UTF8'));
    commit;
    end;I get:
    ORA-31084: error while creating table "INIS_PROD"."Document2781_TAB" for element "Document"
    ORA-02320: failure in creating storage table for nested table column "XMLDATA"."CstmrPmtStsRpt"."OrgnlPmtInfAndSts"
    ORA-01792: maximum number of columns in a table or view is 1000
    ORA-02310: exceeded maximum number of allowable columns in table
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 65
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 136
    ORA-06512: at line 4
    What I'am doing wrong or what is the reason for this error..

    Arrgghhh.....
    begin
       DOK_XML_UTIL.p_vnesi_xsd_blob(401941242);
       dbms_xmlschema.registerschema(
        schemaurl => 'http://localhost/TEST1.XSD',
        schemadoc => bfilename('ETAX_LOAD','TEST1.XSD'),
        csid => nls_charset_id('AL32UTF8')
        , local => true
      , genTypes => false
      , genTables => false);
    commit;
    end;sorry...

  • Problem while Creating MVLOG with synonym in Oracle 9i:Is it an Oracle Bug?

    Hi All,
    I am facing a problem while Creating MVLOG with synonym in Oracle 9i but for 10G it is working fine. Is it an Oracle Bug? or i am missing something.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL>
    SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
    Table created.
    SQL> create materialized view log on t;
    Materialized view log created.
    SQL> create public synonym syn_t for t;
    Synonym created.
    SQL> CREATE MATERIALIZED VIEW MV_t
      2  REFRESH ON DEMAND
      3  WITH PRIMARY KEY
      4  AS
      5  SELECT name,id
      6  FROM syn_t;
    Materialized view created.
    SQL> CREATE MATERIALIZED VIEW LOG ON  MV_t
      2  WITH PRIMARY KEY
      3   (name)
      4    INCLUDING NEW VALUES;
    Materialized view log created.
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for Solaris: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    SQL>
    SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
    Table created.
    SQL> create materialized view log on t;
    Materialized view log created.
    SQL> create public synonym syn_t for t;
    Synonym created.
    SQL> CREATE MATERIALIZED VIEW MV_t
    REFRESH ON DEMAND
    WITH PRIMARY KEY
    AS
      2    3    4    5  SELECT name,id
    FROM syn_t;   6
    Materialized view created.
    SQL> CREATE MATERIALIZED VIEW LOG ON  MV_t
    WITH PRIMARY KEY
    (name)
      INCLUDING NEW VALUES;  2    3    4
    CREATE MATERIALIZED VIEW LOG ON  MV_t
    ERROR at line 1:
    ORA-12014: table 'MV_T' does not contain a primary key constraintRegards
    Message was edited by:
    Avinash Tripathi
    null

    Hi Nicloei,
    Thanks for the reply. Actually i don't want any work around (Creating MVLOG on table rather than synonym is fine with me) . I just wanted to know it is actually an oracle bug or something else.
    Regards
    Avinash

  • Performance Problem while Aggregation

    Performance problem while aggrgating
    These r my dimension and cube i wrote customized Aggrgation map and i m aggragating all dimension (except for last level a unique one (PK) + cube .
    My system config is good ..
    But Aggrgation deployment (calculation ) is really really very slow compared to other vendors product
    i.e. It took me 3 hours to aggrgate all dimension (all levels except last) and cube (only containing 1000 rows to check and deleted all others rows)
    Dimensions Number of rows
    dim_product 156,0
    t_time 730
    dim_promotion 186,4
    dim_store 25
    dim_distributor 102,81
    Cube Number of Row
    Cube_SalesFact 300,000
    Plz solve my problem coz if it take that much time then i must say the performance of software is not that good where it should be....
    and i must suggest oracle to do some thing about this serious problem
    Thanks
    Well wisher of Oracle Corporation

    BEGIN
    cwm2_olap_manager.set_echo_on;
    CWM2_OLAP_MANAGER.BEGIN_LOG('D:\', 'AggMap_CubeSalesfact.log');
    DBMS_AW.EXECUTE('aw attach RTTARGET.AW_WH_SALES RW' );
    BEGIN
    DBMS_AWM.DELETE_AWDIMLOAD_SPEC('DIM_DISTRIBUTOR', 'RTTARGET', 'DIM_DISTRIBUTOR');
    DBMS_AWM.DELETE_AWDIMLOAD_SPEC('DIM_PRODUCT', 'RTTARGET', 'DIM_PRODUCT');
    DBMS_AWM.DELETE_AWDIMLOAD_SPEC('DIM_PROMOTION', 'RTTARGET', 'DIM_PROMOTION');
    DBMS_AWM.DELETE_AWDIMLOAD_SPEC('DIM_STORE', 'RTTARGET', 'DIM_STORE');
    DBMS_AWM.DELETE_AWDIMLOAD_SPEC('T_TIME', 'RTTARGET', 'T_TIME');
    --Deleting AW_CubeLoad_Spec
    DBMS_AWM.DELETE_AWCUBELOAD_SPEC('CUBESALESFACT', 'RTTARGET', 'CUBE_SALESFACT');
    DBMS_AW.EXECUTE('upd '||'RTTARGET'||'.'||'AW_WH_SALES' ||'; commit');
    Commit;
    --Deleting AggMap
    DBMS_AWM.Delete_AWCUBEAGG_SPEC('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT');
    DBMS_AW.EXECUTE('upd '||'RTTARGET'||'.'||'AW_WH_SALES' ||'; commit');
    Commit;
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    --Creating Agg Map for cube cube_salesfact
    -- DBMS_AWM.CREATE_AWCUBEAGG_SPEC(AggMap_Name , USER , AW_NAME, CUBE_NAME);
    DBMS_AWM.CREATE_AWCUBEAGG_SPEC('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT');
    --Specifying aggrgation for measures of cube
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_MEASURE('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'STORECOST');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_MEASURE('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'STORESALES');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_MEASURE('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'UNITSALES');
    --Specifying aggrgation for different level of dimensions
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_T_TIME', 'L_ALLYEARS');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_T_TIME', 'L_YEAR');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_T_TIME', 'L_QUARTER');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_T_TIME', 'L_MONTH');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_STORE', 'L_ALLCOUNTRIES');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_STORE', 'L_COUNTRY');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_STORE', 'L_PROVINCE');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_STORE', 'L_CITY');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PRODUCT', 'L_ALLPRODUCTS');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PRODUCT', 'L_BRANDCLASS');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PRODUCT', 'L_BRANDCATEGORY');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PRODUCT', 'L_BRAND');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_DISTRIBUTOR', 'L_ALLDIST');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_DISTRIBUTOR', 'L_DISTINCOME');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PROMOTION', 'L_ALLPROM');
    DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PROMOTION', 'L_PROMOTIONMEDIA');
    Begin
    --************************     CODE      **********************************
    --aw_dim.sql
    DBMS_AWM.CREATE_AWDIMLOAD_SPEC('DIM_DISTRIBUTOR', 'RTTARGET', 'DIM_DISTRIBUTOR', 'FULL_LOAD_ADDITIONS_ONLY');
    DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_DIM_DISTRIBUTOR', 'DIM_DISTRIBUTOR');
    commit;
    DBMS_AWM.CREATE_AWDIMLOAD_SPEC('DIM_PRODUCT', 'RTTARGET', 'DIM_PRODUCT', 'FULL_LOAD_ADDITIONS_ONLY');
    DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_DIM_PRODUCT', 'DIM_PRODUCT');
    commit;
    DBMS_AWM.CREATE_AWDIMLOAD_SPEC('DIM_PROMOTION', 'RTTARGET', 'DIM_PROMOTION', 'FULL_LOAD_ADDITIONS_ONLY');
    DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_DIM_PROMOTION', 'DIM_PROMOTION');
    commit;
    DBMS_AWM.CREATE_AWDIMLOAD_SPEC('DIM_STORE', 'RTTARGET', 'DIM_STORE', 'FULL_LOAD_ADDITIONS_ONLY');
    DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_DIM_STORE', 'DIM_STORE');
    commit;
    DBMS_AWM.CREATE_AWDIMLOAD_SPEC('T_TIME', 'RTTARGET', 'T_TIME', 'FULL_LOAD_ADDITIONS_ONLY');
    DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_T_TIME', 'T_TIME');
    commit;
    --aw_cube.sql
    DBMS_AWM.CREATE_AWCUBELOAD_SPEC('CUBE_SALESFACT', 'RTTARGET', 'CUBE_SALESFACT', 'LOAD_DATA');
    dbms_awm.add_awcubeload_spec_measure('CUBE_SALESFACT', 'RTTARGET', 'CUBE_SALESFACT', 'STORECOST', 'STORECOST', 'STORECOST');
    dbms_awm.add_awcubeload_spec_measure('CUBE_SALESFACT', 'RTTARGET', 'CUBE_SALESFACT', 'STORESALES', 'STORESALES', 'STORESALES');
    dbms_awm.add_awcubeload_spec_measure('CUBE_SALESFACT', 'RTTARGET', 'CUBE_SALESFACT', 'UNITSALES', 'UNITSALES', 'UNITSALES');
    DBMS_AWM.REFRESH_AWCUBE('RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'CUBE_SALESFACT');
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    -- Now build the cube. This may take some time on large cubes.
    -- DBMS_AWM.aggregate_awcube(USER, AW_NAME, CUBE_NAME, aggspec);
    DBMS_AWM.aggregate_awcube('RTTARGET','AW_WH_SALES', 'WH_CUBE_SALESFACT','AGG_CUBESALESFACT');
    DBMS_AW.EXECUTE('upd '||'RTTARGET'||'.'||'AW_WH_SALES' ||'; commit');
    Commit;
    CWM2_OLAP_METADATA_REFRESH.MR_REFRESH();
    CWM2_OLAP_METADATA_REFRESH.MR_AC_REFRESH();
    DBMS_AW.Execute('aw detach RTTARGET.AW_WH_Sales');
    CWM2_OLAP_MANAGER.END_LOG;
    cwm2_olap_manager.set_echo_off;
    EXCEPTION WHEN OTHERS THEN NULL;
    -- EXCEPTION WHEN OTHERS THEN RAISE;
    END;

  • Problem while creating xml with cdata section

    Hi,
    I am facing problem while creating xml with cdata section in it. I am using Oracle 10.1.0.4.0 I am writing a stored procedure which accepts a set of input parameters and creates a xml document from them. The code snippet is as follows:
    select xmlelement("DOCUMENTS",
    xmlagg
    (xmlelement
    ("DOCUMENT",
    xmlforest
    (m.document_name_txt as "DOCUMENT_NAME_TXT",
    m.document_type_cd as "DOCUMENT_TYPE_CD",
    '<![cdata[' || m.document_clob_data || ']]>' as "DOCUMENT_CLOB_DATA"
    ) from table(cast(msg_clob_data_arr as DOCUMENT_CLOB_TBL))m;
    msg_clob_data_arr is an input parameter to procedure and DOCUMENT_CLOB_TBL is a pl/sql table of an object containing 3 attributes: first 2 being varchar2 and the 3rd one as CLOB. The xml document this query is generating is as follows:
    <DOCUMENTS>
    <DOCUMENT>
    <DOCUMENT_NAME_TXT>TestName</DOCUMENT_NAME_TXT>
    <DOCUMENT_TYPE_CD>BLOB</DOCUMENT_TYPE_CD>
    <DOCUMENT_CLOB_DATA>
    &lt;![cdata[123456789012345678901234567890123456789012]]&gt;
    </DOCUMENT_CLOB_DATA>
    </DOCUMENT>
    </DOCUMENTS>
    The problem is instead of <![cdata[....]]> xmlforest query is encoding everything to give &lt; for cdata tag. How can I overcome this? Please help.

    SQL> create or replace function XMLCDATA_10103 (elementName varchar2,
      2                                             cdataValue varchar2)
      3  return xmltype deterministic
      4  as
      5  begin
      6     return xmltype('<' || elementName || '><![CDATA[' || cdataValue || ']]>
      7  end;
      8  /
    Function created.
    SQL>  select xmlelement
      2         (
      3            "Row",
      4            xmlcdata_10103('Junk','&<>!%$#&%*&$'),
      5            xmlcdata_10103('Name',ENAME),
      6            xmlelement("EMPID", EMPNO)
      7         ).extract('/*')
      8* from emp
    SQL> /
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[SMITH]]></Name>
      <EMPID>7369</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[ALLEN]]></Name>
      <EMPID>7499</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[WARD]]></Name>
      <EMPID>7521</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[JONES]]></Name>
      <EMPID>7566</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[MARTIN]]></Name>
      <EMPID>7654</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[BLAKE]]></Name>
      <EMPID>7698</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[CLARK]]></Name>
      <EMPID>7782</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[SCOTT]]></Name>
      <EMPID>7788</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[KING]]></Name>
      <EMPID>7839</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[TURNER]]></Name>
      <EMPID>7844</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[ADAMS]]></Name>
      <EMPID>7876</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[JAMES]]></Name>
      <EMPID>7900</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[FORD]]></Name>
      <EMPID>7902</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[MILLER]]></Name>
      <EMPID>7934</EMPID>
    </Row>
    14 rows selected.
    SQL>

  • Problem while creating the Partner Address in CRM

    Hi,
       We are facing one problem while creating the new address for the Business Partner.
       When ever customer wants to change the address : we are following one process : where we are      
       using 'BAPI_BUPA_ADDRESS_ADD' functin module. Becuse of this , new addrss number will be generated for the 
      corresponding account in BUT021_FS table.But this table contains old address number as a first record, so that when ever
      we display the partner address in UI, it is displaying the old address only because first entry of the the table 'BUT021_FS'
      contains the old address number.
      Because of this , we are getting lots of complaints regarding this.
    Can you please help on this ASAP.
    Thanks & Regards
    Pradeep.

    Try BAPI_BUPA_ADDRESS_CHANGE  for address change followed by BAPI_TRANSACTION_COMMIT . It works.

Maybe you are looking for