Count for every partition

Hi,
How can I get the count for every partition. I want:
partition_name count(*)
The table is daily partitioned by a date column.
Ex:
ALTER TABLE 'tableName' ADD PARTITION 'tableName||today' VALUES LESS THAN (TO_DATE('tommorow','DD-MM-YYYY'))'
Regards,
Gicu

Hallo,
if you analyze your table regularily and you want to know
only approximate count of rows you can use :
select partition_name, num_rows from dba_tab_partitions
where table_name = 'TBL_TEST'Else , dynamic SQL:
declare
v_partition VARCHAR2(30);
v_count NUMBEr;
begin
FOR x IN (select table_owner, partition_name from dba_tab_partitions
        WHERE table_name = 'TBL_TEST')
LOOP       
    execute immediate 'SELECT '''||x.partition_name||''', count(*) from '||x.table_owner||'.TBL_TEST PARTITION ("'||x.partition_name||'")'
                       INTO v_partition, v_count ;
    dbms_output.put_line('Partition '||v_partition||' count '||v_count);                  
END LOOP;                      
end;     Regards
Dmytro Dekhtyaryuk

Similar Messages

  • How to get the count for every 30 mins

    Hi,
    Following is the table format:
    Time ******************** logged in users
    9/5/2006 8:38:22 PM**** 2
    9/5/2006 8:38:44 PM**** 4
    9/5/2006 8:40:22 PM**** 1
    9/5/2006 8:41:22 PM**** 3
    9/5/2006 8:52:22 PM**** 6
    9/5/2006 9:02:22 PM**** 5
    9/5/2006 9:04:24 PM**** 3
    9/5/2006 9:08:26 PM**** 4
    9/5/2006 9:10:28 PM**** 6
    What I need is number of users logged in for every 30 min
    like 9/5/2006 9:00:00(8:30 to 9:00) is 16
    9/5/2006 9:30:00(9:00 to 9:30) is 18
    Can any one help me in this regard?
    -Raj

    The trick is to group your times to every 30 min.
    Unfortunatly there is no way to TRUNC(30 min).
    But you can build this function yourself using some mathematical logic and trunc to build the groups.
    Look at this code piece:
    select trunc(sysdate) + trunc((sysdate - trunc(sysdate))*24*2)/24/2
    from dualInstead of sysdate use your date column and group by the expression.
    Added example using Dave's test data
    WITH t AS
            SELECT TO_DATE ('9/5/2006 8:38:22 PM', 'fmdd/mm/yyyy hh:mi:ss pm') tm,
                   2 num
              FROM DUAL
            UNION
            SELECT TO_DATE ('9/5/2006 8:38:44 PM', 'fmdd/mm/yyyy hh:mi:ss pm') tm,
                   4 num
              FROM DUAL
            UNION
            SELECT TO_DATE ('9/5/2006 8:40:22 PM', 'fmdd/mm/yyyy hh:mi:ss pm') tm,
                   1 num
              FROM DUAL
            UNION
            SELECT TO_DATE ('9/5/2006 8:41:22 PM', 'fmdd/mm/yyyy hh:mi:ss pm') tm,
                   3 num
              FROM DUAL
            UNION
            SELECT TO_DATE ('9/5/2006 8:52:22 PM', 'fmdd/mm/yyyy hh:mi:ss pm') tm,
                   6 num
              FROM DUAL
            UNION
            SELECT TO_DATE ('9/5/2006 9:02:22 PM', 'fmdd/mm/yyyy hh:mi:ss pm') tm,
                   5 num
              FROM DUAL
            UNION
            SELECT TO_DATE ('9/5/2006 9:04:24 PM', 'fmdd/mm/yyyy hh:mi:ss pm') tm,
                   3 num
              FROM DUAL
            UNION
            SELECT TO_DATE ('9/5/2006 9:08:26 PM', 'fmdd/mm/yyyy hh:mi:ss pm') tm,
                   4 num
              FROM DUAL
            UNION
            SELECT TO_DATE ('9/5/2006 9:10:28 PM', 'fmdd/mm/yyyy hh:mi:ss pm') tm,
                   6 num
              FROM DUAL)
    SELECT   SUM (num), trunc(tm) + trunc((tm - trunc(tm))*24*2)/24/2 halfhours
        FROM t
    GROUP BY trunc(tm) + trunc((tm - trunc(tm))*24*2)/24/2;
    Row#     SUM(NUM)     HALFHOURS
    1     16     09.05.2006 20:30:00
    2     18     09.05.2006 21:00:00Message was edited by:
    Sven Weller

  • Display Siebel Pop up box with Service Request count for every 1 hr

    Hi
    For our client business, we need to achieve the below functionality. Please suggest me the best method to implement.
    1. When the user logged into the application, it should pop up a box by displaying the No# of SR in "New" Status that are assigned to the user who logged in.
    2. The pop up box should update it self every 1hr from the time of login and should not require seperate query or refresh.
    I have done some initial analysis by using browser script and some recursive functions like(setTimeout).
    Thanks,
    Sridhar

    Issue has been resolved.  There was no interesting work-a-round or fix involved.

  • Increment the Counter for every IDOC created

    Hello Friends,
    I have a scenario where in I will be getting an XML file which will create multiple Idoc's,
    say for example :
    Source -> Debmas06 Idoc and the same file also creates Link and ADRMAS idocs.
    here i have a field called Sequence number in all the IDoc structures. and now my requirement is when ever a file creates 2 Idocs say the 1st one Debmas and 2nd the Link Idoc. then the sequence number in Debmas idoc should be "1" and the sequence number in Link idoc should be "2".
    How can i do this? Please help!!!!!
    Regards,
    Kumar

    Hi ,
    Source -> Debmas06 Idoc and the same file also creates Link and ADRMAS idocs.
    Which method are you following to create Link & Adrmas IDocs ? I mean using BPM .. Multi Mapping.. ??
    Regards,
    Sumit

  • Counter in mapping for every succesfull message....

    Counter to be maintained for every execution of map.Requirement is to generate sequence number which should be like counter.Whenever this map runs and file is created, sequnece numberhas to be generated and it should be appended accordingly when it runs for second time.Like on a particular day, if this interface runs once, counter should be populated as once and next time when it runs it should be incremented to 2

    wat I understood is
    first time ur mapping is run the counter value is set to 1 and is mapped to target.
    second time the same mapping is run counter shud be incremented by one and mapped to target field.
    this is wat u r looking for.
    if yes:
    what u can do is u can maintain one table which shud hold the interface no and count no.
    first time when mapping runs the table will be updated with count value one. when the mapping run second time the counter value will be incremented n it will update the data in that table.
    u have to use the lookup.
    chirag

  • Write a procedure to check the count is less than 1300 for every 3 hours

    Good Morning all,
    I want to write a procedure to check the count is less than 1300 for every 3 hours
    Query:*
    Select count(*) from sample where trx_date=sysdate;
    I want to run this query every 3 hours daily
    If the count is less than 1300 every 3 hours, we should sent a reminder mail like 'Data not copy'.
    Please help me how to write a procedure.

    hi there
    first
    --define the SMTP_OUT_SERVER parameter in your init.ora initialization file
    --ALTER SYSTEM SET smtp_out_server='my.domain.com' SCOPE=SPFILE;
    after that create a procedure
    CREATE OR REPLACE procedure SCOTT.hrsmail
    is
    v_count number;
    begin
    Select count(*)  into v_count from emp;
    if v_count < 1300
    then
      UTL_MAIL.send(sender    => '[email protected]',
                      recipients => '[email protected]',
                      cc         => '[email protected]',
                      bcc        => '[email protected]',
                      subject    => 'Testing the UTL_MAIL Package',
                      message    => 'If you get this, UTL_MAIL package
    else
    null;   --what you want to do here
    end if ;
    end;
    /we should create a job which run after every 3 hrs and send a reminder mail like 'Data not copy'.
    BEGIN
      SYS.DBMS_JOB.REMOVE(373);
    COMMIT;
    END;
    DECLARE
      X NUMBER;
    BEGIN
      SYS.DBMS_JOB.SUBMIT
      ( job       => X
       ,what      => 'begin hrsmail; end;'
       ,next_date => to_date('14/02/2011 18:39:29','dd/mm/yyyy hh24:mi:ss')
       ,interval  => 'SYSDATE+3/24 '
       ,no_parse  => FALSE
      SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
    COMMIT;
    END;
    /hope this will help you
    Regards
    Hitesh
    Edited by: Hitesh Nirkhey on Feb 14, 2011 3:34 PM

  • Pulse out for every Nth pulse in using 6024E counter?

    Is it possible to get (continuously)a pulse out of the 6024E counters for every Nth pulse of an external signal going to the source pin? A VI and the description of the connections will be appreciated.appreciated
    Scientia est potentia!

    Hi magvar,
    Depending on your application development environment (ADE) API (LabVIEW, CVI, VC++ etc.) you will want to configure the counter for continuous pulse generation. There are two pulse specs that you have to configue. The first configures the delay in number of edges of your source and the second configures the width of your pulse. Therefore if you set pulse spec (ND_COUNT in C code) 'A' to N/2 and pulse spec 'B' to N/2 then your pulse train will output a pulse every Nth pulse on the source.
    Each ADE will have a shipping example that demonstrates this configuration. These examples ship with NI-DAQ and can be found in the NI-DAQ folder of National Instruments unless it is LabVIEW or CVI in which case it should be in their respective direc
    tories. Hope that helps. Have a good day.
    Ron
    Attachments:
    TIOgenSquareWave.C ‏6 KB

  • Blank rows for every combination

    I've got a dimension with this hierarchy of levels A | B | C where all of them are a detail of the previous one.
    When I look into the dimension table I get:
    A1
    A2
    A1 B1
    A1 B2
    A1 B1 C1
    A1 B1 C2
    etc.
    If, in Oracle Answers, I pick up attributes from B and C in the same report, then a record is showed for every combination of B and C with blank attributes for C.
    Table B
    B1
    B2
    Table C
    C1
    C2
    C3
    The output in Oracle Answers is:
    B1 C1
    B1 Null
    B1 C2
    B1 Null
    B1 C3
    B1 Null
    and so on ...
    Every row of table B is combined with a row of C and another one with all of its atributtes null.
    Any hint?

    Nihar
    To get the first two rows from each group, you could do this:
    Use the ROW_NUMBER() analytic function (see http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions137.htm#i86310)
    Now, your question isn't clear what you mean by "last" two rows. Last in what order? Whatever it is, you can use the ORDER BY part of the ROW_NUMBER() function to specify the ordering, and reverse it using DESC - for example:
    select acn, adate, cost, appl from (
        select acn, adate, cost, appl,
                  row_number() over (partition by acn order by adate desc) as rn
        from  acntab
    where rn <= 2
    order by acn, rnHTH
    Regards Nigel

  • How can I display summary for every 15 minutes using DATE datatype

    This is probably an easy question, but the answer eludes me...
    I am trying to write a SQL report that displays aggregate totals for every 15 minute period. I know you can do something like this to get every minute:
    select to_char(import_date,'MM-DD-YYYY HH24:MI'),
    count(*) from
    package_ingest
    group by to_char(import_date,'MM-DD-YYYY HH24:MI')
    But how can I change this query so that I get every 15 minutes?
    Any feedback is greatly apprecaited!
    Thanks,
    -ADK

    Hi,
    GROUP BY  TRUNC (SYSDATE) + FLOOR ( (import_date - TRUNC (SYSDATE))
                                          * 24
                            * 4
                            )SYSDATE is an arbitrary reference point. It doesn't matter if import_date is earlier or later (or sometimes earlier and sometimes later).
    If you want to display this in the SELECT clause, or use it in the ORDER BY clause, then repeat the expression there, or compute it once in a sub-query.
    WITH  got_i_d_15     AS
         SELECT     TRUNC (SYSDATE) + FLOOR ( (import_date - TRUNC (SYSDATE))
                                               * 24
                                 * 4
                                 ) AS i_d_15
         FROM     package_ingest
    --     WHERE     ...          -- If needed
    SELECT       TO_CHAR (i_d_15, 'MM-DD-YYYY HH24:MI')     AS import_date
    ,       COUNT (*)                               AS cnt
    FROM       got_i_d_15
    GROUP BY  i_d_15
    ORDER BY  i_d_15;

  • How to get total number of result count for particular key on cluster

    Hi-
    My application requirement is client side require only limited number of data for 'Search Key' form total records found in cluster. Also i need 'total number of result count' for that key present on the custer.
    To get subset of record i'm using IndexAwarefilter and returning only limited set each individual node. though i get total number of records present on the individual node, it is not possible to return this count to client form IndexAwarefilter (filter return only Binary set).
    Is there anyway i can get this number (total result size) on client side without returning whole chunk of data?
    Thanks in advance.
    Prashant

    user11100190 wrote:
    Hi,
    Thanks for suggesting a soultion, it works well.
    But apart from the count (cardinality), the client also expects the actual results. In this case, it seems that the filter will be executed twice (once for counting, then once again for generating actual resultset)
    Actually, we need to perform the paging. In order to achieve paging in efficient manner we need that filter returns only the PAGESIZE records and it also returns the total 'count' that meets the criteria.
    If you want to do paging, you can use the LimitFilter class.
    If you want to have paging AND total number of results, then at the moment you have to use two passes if you want to use out-of-the-box features because LimitFilter does not return the total number of results (which by the way may change between two page retrieval).
    What we currently do is, the filter puts the total count in a static variable and but returns only the first N records. The aggregator then clubs these info into a single list and returns to the client. (The List returned by aggregator contains a special entry representing the count).
    This is not really a good idea because if you have more than one user doing this operation then you will have problems storing more than one values in a single static variable and you used a cache service with a thread-pool (thread-count set to larger than one).
    We assume that the aggregator will execute immediately after the filter on the same node, this way aggregator will always read the count set by the filter.
    You can't assume this if you have multiple client threads doing the same kind of filtering operation and you have a thread-pool configured for the cache service.
    Please tell us if our approach will always work, and whether it will be efficient as compared to using Count class which requires executing filter twice.
    No it won't if you used a thread-pool. Also, it might happen that Coherence will execute the filtering and the aggregation from the same client thread multiple times on the same node if some partitions were newly moved to the node which already executed the filtering+aggregation once. I don't know anything which would even prevent this being executed on a separate thread concurrently.
    The following solution may be working, but I can't fully recommend it as it may leak memory depending on how exactly the filtering and aggregation is implemented (if it is possible that a filtering pass is done but the corresponding aggregation is not executed on the node because of some partitions moved away).
    At sending the cache.aggregate(Filter, EntryAggregator) call you should specify a unique key for each such filtering operation to both the filter and the aggregator.
    On the storage node you should have a static HashMap.
    The filter should do the following two steps while being synchronized on the HashMap.
    1. Ensure that a ConcurrentLinkedQueue object exists in a HashMap keyed by that unique key, and
    2. Enqueue the total number count you want to pass to the aggregator into that queue.
    The parallel aggregator should do the following two steps while being synchronized on the HashMap.
    1. Dequeue a single element from the queue, and return it as a partial total count.
    2. If the queue is now empty, then remove it from the HashMap.
    The parallel aggregator should return the popped number as a partial total count as part of the partial result.
    The client side of the parallel aware aggregator should sum the total counts in the partial result.
    Since the enqueueing and dequeueing may be interleaved from multiple threads, it may be possible that the partial total count returned in a result does not correspond to the data in the partial result, so you should not base anything on that assumption.
    Once again, that approach may leak memory based on how Coherence is internally implemented, so I can't recommend this approach but it may work.
    Another thought is that since returning entire cached values from an aggregation is more expensive than filtering (you have to deserialize and reserialize objects), you may still be better off by running a separate count and filter pass from the client, since for that you may not need to deserialize entries at all, so the cost on the server may be lower.
    Best regards,
    Robert

  • 1st gen ipod Shuffle not updating play count for songs

    I've noticed since I updated to the iTunes version 7.2.035 that plugging in and updating the library with my iPod shuffle no longer updates the play count for the songs I've listened to. Is there a known fix for this? Anyone else experiencing the same problem with their 1st gen ipod shuffle (512)?

    Well, I have that problem too. My shuffle holds about 125 songs or so, yet I've noticed there are always a good 20 or so songs that won't play, no matter how many times I load them onto the device. I have had that problem since I inherited it from a friend.
    My new problem is that every time I plug my iPod into iTunes, it no longer updates the playcount for songs. In other words, if I load a song that I've heard 3 times, hear it twice during the day, and replug in my iPod at night, it used to update that song's playcount in the library to 5, but now they still read 3. It's also failing to update the "date last played" field.
    I use those to help make sure that I don't load the same songs over and over again by creating a custom playlist that will comb out songs played in the last few days and have a very high play count. Since these are no longer updating, I've noticed that I keep arriving at work only to find my iPod has the same or similar songs as the day before, and dude, if I wanted that, I'd listen to the radio!

  • How to increment counter for line items.

    Hi,
    Please see the code below:
    LOOP AT T_MAT INTO W_MAT.
              perform bdc_dynpro      using 'SAPMM07M' '0421'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'MSEG-ERFMG(i)'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '/00'.
              perform bdc_field       using 'MSEG-MATNR(i)'
                                            W_MAT-MATNR.
              perform bdc_field       using 'MSEG-ERFMG(i)'
                                            W_MAT-ERFMG.
              i = i+1.
          ENDLOOP.
    In the above code I'm updating the line items thru BDC. Here I'm having a counter ' i '. I'm incrementing it for every loop cycle. When I run the BDC I get the error "Field MSEG-ERFMG does not exist in the screen"
    Please help.
    regards,
    Sriram

    Hi Sriram,
    you code as to be changed slightly:
    DATA l_counter(2) TYPE n.
    DATA l_fieldname  TYPE string.
    loop at t_mat into w_mat.
      MOVE i TO counter.
      CONCATENATE 'MSEG-ERFMG('  counter  ')'  INTO l_fieldname.
      PERFORM bdc_field USING 'BDC_CURSOR'
                              l_fieldname.
      i = i+1.
    ENDLOOP.data l_counter(2) type n.
    Regards
    REA
    Edited by: Ramy EL-ARNAOUTY on Jul 28, 2009 10:29 AM

  • A new file creating in 'C' drive automatically for every 3 minutes in Windows 2003 SBS

    Hi
    The files are in this format with 32bit count {00000000-0000-0000-0000-00000000000} and all are the same with different file names and they are encrypted.
    Please let me know why they are creating for every 3 minutes & what is the purpose of these files and if we delete will it be a problem.
    Few files names {408F187E-8B9B-47AC-BAF8-05D034003937}
    {AF3DD6DB-6645-4A33-B51B-84F0BF376C3B}
    {7531B20D-88CE-4A93-A08D-FD2AA3A0F4D8}
    Thanks

    Hi Hemanth.D,
    Before going further, would you please let me know the file type of those files which created automatically?
    Meanwhile, please let me know the detailed path of those files in C drive.
    In addition, did you install any third-party application (may run periodically) on the SBS server recently?
    If possible, please perform a clean boot and check if this issue still exists. Please open Event Viewer and check if relevant events were logged.
    If any update, please feel free to let me know.
    Best regards,
    Justin Gu

  • Average Maximum Cycle Count for Early 2008 MacBook (Black)

    I have a black early 2008 MacBook that now in its fourth year, and I have noticed that battery health have started to diminish.
    I am wondering what is the maximum battery cycle count for the early 2008 black MacBooks, and if its time to replace it? (I have 250 cycle count, with 78% health remaining)

    You can get a new third party battery fairly cheap on eBay. Every MacBook from 2006 through Mid 2009 except the Late 2008 Aluminum Unibody and the Late 2009 and 2010 White Unibodies use the same A1185 battery.
    Black Batteries http://shop.ebay.com/i.html?_nkw=macbook+black+battery&_sacat=0&LH_BIN=1&_sop=12 &_dmpt=Laptop_Batteries&_odkw=macbook+white+battery&_osacat=0&_trksid=p3286.c0. m 270.l1313
    White Batteries http://shop.ebay.com/i.html?_nkw=macbook+white+battery&_sacat=0&LH_BIN=1&_sop=12 &_dmpt=Laptop_Batteries&_odkw=macbook+black+battery&_osacat=0&_trksid=p3286.c0. m 270.l1313
    Or for $129 from The Apple Store  http://store.apple.com/us/product/MA566LL/A?mco=MTY3ODQ5OTY

  • All rows in table do not qualify for specified partition

    SQL> Alter Table ABC
    2 Exchange Partition P1 With Table XYZ;
    Table altered.
    SQL> Alter Table ABC
    2 Exchange Partition P2 With Table XYZ;
    Exchange Partition P2 With Table XYZ
    ERROR at line 2:
    ORA-14099: all rows in table do not qualify for specified partition
    The exchange partition works correct for the first time. However if we try to exchange 2nd partition it gives the error.
    How do i solve this error?
    How do i find rows which are not qualified for the specified portion. is there a query to find out the same?

    stephen.b.fernandes wrote:
    Is there another way?First of all, exchange is physical operation. It is not possible to append exchanged data. So solution would be to create archive table as partitioned and use non-partitioned intermediate table for exchange:
    SQL> create table FLX_TIME1
      2  (
      3  ACCOUNT_CODE VARCHAR2(50) not null,
      4  POSTING_DATE DATE not null
      5  ) partition by range(POSTING_DATE) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
      6  ( partition day0 values less than (TO_DATE('01-12-2012', 'DD-MM-YYYY') ) )
      7  /
    Table created.
    SQL> create index FLX_TIME1_N1 on FLX_TIME1 (POSTING_DATE)
      2  /
    Index created.
    SQL> create table FLX_TIME1_ARCHIVE
      2  (
      3  ACCOUNT_CODE VARCHAR2(50) not null,
      4  POSTING_DATE DATE not null
      5  ) partition by range(POSTING_DATE) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
      6  ( partition day0 values less than (TO_DATE('01-12-2012', 'DD-MM-YYYY') ) )
      7  /
    Table created.
    SQL> create table FLX_TIME2
      2  (
      3  ACCOUNT_CODE VARCHAR2(50) not null,
      4  POSTING_DATE DATE not null
      5  )
      6  /
    Table created.
    SQL> Declare
      2  days Number;
      3  Begin
      4  FOR days IN 1..50
      5  Loop
      6  insert into FLX_TIME1 values (days,sysdate+days);
      7  End Loop;
      8  commit;
      9  END;
    10  /
    PL/SQL procedure successfully completed.
    SQL> set linesize 132
    SQL> select partition_name,high_value from user_tab_partitions where table_name='FLX_TIME1';
    PARTITION_NAME                 HIGH_VALUE
    DAY0                           TO_DATE(' 2012-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
    SYS_P119                       TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
    SYS_P120                       TO_DATE(' 2013-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
    Now we need to echange partition SYS_P119 to FLX_TIME2 and then echange FLX_TIME2 into FLX_TIME1_ARCHIVE:
    To exchange it with FLX_TIME2:
    SQL> truncate table FLX_TIME2;
    Table truncated.
    SQL> alter table FLX_TIME1 exchange partition SYS_P119 with table FLX_TIME2;
    Table altered.To exchange FLX_TIME2 with FLX_TIME1_ARCHIVE we need to create corresponding partition in FLX_TIME1_ARCHIVE. To do than we use LOCK TABLE PARTITION FOR syntax supplying proper date value HIGH_VALUE - 1 (partition partitioning column is less than HIGH_VALUE so we subtract 1) and then use ALTER TABLE EXCHANGE PARTITION FOR syntax:
    SQL> lock table FLX_TIME1_ARCHIVE
      2    partition for(TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
      3    in share mode;
    Table(s) Locked.
    SQL> alter table FLX_TIME1_ARCHIVE exchange partition
      2    for(TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
      3    with table FLX_TIME2;
    Table altered.
    SQL> Same way we exchange partition SYS_P120:
    SQL> truncate table FLX_TIME2;
    Table truncated.
    SQL> alter table FLX_TIME1 exchange partition SYS_P120 with table FLX_TIME2;
    Table altered.
    SQL> lock table FLX_TIME1_ARCHIVE
      2    partition for(TO_DATE(' 2013-01-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
      3    in share mode;
    Table(s) Locked.
    SQL> alter table FLX_TIME1_ARCHIVE exchange partition
      2    for(TO_DATE(' 2013-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
      3    with table FLX_TIME2;
    Table altered.
    SQL> Now:
    SQL> select  count(*)
      2    from  FLX_TIME1 partition(day0)
      3  /
      COUNT(*)
             8
    SQL> select  count(*)
      2    from  FLX_TIME1 partition(sys_p119)
      3  /
      COUNT(*)
             0
    SQL> select  count(*)
      2    from  FLX_TIME1 partition(sys_p120)
      3  /
      COUNT(*)
             0
    SQL> select partition_name from user_tab_partitions where table_name='FLX_TIME1_ARCHIVE';
    PARTITION_NAME
    DAY0
    SYS_P121
    SYS_P122
    SQL> select  count(*)
      2    from  FLX_TIME1_ARCHIVE partition(day0)
      3  /
      COUNT(*)
             0
    SQL> select  count(*)
      2    from  FLX_TIME1_ARCHIVE partition(sys_p121)
      3  /
      COUNT(*)
            31
    SQL> select  count(*)
      2    from  FLX_TIME1_ARCHIVE partition(sys_p122)
      3  /
      COUNT(*)
            11
    SQL> SY.

Maybe you are looking for