Partitioning (range) a table values less than 'A'

i am referring
http://docs.oracle.com/cd/B10501_01/server.920/a96524/c12parti.htm
http://docs.oracle.com/cd/B19306_01/server.102/b14220/partconc.htm
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
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
create table drop_it as select * from mv_prod_search_det2;     
CREATE TABLE DROP_IT_P(
PROD_DETAILS VARCHAR2(1000 BYTE),
     SIGN VARCHAR2(42 BYTE)
PARTITION BY RANGE(PROD_DETAILS)
PARTITION MAX_VALUE VALUES LESS THAN (MAXVALUE)
update drop_it set prod_details=upper(prod_details);     
72000 rows updated
ALTER TABLE drop_it_p EXCHANGE PARTITION MAX_VALUE WITH TABLE drop_it WITH VALIDATION;     
select * from mv_prod_search_det2
72000 rows selected
exec dbms_stats.gather_database_stats;
select * from drop_it_p partition(max_value)
ALTER TABLE DROP_IT_P
  SPLIT PARTITION MAX_VALUE AT ('B%')
  INTO (PARTITION p_a,
        PARTITION MAX_VALUE);     
select * from drop_it_p partition(p_a);
6785 rows selected
select * from drop_it_p partition(p_a) where prod_details not like 'A%'     
696 rows selectedit even shows me values that start with W,V,I,1,2,3,4,24,5 etc
although the number is less(696out of 6785) this is undesired
please help me eliminate these rows
thank you
this thread is related to tuning regexp_like by author 946207
please refer
tuning regexp_like
and partitioning a table by 946207
Edited by: 946207 on Dec 2, 2012 1:52 AM
Edited by: 946207 on Dec 2, 2012 11:02 PM

First, when you post related threads you should cross-link them so people have access to all of the information about the problem you are trying to work with.
partitioning a table
>
it even shows me values that start with W,V,I,1,2,3,4,24,5 etc
although the number is less(696out of 6785) this is undesired
>
Yes - that is what it should be doing.
These are the steps you took to populate the table
1. You originally inserted ALL data into table 'drop_it' with no restriction on the PROD_DETAILS values.
create table drop_it as select * from mv_prod_search_det2;     2. Then you converted the PROD_DETAILS value to upper case. That has no effect on numbers or other non-alphabetic characters.
update drop_it set prod_details=upper(prod_details);3. Then you create a new table with only one partition using MAXVALUe
PROD_DETAILS VARCHAR2(1000 BYTE),
     SIGN VARCHAR2(42 BYTE)
PARTITION BY RANGE(PROD_DETAILS)
PARTITION MAX_VALUE VALUES LESS THAN (MAXVALUE)
);4. Then you populate the partitioned table by exchange. It now has the same data including the numeric data.
ALTER TABLE drop_it_p EXCHANGE PARTITION MAX_VALUE WITH TABLE drop_it WITH VALIDATION;     5. Then you split the one MAXVALUE partition into two partitions. One with data < 'B%' and one with the remaining data that sorts higher based on your character set.
ALTER TABLE DROP_IT_P
  SPLIT PARTITION MAX_VALUE AT ('B%')
  INTO (PARTITION p_a,
        PARTITION MAX_VALUE);     The split on 'B%' when creating partition p_a is equivalent to you 'WITH VALUES < 'B%'. Since PROD_DETAILS is a VARCHAR2 datatype that 'LESS THAN' comparison uses the character order based on your database character set and most, if not all, character sets have characters that sort lower than the uppercase alphabetic characters.
