Join wise Partition 3 tables is possible?

Hello
I have two tables. One is an array of key-value (EAV model).
The key-value table has a partitioning of reference through the reference to the main table, which is partionned by the time.
I want to choose to select all entries in the main table with two specific value in the table "key-value. Because each value is a line, I need to join (or do a subquery) table of the value of key as many times as I have values to search.
In my case, the query is:
    SELECT p.pdu_id
    FROM  pdu p
    INNER JOIN field_value fv  ON (fv.pdu_id = p.pdu_id   AND fv.field_id = 4)
    INNER JOIN field_value fv2 ON (fv2.pdu_id = p.pdu_id  AND fv2.field_id= 3)
    WHERE
        P.TIME     > to_date('11/21/2006 00:00:00','MM/DD/YYYY HH24:MI:SS')
    AND P.TIME   < to_date('11/28/2006 00:00:00','MM/DD/YYYY HH24:MI:SS')
    AND fv.value = '0xFFFFFF'
    AND fv2.value = 'aircraft'
This query can also be written like this:
SELECT p.pdu_id
FROM
  (
    SELECT p.pdu_id
    FROM pdu p
    INNER JOIN field_value fv ON (fv.pdu_id = p.pdu_id AND fv.field_id = 4)
    WHERE
        P.TIME     > to_date('11/21/2006 00:00:00','MM/DD/YYYY HH24:MI:SS')
    AND P.TIME   < to_date('11/28/2006 00:00:00','MM/DD/YYYY HH24:MI:SS')
    AND fv.value = '0xFFFFFF'
  )  p
INNER JOIN field_value fv2 ON (fv2.pdu_id = p.pdu_id AND fv2.field_id = 3)
WHERE fv2.value = 'aircraft'
The two motions have comparable performance and explain the plan.
This query takes time looooonnng... When I look at the plan to explain it and I can see that only a partition of Oracle 'p' access, only a score of "fv", but all the fv2 partition!

An idea to make fv2 use only the right partition?

Thanks in advance

Published by: Thibault January 31, 2011 03:16

Hello

Try this and use an index on the column used for Assembly.