For example in the ASCII character set an uppercase 'A' is decimal 65 so 64 other characters (including the digitis 0-9) sort lower than 'A'.
http://www.asciitable.com/
As the doc you cited shows
>
•All partitions, except the first, have an implicit lower bound specified by the VALUES LESS THAN clause on the previous partition.
>
That 'first' partition has no lower bound so ALL data, including digits, that sort less than 'B%' will be in that partition.
>
please help me eliminate these rows
>
Either don't select the data to begin with or remove it using a simple DELETE query. Also you can do the case conversion when you select the data.
create table drop_it as select upper(prod_details) prod_details, sign from mv_prod_search_det2 where upper(prod_details >= 'A';Before you do that you should make sure you define the actual business rule you want to use to define the data you really want to keep and exclude.
Because most, if not all, character sets also have characters that sort HIGHER than the alphabetic characters. That ASCII table shows five of them. If you don't filter them out you will get data where the values start with those characters.
Even if you do filter them out there is nothing in what you posted that would prevent a user from inserting that data back into the table.
And, of course, there are characters that sort BETWEEN the lower and upper case alphabetics.
You need to determine what the allowable characters are in the PROD_DETAILS column and add code (e.g. check constraint or trigger) to make sure users can't enter data that includes those characters.

Similar Messages

  • 1.5 Edit Table Partitions - Can not edit Values Less than Field

    When editing (or more importantly to me) creating new partitions through the GUI. This slao was an issue w/1.2.1 that I recently discovered, I was hoping that it would have gotten fixed in 1.5

    Just to confirm this is only a problem when editing a table? It seems fine when creating a table from scratch.
    The field is disabled when editing an existing partition because there isn't (as far as I can tell) an ALTER TABLE clause for changing the less than value of a range partition.
    It's a bug that when you create a new partition, while editing a table, the field is still disabled. I'll log it now.

  • Store value less than current week and year.

    Hi All,
    I have a table called BACKLOG whose structure is like this
    ITEM_NUMBER   YEAR_WEEK   MS
    1N58          2012-WK02   01/15/2012
    1N58          2011-WK02   01/15/2011current from my procedure i am storing the value in my new table which is less than current week. But i want to store the value less than current week and current year. Please help me to get how i can do this.
    PROCEDURE BACKLOG_PROC_LT_CW IS
      BEGIN
    DELETE BACKLOG_LT_CW;
    COMMIT;
          INSERT INTO BACKLOG_LT_CW
            SELECT
                  DC_UTIL.GEN_YEAR_WEEK(MS) YEAR_WEEK,
                  ITEM_NUMBER,
                  MSD
                  FROM BACKLOG
              where to_char(MS, 'IW')<to_char(sysdate, 'IW');
      END BACKLOG_PROC_LT_CW;Currently with the above procedure code both the value is storing in my BACKLOG_LT_CW table but if you see the data of BACKLOG table you will find YEAR_WEEk 2012-WK02 falls in next year but still it is storing in my table because i have taken IW only. Please help me to get the soln
    Thanks in advance
    Regards

    Are you looking for this?
    where to_char(MS, 'YYYYIW')<to_char(sysdate, 'YYYYIW');

  • Condition for excluding Sales value less than or equal to 0

    Hello Experts,
    I have to create condition in the query designer to exclude Sales Value <=0, and that should be applied to all the column values and result values when we put active.
    Can anyone help ?
    Thanks in advance,
    Venky
    Duplicate Post
    Condition for excluding Sales value less than or equal to 0
    Edited by: Arun Varadarajan on Apr 13, 2010 8:57 PM

    Hello Naveen,
    Thanks for quick reply. I have created condition greater than zero and executed report, i can able to eliminate rows with sales value <=0, but we have other columns in the report say Quantity, Backlog... when we run the report without condition the values which showed are same when we put it in active aslo.
    After eliminating few rows which having some quantity value, that value should be deducted from the result of the quantity. I tried with applying apply to results opton, then also there is no change in the result value of the quantity.
    Our requirement is to apply condition to eliminate rows which are sales value <=0 and same the result values of the columns should effect.
    Is it possible in anyway, if yes please specify solution.
    Thanks,
    Venky

  • Range of Coverage with less than a day

    Hi PP Gurus
    Kindly suggest if anyone of you had this issue and how it is handled? Is there any OSS related to this.
    The coverage profile field in the MRP-2 view of Material Master is based on Min, Target and Max coverages defined in days.
    This is leading business to maintain more inventory than needed which does not serve any purpose by using the dynamic safety stock.
    What business needs is the Min, Target and Max coverages are all to be defined in terms of less than a day. So that inventories are maintained at the optimal level.
    SAP has come up with safety time period profile with option of safety time less than a day. The way it works is based on time not by quantity. It simply moves the planning of the material by the amount
    of time specified.
    Other than this do we have any OSS which can fix this issue.
    To use the repetetive mfg planning table and to see the target stock, coverage profiles need to be defined for all materials. This target stock is needed for business to make a decision on how much quantity to run the production for each SKU.
    Can anyone suggest how can we proceed on this.
    I hope I am clear in presenting my issue.
    Thanks
    Sunil

    Thank you Mario,
    I have already tested with safety time period profile; but the way it works is it moves the ordering dates ahead by the amount of time we define in safety time and safety time % fields in the period profile.
    Also with this set up when we come to planning table(MF50) we cannot see the target stock. For these materials the system calculates the actual range of coverage but not target stock.
    In our business scenario; we need target stock value in deciding on the production quantity.
    Regarding MRP resolution - did you mean we can run MRP only once in a day?
    Regards
    Sunil

  • Asset Value less than 5%

    Dear All,
    we want the list of all assets whose value is less than or equal to 5% in the respective fiscal year,so that we can scrap those assets.
    Is there any SAP Stand report/program available for our requirement,if so suggest.
    If not,suggest any other work around like Query,Report Painter,etc  with details steps("Z" report,my client is not interested).
    Do revert
    Regards,

    .Hi,
    Easier way is to execute the report S_ALR_87011963, download the data into excel and filter less than 5 or 10 percent value assets thru a formula.
    Another option available is to use an additional field for computing NBV and call that field in the query.
    Net Book Value = KANSW + KNAFA + NAFAG
    Best Regards,
    Madhu
    Edited by: Madhusoodanan Ramachandran on Apr 30, 2010 3:31 PM

  • Net value less than COGS

    Hi Gurus
    Please let me know, if there is anyway apart from using an exit, where we can get an alert if the net value of the order is less than the VPRS
    Anurag

    Dear Friend
    This can be achieved in standard itself
    For VPRS condition type maintain subtotal as B and requirement 4 and alternate calculation type as 5 in your pricing procedure and with these settings if nett value is less than VPRS then a warning message will come and even if you save it will tell that that the document is incomplete and you may not be able to create the delivery etc
    This should satisfy your requirement
    If you look at the standard pricing procedure RVAA01 in that VPRS comes with subtotal as B and requirement 4 and we have to add alternate calculation type as 5 to get our requirement in that
    Regards
    Raja

  • Set the values less than the value prompted

    Hi Every one,
    I have a requirement where the report will be navigating to other report.
    example: I have a report A and when I click on the any value in date column it navigate to other report by filtering the data by the date we clicked to navigate.
    Here my question is, it is filtering the navigated report by the date we selected. but I want it filter the dates equal to or less than the date we selected
    like if I click on date 11/7/2011 it should navigate to the report B and in report B the data should show data for the dates equal to or less than 11/7/2011
    is there any way to set this. because i can see only is prompted that we set for this requirement.
    Thanks in Advance.
    Edited by: 861096 on Nov 11, 2011 9:01 AM

    Hi ,
    While creating the prompt give the presentation varible.
    So when you will select the value for the Report A say ex :11/7/2011 it will be catched by the presentation variable.
    In your second report use this presentation variable as a filter condition where date < = presentation variable.
    It will work for you .
    Thanks,
    Ananth

  • How to get value less than 0 = 0

    I am trying to get a formula to do two operation in one field something like:
    form1.#subform[0].yes1.qn1::calculate - (JavaScript, client)
    (p1-s1)
    then if the value is less than "0" the the value = "0"
    what I have so far is not working, any help is greatly appreciated.
    if
    (this.rawValue < 0) this.rawValue
    = 0;
    Thank you.

    Srini,
    Thanks for the reply, although I still cannot get this to work.
    I changed the fields to numeric and it still is not working.

  • Change font colour to red if value less than zero

    Please forgive as I am not sure if this should go to the SQL or Application Thread..
    My questions is regarding SQL in Application Express
    I want to display my field (ADJ (INCL GST) in a red colour if its value is less than zero
    here is SQL code
    select "TW_BILL_ADJ_DATA"."CUSTOMER" as "CUSTOMER",
    "TW_BILL_ADJ_DATA"."ORIGINATER" as "ORIGINATOR",
    CASE WHEN (CREDITDEBIT) = 'Credit' THEN (0 - ADJUSTMENT_INCL_GST) ELSE ADJUSTMENT_INCL_GST END "ADJ (INCL GST)"
    from TW_BILL_ADJ_DATA

    Thankyou for the example above, after much searching I have also found another way to perform the same task
    select     "BILL_DATA"."BILLING_CODE",
    CASE WHEN (CREDITDEBIT) = 'Credit' then
              '<span style="color:Red;">'
              || TO_CHAR (0 - "ADJUSTMENT_INCL_GST", 'FML999G999G999G999G990D00')|| '</span>'
                             else
              '<span style="color:Green;">'
              || TO_CHAR ( "ADJUSTMENT_INCL_GST", 'FML999G999G999G999G990D00')|| '</span>'
                             end "Adj (incl GST)"
    from TW_TABLE
    -----------------------------------------------------------------------------------

  • Why my ipad connection wifi range very short? (Less than 1meter)

    May i know why my Ipad 4th the range of wifi connection very short? (Less than 1meter) I need to put my ipad with modem together, i just can connect the wifi... I have trying in other network and try using my phone hotspot, the problem cannot soft... Please assists...

    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are drooping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    6. Potential Quick Fixes When Your iPad Won’t Connect to Your Wifi Network
    http://ipadinsight.com/ipad-tips-tricks/potential-quick-fixes-when-your-ipad-won t-connect-to-your-wifi-network/
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    Fix WiFi Issue for iOS 7
    http://ipadnerds.com/fix-wifi-issue-ios-7/
    iOS 6 Wifi Problems/Fixes
    Wi-Fi Fix for iOS 6
    https://discussions.apple.com/thread/4823738?tstart=240
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    iPad: Issues connecting to Wi-Fi networks
    http://support.apple.com/kb/ts3304
    How to Boost Your Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Boost-Your-Wi-Fi-Signal.h Mt
    Troubleshooting a Weak Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/Troubleshooting-A-Weak-Wi-Fi-Sig nal.htm
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    10 Ways to Boost Your Wireless Signal
    http://www.pcmag.com/article2/0,2817,2372811,00.asp
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    Some Wi-Fi losses may stem from a problematic interaction between Wi-Fi and cellular data connections. Numerous users have found that turning off Cellular Data in Settings gets their Wi-Fi working again.
    You may have many apps open which can possibly cause the slowdown and possibly the loss of wifi. In iOS 4-6 double tap your Home button & at the bottom of the screen you will see the icons of all open apps. Close those you are not using by pressing on an icon until all icons wiggle - then tap the minus sign. For iOS 7 users, there’s an easy way to see which apps are open in order to close them. By double-tapping the home button on your iPhone or iPad, the new multitasking feature in iOS 7 shows full page previews of all your open apps. Simply scroll horizontally to see all your apps, and close the apps with a simple flick towards the top of the screen.
    Wi-Fi or Bluetooth settings grayed out or dim
    http://support.apple.com/kb/TS1559
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Supressing values less than 10

    I have a data set in which the facts are counts of students, divided into categories (by race, by sex, by performance level on standardized tests, etc..)
    One of our dimensions is called Performance Level. There are three Performance Levels - High, Medium, Low. For each combination of race, sex, grade, school, school year, and test taken, some percentage of the students score in the High range, some score in the Medium range, and some score in the Low range. As an example, let's assume that we have 50 students who are in the 4th grade at Jones Elementary in 2008, taking the Math Skills test. Of those 50 students, 20% (10) scored High, 64% (32) scored Medium, and 16% (8) scored Low.
    On our reports and charts, we show 50 students, and we show the 20% / 64% / 16% breakdown.
    Now, as we start to drill into those 50 students, we see that we have 27 females and 23 males. We show each of their percentages of High, Medium, and Low.
    And as we drill further, those 23 males are split into 15 African-American, 6 white, a 2 Asian-American.
    Here's the problem: Our rules specify that we can display the percentage of High/Medium/Low for the 15 African-American males, because 15 is greater than our "low-display" threshold of 10. BUT, since the other two counts (6 and 2) are below 10, we cannot display those counts, and we cannot display the High/Medium/Low percentages associated with them.
    So the problem I have is how to prevent the display of small numbers and their associated percentages. We still need those small numbers in the dataset so that the higher-level aggregates are correct. It's just that wherever we would normally "see" a small number in a report or chart, whether at a leaf level or at an aggregate level, we need to "see" nothing (either null or zero, either way is fine).
    Any ideas?

    I had already tried that, but on further review, my call was overturned. As it turns out, I was simply displaying the wrong column in my chart. Instead of picking the COUNTS column, I was using the TOTAL COUNTS column, which is a level-based measure containing the total of all three performance levels.
    The answer above is absolutely correct: use the column representing the leaf-level data, and use the >= 10 operation.

  • Best approach to do Range partitioning on Huge tables.

    Hi All,
    I am working on 11gR2 oracle 3node RAC database. below are the db details.
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    in my environment we have 10 big transaction (10 billion rows) tables and it is growing bigger and bigger. Now the management is planning to do a range partition based on created_dt partition key column.
    We tested this partitioning startegy with few million record in other environment with below steps.
    1. CREATE TABLE TRANSACTION_N
    PARTITION BY RANGE ("CREATED_DT")
    ( PARTITION DATA1 VALUES LESS THAN (TO_DATE(' 2012-08-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TXN_TAB_PART1,
    PARTITIONDATA2 VALUES LESS THAN (TO_DATE(' 2012-09-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TXN_TAB_PART2,
    PARTITION DATA3 VALUES LESS THAN (TO_DATE(' 2012-10-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TXN_TAB_PART3
    as (select * from TRANSACTION where 1=2);
    2. exchange partion for data move to new partition table from old one.
    ALTER TABLE TRANSACTION_N
    EXCHANGE PARTITION DATA1
    WITH TABLE TRANSACTION
    WITHOUT VALIDATION;
    3. create required indexes (took almost 3.5 hrs with parallel 16).
    4. Rename the table names and drop the old tables.
    this took around 8 hrs for one table which has 70 millions of records, then for billions of records it will take more than 8 hrs. But the problem is we get only 2 to 3 hrs of down time in production to implement these change for all tables.
    Can you please suggest the best approach i can do, to copy that much big data from existing table to the newly created partitioned table and create required indexes.
    Thanks,
    Hari

    >
    in my environment we have 10 big transaction (10 billion rows) tables and it is growing bigger and bigger. Now the management is planning to do a range partition based on created_dt partition key column.
    We tested this partitioning startegy with few million record in other environment with below steps.
    1. CREATE TABLE TRANSACTION_N
    PARTITION BY RANGE ("CREATED_DT")
    ( PARTITION DATA1 VALUES LESS THAN (TO_DATE(' 2012-08-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TXN_TAB_PART1,
    PARTITIONDATA2 VALUES LESS THAN (TO_DATE(' 2012-09-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TXN_TAB_PART2,
    PARTITION DATA3 VALUES LESS THAN (TO_DATE(' 2012-10-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TXN_TAB_PART3
    as (select * from TRANSACTION where 1=2);
    2. exchange partion for data move to new partition table from old one.
    ALTER TABLE TRANSACTION_N
    EXCHANGE PARTITION DATA1
    WITH TABLE TRANSACTION
    WITHOUT VALIDATION;
    3. create required indexes (took almost 3.5 hrs with parallel 16).
    4. Rename the table names and drop the old tables.
    this took around 8 hrs for one table which has 70 millions of records, then for billions of records it will take more than 8 hrs. But the problem is we get only 2 to 3 hrs of down time in production to implement these change for all tables.
    Can you please suggest the best approach i can do, to copy that much big data from existing table to the newly created partitioned table and create required indexes.
    >
    Sorry to tell you but that test and partitioning strategy is essentially useless and won't work for you entire table anyway. One reasone is that if you use the WITHOUT VALIDATION clause you must ensure that the data being exchanged actually belongs to the partition you are putting it in. If it doesn't you won't be able to reenable or rebuild any primary key or unique constraints that exist on the table.
    See Exchanging Partitions in the VLDB and Partitioning doc
    http://docs.oracle.com/cd/E18283_01/server.112/e16541/part_admin002.htm#i1107555
    >
    When you specify WITHOUT VALIDATION for the exchange partition operation, this is normally a fast operation because it involves only data dictionary updates. However, if the table or partitioned table involved in the exchange operation has a primary key or unique constraint enabled, then the exchange operation is performed as if WITH VALIDATION were specified to maintain the integrity of the constraints.
    If you specify WITHOUT VALIDATION, then you must ensure that the data to be exchanged belongs in the partition you exchange.
    >
    Comments below are limited to working with ONE table only.
    ISSUE #1 - ALL data will have to be moved regardless of the approach used. This should be obvious since your current data is all in one segment but each partition of a partitioned table requires its own segment. So the nut of partitioning is splitting the existing data into multiple segments almost as if you were splitting it up and inserting it into multiple tables, one table for each partition.
    ISSUE#2 - You likely cannot move that much data in the 2 to 3 hours window that you have available for down time even if all you had to do was copy the existing datafiles.
    ISSUE#3 - Even if you can avoid issue #2 you likely cannot rebuild ALL of the required indexes in whatever remains of the outage windows after moving the data itself.
    ISSUE#4 - Unless you have conducted full volume performance testing in another environment prior to doing this in production you are taking on a tremendous amount of risk.
    ISSUE#5 - Unless you have fully documented the current, actual execution plans for your most critical queries in your existing system you will have great difficulty overcoming issue #4 since you won't have the requisite plan baseline to know if the new partitioning and indexing strategies are giving you the equivalent, or better, performance.
    ISSUE#6 - Things can, and will, go wrong and cause delays no matter which approach you take.
    So assuming you plan to take care of issues #4 and #5 you will probably have three viable alternatives:
    1. use DBMS_REDEFINITION to do the partitioning on-line. See the Oracle docs and this example from oracle-base for more info.
    Redefining Tables Online - http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables007.htm
    Partitioning an Existing Table using DBMS_REDEFINITION
    http://www.oracle-base.com/articles/misc/partitioning-an-existing-table.php
    2. do the partitioning offline and hope that you don't exceed your outage window. Recover by continuing to use the existing table.
    3. do the partitioning offline but remove the oldest data to minimize the amount of data that has to be worked with.
    You should review all of the tables to see if you can remove older data from the current system. If you can you could use online redefinition that ignores older data. Then afterwards you can extract this old data from the old table for archiving.
    If the amount of old data is substantial you can extract the new data to a new partitioned table in parallel and not deal with the old data at all.

  • Drop older ( more than 3days of ) partitions in a table

    Hi Guru's,
    I have created an HOURLY interval partitioning for a table and the management was decide to 3 days of retention policy. So i need to schedule a Cron job for removing older partitions older than 3days, but i am not sure, how to write a shell script or a procedure to do this. Please help me on this and below are the table syntax and the partitions.
    CREATE TABLE TRANSACTION
         ID NUMBER(18) NOT NULL ,
         ACCT_ID NUMBER(18) NOT NULL ,
         BANKING_ID NUMBER(18) NOT NULL ,
         CREATED_DATE TIMESTAMP(3) NOT NULL ,
         COMMISSION_AMOUNT NUMBER(15,2) NULL ,
         CONFIRMATION_NO NVARCHAR2(255) NULL ,
         CREATED_BY NVARCHAR2(255) NOT NULL ,
         CREATED_TS TIMESTAMP(3) NOT NULL ,
         MODIFIED_BY NVARCHAR2(255) NOT NULL ,
         MODIFIED_TS TIMESTAMP(3) NOT NULL
    PARTITION BY RANGE ("CREATED_TS") INTERVAL( NUMTODSINTERVAL(1, 'HOUR'))
    ( PARTITION TRANS_DATA VALUES LESS THAN (TO_DATE(' 2011-11-04 20:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TABLE_TS_P,
    PARTITION TRANS_DATA1 VALUES LESS THAN (TO_DATE(' 2011-11-04 21:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TABLE_TS_P1,
    PARTITION TRANS_DATA2 VALUES LESS THAN (TO_DATE(' 2011-11-04 22:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TABLE_TS_P2,
    PARTITION TRANS_DATA3 VALUES LESS THAN (TO_DATE(' 2011-11-04 23:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TABLE_TS_P3,
    PARTITION TRANS_DATA4 VALUES LESS THAN (TO_DATE(' 2011-11-05 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TABLE_TS_P4,
    PARTITION TRANS_DATA5 VALUES LESS THAN (TO_DATE(' 2011-11-05 01:00:00', 'YYYY-MM-DD HH24:MI:SS') ) TABLESPACE &&TABLE_TS_P5
    Here Partitioning key is "CREATED_TS".
    HERE are the partitions created for this table.
    HIGH_VALUE PARTITION_NAME
    TIMESTAMP' 2011-11-04 20:00:00' TRANS_DATA
    TIMESTAMP' 2011-11-04 21:00:00' TRANS_DATA1
    TIMESTAMP' 2011-11-04 22:00:00' TRANS_DATA2
    TIMESTAMP' 2011-11-04 23:00:00' TRANS_DATA3
    TIMESTAMP' 2011-11-05 00:00:00' TRANS_DATA4
    TIMESTAMP' 2011-11-05 01:00:00' TRANS_DATA5
    TIMESTAMP' 2011-11-05 02:00:00' SYS_P41
    TIMESTAMP' 2011-11-05 03:00:00' SYS_P42
    TIMESTAMP' 2011-11-05 04:00:00' SYS_P44
    TIMESTAMP' 2011-11-05 05:00:00' SYS_P46
    TIMESTAMP' 2011-11-05 06:00:00' SYS_P49
    TIMESTAMP' 2011-11-05 07:00:00' SYS_P52
    TIMESTAMP' 2011-11-05 08:00:00' SYS_P102
    TIMESTAMP' 2011-11-05 09:00:00' SYS_P121
    TIMESTAMP' 2011-11-05 10:00:00' SYS_P141
    TIMESTAMP' 2011-11-05 11:00:00' SYS_P144
    TIMESTAMP' 2011-11-05 12:00:00' SYS_P147
    TIMESTAMP' 2011-11-05 13:00:00' SYS_P149
    TIMESTAMP' 2011-11-05 14:00:00' SYS_P151
    TIMESTAMP' 2011-11-05 15:00:00' SYS_P152
    TIMESTAMP' 2011-11-05 16:00:00' SYS_P154
    TIMESTAMP' 2011-11-05 17:00:00' SYS_P157
    TIMESTAMP' 2011-11-05 18:00:00' SYS_P222
    TIMESTAMP' 2011-11-05 19:00:00' SYS_P159
    TIMESTAMP' 2011-11-05 20:00:00' SYS_P243
    TIMESTAMP' 2011-11-05 21:00:00' SYS_P261
    TIMESTAMP' 2011-11-05 22:00:00' SYS_P282
    TIMESTAMP' 2011-11-06 01:00:00' SYS_P285
    TIMESTAMP' 2011-11-06 02:00:00' SYS_P303
    TIMESTAMP' 2011-11-06 03:00:00' SYS_P287
    TIMESTAMP' 2011-11-06 04:00:00' SYS_P289
    TIMESTAMP' 2011-11-06 05:00:00' SYS_P307
    TIMESTAMP' 2011-11-06 06:00:00' SYS_P324
    TIMESTAMP' 2011-11-06 07:00:00' SYS_P310
    TIMESTAMP' 2011-11-06 08:00:00' SYS_P313
    TIMESTAMP' 2011-11-06 09:00:00' SYS_P342
    TIMESTAMP' 2011-11-06 10:00:00' SYS_P292
    TIMESTAMP' 2011-11-06 11:00:00' SYS_P315
    TIMESTAMP' 2011-11-06 12:00:00' SYS_P295
    TIMESTAMP' 2011-11-06 13:00:00' SYS_P298
    TIMESTAMP' 2011-11-06 14:00:00' SYS_P361
    TIMESTAMP' 2011-11-06 15:00:00' SYS_P363
    TIMESTAMP' 2011-11-06 16:00:00' SYS_P365
    TIMESTAMP' 2011-11-06 17:00:00' SYS_P366
    TIMESTAMP' 2011-11-06 18:00:00' SYS_P368
    TIMESTAMP' 2011-11-06 19:00:00' SYS_P371
    TIMESTAMP' 2011-11-06 20:00:00' SYS_P373
    Here the partition names are not in order, so i am not able to figure out, to do the syntax to drop the partitions. Please let me know, how to drop the older partitions.

    You can use partition_position from user_tab_partitions to determine how many partitions you want to drop and which ones. These are always in order, regardless of your partition names. This obviously assumes that all your partitions are uniform (hourly in your case).
    Milina

  • Keeping no of days less than 15 in field DELTIMESTof BWOM_SETTINGS table

    Hello Experts,
    Is it possible to keep no of days less than 15 in field DELTIMEST of BWOM_SETTINGS table so as to keep data in BWFI_AEDAT only for 2 days.
    Also I tried but its not working,it still keeping data of last 15 days.
    Regards,
    Ankush Sharma

    Hi Ankush,
    DELTIMEST is the minimum retention period of time stamp tables.
    As per SAP logic, the minimum retention period for entries in the time stamp table is 15 days. So if you decrease the parameter value less than 15, SAP will automatically take the minimum value as 15 and ignore the settings. That is why you are not able to delete the entries less than 15 days.
    Ideally, when entries are deleted from table BWOM2_TIMEST, the corresponding entries for the changed line items are deleted simultaneously from log table BWFI_AEDAT, BWFI_AEDA2 and BWFI_AEDA3.
    BWFI_AEDAT table contains list of changed documents with the change date and the document number which helps in the delta extraction. SAP has recommended DELTIMEST value to be >= 60.
    Refer the below SAP note: (check BWOM_SETTINGS part in solution)
    1012874 - FAQ extractors 0FI_AP_* 0FI_AR_* 0FI_GL_*(except 10)
    Let me know if there are any questions.
    Thanks
    Amit

Maybe you are looking for

  • Error when opening Data Form

    Hi All, Also I have tried by removing access for that user and opened the Dta Form but still it throwing me the same error: You are trying to open the data form, but cannot because all of the required dimensions are not present. Possible causes may b

  • I am not able to import photos into Lightroom 5.7.  When I select a folder, it doesn't show a preview of the images and the import button is greyed out. ??

    I am not able to import photos into Lightroom 5.7.  When I select a folder, it doesn't show a preview of the images and the import button is greyed out. ?? I have been using Lightroom 5 for 2-3 months now and all worked well, up until today's effort

  • Long fields used in BAPI

    Hi. I have to create a custom BAPI which has one import field as string type. because BAPI doesnt support string data type, I have changed it to char2048 which is giving warning. Ignoring it, when I try releasing it in transaction SWO1, its throwing

  • Is it possible to install a J2EE on MacOS 10.6?

    Hey Guys I want to use my MacBook as development laptop but therefore I need j2ee (at least version 6) runtime enviroment. Is it possible to install that enviroment? If yes please tell me how. Thanks a lot! Stephan

  • ITUNES MATCH CONSTANT PROBLEM

    I am sick of my itunes match failing and forcing me to sign in and sign out of itunes every time i start my macbook and desktop mac! what is the problem, why can it just not update the match when i open itunes? i pay for a service, i expect it to wor