SELECT / * + (p.pdu_id_idx) * / p.pdu_id of
(select pdu_id from pdu, including TIME > to_date (November 21, 2006 00:00:00 "," MM/DD/YYYY HH24:MI:SS'))
AND THE TIME< to_date('11/28/2006="" 00:00:00','mm/dd/yyyy="">
(select pdu_id field_value where value = "0xFFFFFF" and field_id = 4) fv,.
(select pdu_id field_value where value = "airplane" and field_id = 3) fv2
where p.pdu_id = fv.pdu_id
and p.pdu_id = fv2.pdu_id;

Tags: Database

Similar Questions

  • ORA-01445: cannot select ROWID, or sample, a view of join without key - preserved table form w/report and LOV

    I create a page "Form on a Table with Report" (APEX 5). Table I has 3 columns: cat_key, item_value, item_description. The cat_key is a foreign key in a table with columns cat_key, cat_value. I created the report and everything works fine.  The page of the report shows my domain cat_key in number, so I want it instead to display the cat_value. I change the field cat_key to a text based on LOV, select my LOV and now when I view the page of report I get the "'ORA-01445: cannot select ROWID from where sample, a join without key preserved table view ' error." The report uses the ROWID as a link to the edit page field.

    If I use the same tables and even shared LOV in a report page interactive, it works fine.

    What I am doing wrong?

    This is a limitation of the IR Apex will rewrite your query to a query that includes the lookup table and the columns. So now you have actually created a query on an inline view, which causes the error. You can see the query apex created when running in debug mode. APEX will join the table of choice with your primary table. For example from one of my IR:

    Select 'ID '...

    "MSL". "" HIS_COUNTRIES "=> my primary table

    ) ) b,

    (select rv_meaning d, rv_low_value r

    of msl_ref_codes_table

    where rv_domain = "JOHN".

    ) L1 = > query My LOV Lookup

    ...

    So, if possible, base your reports and forms on the real primary key, no rowid.

    You can also write the IR query with the search yourself:

    Select T1.rowid...

    of primary_table T1

    look_table L1

    ...

  • Join sorted on 2 tables, not a foreign key

    Hello

    I have two tables:

    BookAuthor
    -------------
    number surrogateid
    AuthorName varchar
    number bookid

    Books
    -------------------
    number bookid
    BookTitle varchar
    other columns

    I want to make some kind of query to join on the two tables where the query arguments are: rangefirst and: rangelast for 2 authornames, where I want to catch all bookauthors authorname between implicit, sorted, and then join the table books to fetch the booktitle and bookid and the authorname, and authornames which are the same also sort the product join by booktitle to the Books table.

    I hope it's possible!

    NOTE: there no foreign key relationship, so if a line of BookAuthor bookid value that does not exist in the table of books, I don't want a line into the product.

    And what kind of evidence do I need on each table.

    Thank you
    Andy

    You need clues if your table is large enough and you select only a few records in the table.

    If the create index case bookid on tables.

    Once the data are joined, you have no clue to the order.

    G.

  • How to join this per_rating_levels this table with query table.

    Dear all,

    Guide how 2 join me per_rating_levels this table with query because, I want 2 see the per_rating_levels.name against all employees.
    When I join this table with query it shows several recording/cortion against this record.

    Query:

    SELECT
    PAPF.full_name employee_name,
    papf1.full_name supervisor_name,
    WOMEN'S WEAR. Employee_number,

    hr_general.decode_job (PAAF.job_id) job_name,
    Department of hr_general.decode_organization (PAAF.organization_id),
    PC.Name, PCE.Comments EmployeeComments,
    (by selecting pce1.comments in per_competence_elements pce1
    where
    PCE.assessment_id = pce1.assessment_id
    AND pce.competence_id = pce1.competence_id
    AND pce1.object_id = pce.object_id) ManagerComments;

    --(sélectionnez rtl.name dans rtl où les pc.) RATING_SCALE_ID = rtl. Name RATING_SCALE_ID)


    OF per_all_people_f women's wear.
    per_all_people_f papf1,
    per_all_assignments_f ADP,
    PA per_appraisals,
    pat per_appraisal_templates,
    per_assessments not,
    per_competence_elements pce,
    per_competences pc


    WHERE papf.person_id = paaf.person_id
    AND paaf.supervisor_id = papf1.person_id
    AND paaf.primary_flag = 'Y '.
    AND pa.appraisee_person_id = papf.person_id
    AND pa.appraisal_template_id = pat.appraisal_template_id
    AND pa.appraisal_id = pas.appraisal_id
    AND pat.assessment_type_id = pas.assessment_type_id
    AND pas.assessment_id = pce.assessment_id
    AND pce.object_id = papf.person_id
    AND pce.competence_id = pc.competence_id
    AND trunc (sysdate) BETWEEN papf.effective_start_date AND papf.effective_end_date
    AND trunc (sysdate) BETWEEN papf1.effective_start_date AND papf1.effective_end_date
    AND trunc (sysdate) BETWEEN paaf.effective_start_date AND paaf.effective_end_date

    - AND papf.employee_number =: p_employee_number
    - AND pa.appraisal_date =: p_appraisal_date
    - AND papf.business_group_id =: p_bg_id

    order of papf.employee_number


    Concerning

    user10941925 wrote:
    Dear all,

    Guide how 2 join me per_rating_levels this table with query because, I want 2 see the per_rating_levels.name against all employees.
    When I join this table with query it shows several recording/cortion against this record.

    '2' in your question means "to"? If so please do not use text instant message in this forum.

    Now I suppose that PRE_RATING_LEVELS is a table in your application. And you are trying to include this table in an existing query. But in doing so, you have found the Cartesian product, correct?

    In fact, how do you think someone a public forum without any knowledge of your table and data structure could help you?

    Lets see, here's your query. I formatted.

    
    select papf.full_name                                       employee_name
         , papf1.full_name                                      supervisor_name
         , papf.employee_number                                 employee_number
         , hr_general.decode_job(paaf.job_id)                   job_name
         , hr_general.decode_organization(paaf.organization_id) department
         , pc.name                                              name
         , pce.comments                                         employeecomments
         , (
              select pce1.comments
                from per_competence_elements pce1
               where pce.assessment_id = pce1.assessment_id
                 and pce.competence_id = pce1.competence_id
                 and pce1.object_id = pce.object_id
           )                                                    managercomments
      from per_all_people_f        papf
         , per_all_people_f        papf1
         , per_all_assignments_f   paaf
         , per_appraisals          pa
         , per_appraisal_templates pat
         , per_assessments         pas
         , per_competence_elements pce
         , per_competences         pc
     where papf.person_id           = paaf.person_id
       and paaf.supervisor_id       = papf1.person_id
       and paaf.primary_flag        = 'Y'
       and pa.appraisee_person_id   = papf.person_id
       and pa.appraisal_template_id = pat.appraisal_template_id
       and pa.appraisal_id          = pas.appraisal_id
       and pat.assessment_type_id   = pas.assessment_type_id
       and pas.assessment_id        = pce.assessment_id
       and pce.object_id            = papf.person_id
       and pce.competence_id        = pc.competence_id
       and trunc(sysdate) between papf.effective_start_date  and papf.effective_end_date
       and trunc(sysdate) between papf1.effective_start_date and papf1.effective_end_date
       and trunc(sysdate) between paaf.effective_start_date  and paaf.effective_end_date
    order
        by papf.employee_number 
    

    Now, you want to add the PRE_RATING_LEVELS in the list so that you can use the column NAME.

    First thing you need to do is to determine the relationship between PRE_RATING_LEVELS and other tables. A relationship can be

    1. one on one
    2 one-to-many
    3. - to-several

    So when you tried to join, your state of health has resulted in 2nd or 3rd type of relationship. If you arrive with someone who knows the business and the data and find the table that could uniquely identify a line of PRE_RATING_LEVELS.

  • Table partitioning on table MTL_SYSTEM_ITEMS_B?

    Hello

    We have an obligation to apply the partitioning on table MTL_SYSTEM_ITEMS_B. main reason is to improve the performance of queries.

    We planned to do with ORGANIZATION_ID column as the partition key.

    If anyone can share with your thoughts, what method of partition is good at this table to improve performance.

    Thank you

    Hello

    Please see these links/docs.

    Using partitioning of database with the E-Business Suite
    http://blogs.Oracle.com/stevenChan/2006/09/using_database_partitioning_wi.html

    Updated whitepaper: database, partitioning for E-Business Suite
    http://blogs.Oracle.com/stevenChan/2009/04/whitepaper_update_database_partitioning_for_ebusin.html

    Note: 554539.1 - database using partitioning with Oracle E-Business Suite

    Thank you
    Hussein

  • Partitioning of Tables/indexes

    Hello

    Oracle Version 10.2.0
    O/s Version: SUSE Linux

    Currently, all tables and indexes are stored in the ponit of NFS mounting. I would like to know if I can partition the tables/indexes on local storage temporarily.

    Thank you

    Hello
    Yes you can do it. But if you have a few scores on NAS and others on the local drive, then depending on the nature of the query/DML you will see some performance issues.

    MSK

  • several "logical joins" between a fact table and a dimension table

    It seems that cannot create multiple "logical joins" between a fact table and the table of a dimension in OBIEE with Administration Oracle BI tool. For example, whereas a business model with a dimension table TIMES and has made the table containing the value of START_TIME and END_TIME, we want to create separate logical joins BOTH done for the START_TIMEs and the END_TIMEs? Of course, underlying foreign keys can be created, but as far as I can tell the Administration Oracle BI tool does not support this. The solution would be to reproduce the table in TIME, but it's ugly.
    I'm looking for another approach.

    Try this. Create an alias of two for the TIME dimension (beginning & end) in the physical layer, then remove foreign key to the 'Parent' time dimension. Create the foreign key in the physical layer for new aliases, then create complex joins in the MDB layer for new aliases as well. This will allow you to present the two dates within the same table in the presentation layer. Not a more elegant solution, but it works.

  • Dynamically partition a table based on different values of a specific column: possible?

    I'll start by explaining my problem, so that you can have a global vision of the problem and perhaps suggest another solution. Problem: I have 2 tables with millions of records. Records are added daily, and so each row in each table has a column of "insertion_date".

    C1 C2 ... C10 insertion_date (type date, ofc)
    

    lines are cleaned according to the insertion_date parameter. This can happen in two ways:

    1 - whenever an application error appears. In this case delete is based on a single day and would be like:

    delete from T1 where insertion_date=##;
    

    in other words remove us the lines added and then restart the program (business logic, can't change it)

    2. every two weeks the data associated with these two weeks are deleted because will be most used:

    delete from T1 where insertion_date between ## and ##; (a two weeks period here)   
    

    Delete is currently very slow: it takes abot 8 minutes just to remove approximately 5 M of records (with the same insertion_date), I can't even imagine the time required to delete records more.

    So, here's my idea!

    I would partition my DB according to the value of insertion_date.

    To remove case 1 I would simply delete the partion associated with this insertion date, to remove scores of cases 2 associates at that interval.

    For the needs of my application at most 15 were leaving are present each time (maybe 20 if I want to keep last at least 5 days of data), so the documented limit of 64000 partitions is not a problem.

    Real problem is that I do not know insertion_date values in advance, so my question: is it possible to automatically create a new partition every time presents itself a new value of insertion_date?

    And please correct me if I'm wrong, if I accomplish partitioning that I wouldn't need to edit above right queries? I know just the faster removal time am I correct?

    No - it isn't bog standard range partitioning partitioning interval

    But perhaps you're citing 9i documentation for a reason?

    It is a feature of 11g... then only about 10 years.

    create table t1
    (col1  date)
    partition by range (col1) interval (numtodsinterval(1,'DAY'))
    (partition po values less than (to_date('01-01-2015','DD-MM-YYYY')));
    
    table T1 created.
    
    select table_name, partition_name, high_value from user_tab_partitions where table_name = 'T1';
    
    TABLE_NAME                     PARTITION_NAME                 HIGH_VALUE
    ------------------------------ ------------------------------ --------------------------------------------------------------------------------
    T1                             PO                             TO_DATE(' 2015-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA...'
    
    insert into t1
    select trunc(sysdate,'MM')+rownum-1
    from   dual
    connect by  rownum <= 10;
    
    select table_name, partition_name, high_value from user_tab_partitions where table_name = 'T1';
    
    TABLE_NAME                     PARTITION_NAME                 HIGH_VALUE
    ------------------------------ ------------------------------ --------------------------------------------------------------------------------
    T1                             PO                             TO_DATE(' 2015-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA...'
    T1                             SYS_P450383                    TO_DATE(' 2015-07-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA...'
    T1                             SYS_P450384                    TO_DATE(' 2015-07-03 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450385                    TO_DATE(' 2015-07-04 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450386                    TO_DATE(' 2015-07-05 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450387                    TO_DATE(' 2015-07-06 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450388                    TO_DATE(' 2015-07-07 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450389                    TO_DATE(' 2015-07-08 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450390                    TO_DATE(' 2015-07-09 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450391                    TO_DATE(' 2015-07-10 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450392                    TO_DATE(' 2015-07-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    
  • Is it possible to partition a table create a partition itself?

    Hello

    I've migrated a table in the partition table by years on the production system.
    But I thought, after the new year 2011 must I add new partition again for 2011?

    For example,.
    When a new record comes for 2011, and if there is no partition for 2011 the table must be to create the new partition for 2011 himself?

    Each year I'll add new partition myself? It is a tedious job.

    Yes. I know MAXVALUE, but I don't want to use it. I want to be done automatically.

    Kind regards

    Hello
    Change in your script like below.

    SQL> DECLARE
      2   str varchar2(200);
      3   dt varchar2(20) ;
      4   BEGIN
      5   dt := TO_CHAR(round(sysdate,'month'),'DD/MM/YYYY');
      6   str := 'alter table INVOICE_PART1 add partition INV'||TO_CHAR(TO_DATE(sysd
    ate,'DD/MM/RR'),'YYYY')||' VALUES LESS THAN (TO_DATE('''||dt||''',''DD/MM/YYYY''
    ))';
      7
      8   dbms_output.put_line(str);
      9   EXECUTE IMMEDIATE str;
     10  END;
     11  /
    alter table INVOICE_PART1 add partition INV2010 VALUES LESS THAN
    (TO_DATE('01/01/2011','DD/MM/YYYY'))
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    Kind regards
    Avinash

  • Exchange partition without changing tablespace possible?

    Hello

    Using oracle 11.2.0.3 and we have some etl that creates a temporary table and swaps a temporary table in a partition of a large table.

    However, the temporary table is in a different tablespace to the main.

    2 options - always make sure us that the temporary table in the tablespace appropriate beforehand or ideally is possible to issue

    change the swap partition table without sharing the actual name of tablespace?

    Thank you

    Using oracle 11.2.0.3 and we have some etl that creates a temporary table and swaps a temporary table in a partition of a large table.

    However, the temporary table is in a different tablespace to the main.

    2 options - always make sure us that the temporary table in the tablespace appropriate beforehand or ideally is possible to issue

    change the swap partition table without sharing the actual name of tablespace?

    #1 option is the ONLY choice you have.

    an EXCHANGE is just an update of metadata in the data dictionary. He 'Exchange' pointers to two data segments.

    In particular, it DOES NOT move the data. Any tablespace data are forward exchange data will always be after.

  • Partitioning the table - range on data type (21, 7) number and varchar2

    Hello

    Database version:

    DB: Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    Operating system: HP - UX nduhi18 B.11.31 U ia64 1022072414 unlimited-license user

    APP: SAP - ERP

    I have to the partition of the RANGE on UPDATED_ON or PROFILE is a table that has a structure below:

    Name Null?    Type

    -------------------- -------- --------------

    ------------------

    MANDT NOT NULL VARCHAR2 (9)

    MR_ID NOT NULL VARCHAR2 (60)

    PROFILE NON-NULL VARCHAR2 (54)

    NO_REGISTRE NOT NULL VARCHAR2 (30)

    INTERVAL_DATE NOT NULL VARCHAR2 (24)

    AGGR_CONSUMPTION NOT NULL NUMBER (21.6)

    MDM_VERS_NO NOT NULL VARCHAR2 (9)

    MDP_UPDATE_DATE NOT NULL VARCHAR2 (24)

    MDP_UPDATE_TIME NOT NULL VARCHAR2 (18)

    NMI_CONFIG NOT NULL VARCHAR2 (120)

    NMI_CONFIG_FLAG NOT NULL VARCHAR2 (3)

    MDM_DATA_STRM_ID NOT NULL VARCHAR2 (6)

    NSRD NOT NULL VARCHAR2 (24)

    REASON_CODE NOT NULL VARCHAR2 (9)

    QUALITY_FLAG NOT NULL VARCHAR2 (3)

    METHOD_FLAG NOT NULL VARCHAR2 (6)

    MSATS_UPDATE_DAT NOT NULL VARCHAR2 (24)

    MSATS_UPDATE_TIM NOT NULL VARCHAR2 (18)

    READ_STATUS NOT NULL VARCHAR2 (3)

    LEGACY_FLAG NOT NULL VARCHAR2 (3)

    CREATED_ON NOT NULL NUMBER (21.7)

    CREATED_BY NOT NULL VARCHAR2 (36)

    UPDATED_ON NOT NULL NUMBER (21.7)

    UPDATED_BY NOT NULL VARCHAR2 (36)

    CVERSNO NOT NULL VARCHAR2 (18)

    OLDER_MD_FLAG NOT NULL VARCHAR2 (3)

    TRANSACTION_ID NOT NULL VARCHAR2 (108)

    According to my knowledge, RANGE is better suited for the DATE or NUMBER. and partition INTERVAL is available on the DATE or number.

    PROFILE of column

    I havets is of type VARCHAR2. I know that again I can partition as Oracle convert internally to varchar2 in number when the data is inserted. But the INTERVAL is not possible.  However, so could you please suggest how RANGE partition on PROFILE?

    CREATED_ON column:

    It's the NUMBER with decimals. Could you guide me please?

    Please let me know if you need more information?

    See you soon

    Sameer

    I partitioned table as below:

    PARTITION BY RANGE

    (

    "CREATED_ON".

    )

    SUBPARTITION BY HASH

    (

    'PROFILE '.

    )

    SUBPARTITION TEMPLATE

    (

    TABLESPACE SUBPARTITION 'PROF_SUB01"'PSAPISU."

    TABLESPACE SUBPARTITION 'PROF_SUB02"'PSAPISU."

    TABLESPACE SUBPARTITION 'PROF_SUB03"'PSAPISU."

    TABLESPACE SUBPARTITION 'PROF_SUB04"'PSAPISU."

    TABLESPACE SUBPARTITION 'PROF_SUB05"'PSAPISU."

    TABLESPACE SUBPARTITION 'PROF_SUB06"'PSAPISU."

    TABLESPACE SUBPARTITION 'PROF_SUB07"'PSAPISU."

    TABLESPACE SUBPARTITION 'PROF_SUB08"'PSAPISU."

    TABLESPACE SUBPARTITION 'PROF_SUB09"'PSAPISU."

    TABLESPACE SUBPARTITION 'PROF_SUB10' 'PSAPISU '.

    )

    (

    "BEF12_CP00" VALUES LOWER PARTITION TO (20120101000000),

    "JAN12_CP01" VALUES LOWER PARTITION TO (20120201000000),

    "FEB12_CP02" VALUES LOWER PARTITION TO (20120301000000),

    "MAR12_CP03" VALUES LOWER PARTITION TO (20120401000000),

    "APR12_CP04" VALUES LOWER PARTITION TO (20120501000000),

    "MAY12_CP05" VALUES LOWER PARTITION TO (20120601000000),

    "JUN12_CP06" VALUES LOWER PARTITION TO (20120701000000),

    "JUL12_CP07" VALUES LOWER PARTITION TO (20120801000000),

    "AUG12_CP08" VALUES LOWER PARTITION TO (20120901000000),

    "SEP12_CP09" VALUES LOWER PARTITION TO (20121001000000),

    "OCT12_CP10" VALUES LOWER PARTITION TO (20121101000000),

    "NOV12_CP11" VALUES LOWER PARTITION TO (20121201000000),

    "DEC12_CP12" VALUES LOWER PARTITION TO (20130101000000),

    "JAN13_CP13" VALUES LOWER PARTITION TO (20130201000000),

    "FEB13_CP14" VALUES LOWER PARTITION TO (20130301000000),

    "MAR13_CP15" VALUES LOWER PARTITION TO (20130401000000),

    "APR13_CP16" VALUES LOWER PARTITION TO (20130501000000),

    "MAY13_CP17" VALUES LOWER PARTITION TO (20130601000000),

    "JUN13_CP18" VALUES LOWER PARTITION TO (20130701000000),

    "JUL13_CP19" VALUES LOWER PARTITION TO (20130801000000),

    "AUG13_CP20" VALUES LOWER PARTITION TO (20130901000000),

    "SEP13_CP21" VALUES LOWER PARTITION TO (20131001000000),

    "OCT13_CP22" VALUES LOWER PARTITION TO (20131101000000),

    "NOV13_CP23" VALUES LOWER PARTITION TO (20131201000000),

    PARTITION 'OTHER_CPMAX' VALUES LESS THAN (MAXVALUE)

    )

    works very well.

  • extraction of data each month and year wise in a table

    Hello...

    I have a table as raw material

    indicator dateofmateria clinker OPC ppc
    35 22 23/11/2 / 2012 CS
    45 87 78 23/11/2012 D
    55 90 100 11/23/2012 P
    4 45 24/11/27/2012 CS
    52 25 48 24/11/2012 D
    58 50 103 24/11/2012 P
    5 50 25/1 / 11 / 2012 CS
    45 17 55 11/25/2012 D
    45 77 55 25/11/2012 P...
    Here P indicates that the production of material, D flag show send material and CS flags shows the closing stock respective dates.

    I just want to calculate the difference in stock for the respective dates.
    I want to calculate the difference in stock as below for example particular date 23/11/2012-

    Difference in stock (OPC) = ((SUM * (OPC) where flag P = & month = 'nov')-(* SUM * (OPC) where flag = D & month = 'nov')-(* SUM * (OPC) where flag = CS & month = 'nov') *)

    Similarly for the PPC and also clinker.

    I want to calculate the difference in stock simultaneously for all the month of a given year that is seized by use

    I m using the following question for this...
    * Select to_char(a.dateofmtrl,'mon'), sum (a.rm1) - sum (b.rm1) - sum (c.rm1) OPC, sum (a.rm2) - sum (b.rm2) - sum (c.rm2) PPC, sum (a.rm3) - sum (b.rm3) - sum (c.rm3) CLINKER
    rawmtrl_graph a.,
    b rawmtrl_graph,
    c rawmtrl_graph
    where
    TO_CHAR (a.dateofmtrl, 'yyyy') = '2012' and
    TO_CHAR (b.dateofmtrl, 'yyyy') = '2012' and
    TO_CHAR (c.dateofmtrl, 'yyyy') = '2012' and
    a.mtrl_flag = 'P' and
    b.mtrl_flag = has ' and
    'c.mtrl_flag =' CS
    To_char Group (a.dateofmtrl, 'my')
    BUT IT IS DOES NOT CALCULATE THE STOCK OF MUTUAL FUNDS, PPC, CLINKER WITH PRECISION (WHICH GIVES SOME FIGURE UNEXPECTEDLY FOR EACH MONTH OF THE YEAR).

    PLEASE HELP ME IN THIS...
    I WANT TO CALCULATE THE STOCK DIFFERENCE YEAR WISE ALSO...

    THANKS AND GREETINGS

    VISHAL AMINE

    Well your three requests were not being met, then you would have generated a Cartesian product. Try the following:

    SELECT TO_CHAR(a.dateofmtrl,'mon'),
           SUM(a.rm1) - SUM(b.rm1) - SUM(c.rm1) OPC,
           SUM(a.rm2) - SUM(b.rm2) - sum(c.rm2) PPC,
           SUM(a.rm3) - sum(b.rm3) - sum(c.rm3) CLINKER
    FROM   rawmtrl_graph a
           INNER JOIN rawmtrl_graph b
           ON a.dateofmtrl = b.dateofmtrl
           INNER JOIN rawmtrl_graph c
           ON a.dateofmtrl = c.dateofmtrl
    WHERE  to_char(a.dateofmtrl,'yyyy')='2012'
    AND    to_char(b.dateofmtrl,'yyyy')='2012'
    AND    to_char(c.dateofmtrl,'yyyy')='2012'
    AND    a.mtrl_flag='P'
    AND    b.mtrl_flag='D'
    AND    c.mtrl_flag='CS'
    GROUP BY TO_CHAR(a.dateofmtrl,'mon');
    
  • partition in maintained growth index, partition of table didn't need to add space.

    Version Oracle 11 g 1 material, OS is aix.

    We have a 100 to dataware house, are partitioned with the index.

    Each table move data 6 months previously and even with the index. However our table tablespace has not seen more, but index tablespace kept more and more, I have to keep adding spaces.

    How to address this issue? where to find the problem is?

    Thanks in advance.

    >
    I joined dba_segments with dba_objects to get nom_segment, owner, created, bytes/1024/1024 as this tablespace.
    . . .
    EVENT_TYPE_HGRAM_DEV STATS INDEX SUBPARTITION 28-SEP-05 DECEMBER 10 05
    1
    >
    Does not the validation of the application and the columns you listed do not match the data that you have posted.

    EVENT_TYPE_HGRAM_DEV - the name says a statistical histogram on the EVENT_TYPE table in the DEV environment. This object name means something to you?

    Enter you two dates but only "created" as a column. And what is the '1' represent?

    You also do not show an OWNER but mention a column 'owner '.

    Which table is, or has been, this index belong to? The table still exists? Have you purged the recyclebins?

  • Prevent specific users to drop the partition of table

    Hello

    I'm having the following problem: on the CUSTOMERS table, I implemented a policy that prevents specific users to delete records that have REPORT_DATE (it is a DATE column) over 2 months. Works very well.
    These users are actually "login" I identify using sys_context ('USERENV', 'OS_USER').

    However... I realized that these users can fall any partition of this table (the table partitioned BY RANGE) so the policy that I have implemented is unnecessary.

    My question: is it possible to prevent specific users to delete a partition?
    All partitions in the CUSTOMERS table are associated with a REPORT_DATE unique that's why I want to prevent the destruction of the wall that has a REPORT_DATE related more than two months...


    Thank you
    MR. R.

    Hello

    Revoke the privilege of the Oracle user who is connected. (privileges are granted to the and helped by users Oracle, no internal users that you identify well as SYS_CONTEXT.)

    If it is the owner of the schema, and then create a different pattern of all the newspapers-ins, which has only the privileges that these users must have. Modify the application so that it uses this log-in Oracle and not the owner of the table schema.

  • Can we import data from partition to a partition not table table?

    Hello

    I have partition table export dump.i want to import the table into the table to partition not... is it possible?



    Thank you
    Yusuf

    Yes. Just pre-create the table partitions WITHOUT in the system that you want to import. Then start the import operation with ignores = (ignore existing objects). To import the rows in the table, and since it is not defined with partitions there is no partitions.

Maybe you are looking for

  • New macbook air keeps freezing?

    I got this new macbook for almost 3 weeks now, but I'm starting to worry about how it keeps freezing: it first happened a few days ago and still today. I had a lot of windows open whenever (music, videos paused, some research, some word documents) -

  • laptop temperature

    my laptop temperature lights instantly high about 60 to 75 and also consume battery very fast... I'm not use of heavy work as portable games.my is 1 year old... Please tell me what I can do.about 2 or three weeks ago this happan... Please help me as

  • Windows system root 32/hal.dll

    Hi last night I noticed that my computer is slow. I backed up my MYOB and then I disconnected. This morning I tried to turn on the computer and he gave me the following message System32/hal.dll root Windows It is said that one of the programs became

  • Web page on the desktop as thumbnail

    I've seen something like this posted on the support page, but no response was given. I have Windows XP and this problem has been the specific user. Webpage Dislayed on the desktop under the tile. When my wife was signed in somehow a Web page was plac

  • x 4012 MTU for VMware NSX

    Hello I am looking for two 10 GB switches to low price without perfomance high-end to create an environment of demonstration NSX. VMware NSX has only one requirement difficult and an option for the integration complete. A 10 GB of Dell switch x 4012