Partitioning Question - range partition?

Hello all
we have an issue with the amount of data we have in a particular schema that we are using to store production metrics. I have looked at a few options and are now trying to design a solution using partitioning. At a very high level we have data in 7 tables that need to utilise partitioning:
JOBS
FILES
MAILPIECES
MAILPIECE_DETAILS
TNT_DATA
BAGFILES
POSTAL_BAGS
Ideally I would like to use a RANGE partition as I can fairly easily use a date as the range - my issue here though is that only the FILES table has a DATE column on it.
So my question is, for the other tables, is it best practice to use the same 'sort of' partitions - in which case I would need to add a DATE column to each subsequent table and populate it correctly (based on the date in the FILES table - as the FILES table is acting as the PARENT table for all the other tables). Or, should each table be treated individually and partitioned using whatever method is appropriate for that table?
Any help would be greatly appreciated.
Many thanks
Paul

Hi,
if you are running 11g and all other tables are indeed children to FILES then consider reference partitioning.

Similar Messages

  • CFCHART question (range in the background)

    Hola.
    I want to put together a line graph using CFCHART. That part
    works great. But I also want to display a horizontal band of color
    that shows the "acceptible range" of values, so that it is obvious
    to the users when the data points fall outside that range (both
    above and beyond). All I need is a different background color for
    just one area of the graph.
    But I can't figure out how to do it...
    Any suggestions?
    Thanks in advance!

    May I suggest not using cfchart at all? I quickly found out
    that it has very limited functionality. I'm not even sure it can
    handle what you want, let alone if you plan on doing something a
    little more "serious" (for instance, plotting time-series data).
    Someone on this forum suggested I use KavaChart. Since I've
    done that, I have been extremely pleased!
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=11 14062&highlight_key=y

  • What is the maximum file size allowed by Yosemite's Archive Utility?

    I've seen radically different answers to this question, ranging from ".zip files have a 4GB size limit" to "no limit other than the OS maximum file size". It's been very difficult to find current info on this.
    I have lots of large folders full of recording projects --- I'm talking up to 45GB or so --- and I've been experimenting with different methods of zipping them in preparation for cloud backup. Several applications have been willing to zip my enormous folders into archives, but then choke when unzipping them, telling me that the files cannot be unzipped or are corrupted. Using the "Compress" shortcut in the finder has so far yielded the best results, keeping all necessary resource forks, etc., and unzipping properly, even when other apps have insisted the files are corrupted. However, I'm afraid to continue with this procedure until I can get a straight answer on this issue: have I just been lucky so far? IS there an actual size limit?
    ...It only seems to work when I both zip and unzip with the Archive Utility. Other archiving apps will either render the included projects unreadable by my recording software when zipping (I suspect because of alteration or stripping of resource forks), or will refuse to read the giant .zip archives generated by Archive Utility.
    I've set up the Archive Utility to produce .zip files, as I feel these are the most likely to be recognized by a variety of cloud storage services.ny
    ...Any guidance would be greatly appreciated!

    Hi,
    The 1,048,576 rows & 16,384 columns is the
    workbook size limitation in Excel 2013. Thus, I recommend we try the Mr. Bernie's suggestions to import the large CSV file.
    1. Use VBA to read the file line by line and split/examine the import file in sections. If you have further question about the VBA, please post your question to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    2. Use Excel 2013 add-ins. Power Pivot and Power Query. For more detailed information, please see the below articles: 
    http://social.technet.microsoft.com/Forums/en-US/9243a533-4575-4fd6-b93a-4b95d21d9b10/table-with-more-than-1-048-576-rows-in-power-query-excel-2013?fo
    http://www.microsofttrends.com/2014/02/09/how-much-data-can-powerpivot-really-manage-how-about-122-million-records/
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Thanks
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • Random presentation of images from plist.

    Hello all, my name is Merlin and of course... Im new to this! LOL Ive been teaching myself Obj-C and Cocoa for the better part of 5 months now, and I have to say... I found my path. I absolutely love it and cant wait till I feel more comfortable with the methodology. But enough about me!
    Im working on a Q&A based app. To get the UI to look EXACTLY the way I wanted it to, I designed all of the questions in Photoshop. These questions range in topic but normally ask you to tap on something specific in the image. Picture an image with a bunch of dogs and the prompt "tap the boxer..."
    I then have 2 custom buttons in IB, one covers the entire screen name "incorrectButton" and another named "correctButton" placed over the spot in the image that is the "correct" location.
    I have a HomePageViewController with a start button that loads Question1ViewController with the previously mentioned background UIImageView. Im using presentModalVC to load the question image with a nice UIModalTransCrossDissolve.
    Question1ViewController...
    "Tap on the boxer"...
    User taps incorrect location is sent to my IncorrectResponseViewController which states "Sorry, try again" and pops automatically after a 2 second delay.
    User taps correct location is sent to my CorrectResponseViewController which states "That is correct!" and unhides a nextButton. Pressing it implements nextButtonPressed which takes you to Question2ViewController (again by presenting it Modally). Question2ViewController then had a nib with question2.png loaded as the background and a new button layout to correspond to the new "correct" location.
    Since the method to call this "next" question is "nextButtonPressed", I soon realized I would never be able to get past Question2 unless I created some kind of loop and store the questions in a plist or Core Data.
    This is where I started to investigate loading all of my question images (or just their file names as an NSString) into a plist and using the same nib to present them all. I figured I could also store the "correctButton" coordinates as a Dictionary in that plist and call those in a setFrame method when I want to present the next question.
    So I have my plist built and I think it's correct...
    [TIMG]http://img.photobucket.com/albums/v686/FJMerlin/Screenshot2010-09-14at20550PM.pn g[/TIMG]
    I also created a Constants file with the following keys...
    #define BACKGROUNDIMAGE_KEY @"backgroundImage"
    #define CORRECTBUTTONLOCATION_KEY @"correctButtonLocation"
    #define XBUTTONLOC_KEY @"x"
    #define YBUTTONLOC_KEY @"y"
    #define WBUTTONLOC_KEY @"w"
    #define HBUTTONLOC_KEY @"h"
    So this is where my noobism shines through. Im having one **** of a time getting the values out of this plist and onto the screen. What I would like to do is load all (100 as of now) the questions into this plist. Then present the QuestionsViewController and have it randomly present the question Images. Upon selecting the correct location, modally present the CorrectResponseViewController with the nextButton, and have the nextButtonPressed method return you to QuestionsViewController with a new question and button layout. As of now, Im mostly concerned with getting anything out of the plist to work before I worry about randomizing the questions.
    Ive attempted to call these values a few different ways.
    .h
    @interface Q1ViewController : UIViewController {
    IBOutlet UIImageView *backgroundImage;
    IBOutlet UIButton *backButton;
    IBOutlet UIButton *correctButton;
    IBOutlet UIButton *incorrectButton;
    IBOutlet UIButton *nextButton;
    NSMutableArray *questions;
    NSMutableArray *buttonCorridinates;
    @property (nonatomic, retain) IBOutlet UIImageView *backgroundImage;
    @property (nonatomic, retain) IBOutlet UIButton *backButton;
    @property (nonatomic, retain) IBOutlet UIButton *nextButton;
    @property (nonatomic, retain) IBOutlet UIButton *correctButton;
    @property (nonatomic, retain) IBOutlet UIButton *incorrectButton;
    @property (nonatomic, retain) NSMutableArray *questions;
    @property (nonatomic, retain) NSMutableArray *buttonCorridinates;
    - (IBAction) backButtonPressed:(id) sender;
    - (IBAction) nextButtonPressed:(id) sender;
    - (IBAction) correctButtonPressed:(id) sender;
    - (IBAction) incorrectButtonPressed:(id) sender;
    @end
    .m
    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad {
    [super viewDidLoad];
    backButton.hidden = YES;
    nextButton.hidden = YES;
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Questions" ofType:@"plist"];
    NSMutableArray* tmpArray = [[NSMutableArray alloc] initWithContentsOfFile:path];
    self.questions = tmpArray;
    [tmpArray release];
    UIImage *tmpImage = [UIImage objectForKey:BACKGROUNDIMAGE_KEY];
    [backgroundImage setImage: tmpImage];
    [correctButton setFrame:CGRectMake(20.0f,226.0f,192.0f,37.0f)];
    [tmpImage release];
    NSString *correctButtonLoc = [[NSString alloc] intValue:CORRECTBUTTONLOCATION_KEY];
    [correctButton setFrame:CGRectMake(@"%@"),correctButtonLoc];
    //or this.... LOL
    UIImageView *tmpImage = [[UIImageView alloc] initWithImage:@"%@", BACKGROUNDIMAGE_KEY];
    [backgroundImage setImage:tmpImage];
    NSString *xButtonLoc = [[NSString intValue[questions objectForKey:XBUTTONLOC_KEY]];
    NSString *yButtonLoc = [[NSString intValue[questions objectForKey:YBUTTONLOC_KEY];
    NSString *wButtonLoc = [[NSString intValue[questions objectForKey:WBUTTONLOC_KEY];
    NSString *hButtonLoc = [[NSString intValue[questions objectForKey:HBUTTONLOC_KEY];
    [correctButton setFrame:CGRectMake(@"%@","%@","%@","%@") xButtonLoc, yButtonLoc, wButtonLoc, hButtonLoc];
    I feel like I know what to do, I just dont know how to do it. I have the image paths stored in the plist, so I obviously need to call those paths then convert them to the actual image, am I on the right track in that thinking?
    For the coordinates, I also have those stored as strings. So Im sure the same holds true. Need to convert those to ints to set my frame. But again, no matter how many time I read through the string formatting guide, I still cant seem to luck into this one.
    Once I have this figured out. Ill want to have something very similar to the randomizing plist code from James' FlashCard app which I found in another thread. http://discussions.apple.com/thread.jspa?threadID=2542025
    RayNewbie was kind enough to point me in the right direction to start my own thread so here I am!
    I hope this isnt to long winded. I wanted to be detailed. Thanks in advance for any guidance.

    ok, been at it for half the day already and cant seem to get the shuffleArray method to work with my code. I did tweak some things to make it more similar to the construct of James' FlashCard app.
    I did away with my Correct and IncorrectViewControllers. I changed the methods for pressing those buttons to simply change the background image to the appropriate response as well as unhide the next and back buttons to allow these controls to reside in the same VC. Here is how I have it now...
    @implementation QuestionsViewController
    @synthesize backgroundImage;
    @synthesize backButton;
    @synthesize nextButton;
    @synthesize correctButton;
    @synthesize incorrectButton;
    @synthesize questions;
    @synthesize counter;
    - (void)dealloc {
         [backgroundImage release];
         [backButton release];
         [nextButton release];
         [correctButton release];
         [incorrectButton release];
         [questions release];
         [super dealloc];
    -(void) viewWillAppear:(BOOL)animated {
         [super viewWillAppear:animated];
         nextButton.hidden = YES;
         backButton.hidden = YES;
    - (void) enableButton {
         int count = [questions count];
         nextButton.enabled = counter < count - 1 ? YES : NO;
         backButton.enabled = counter > 0 ? YES : NO;
    // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
        if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
            // Custom initialization
        return self;
    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad {
         [super viewDidLoad];
         NSString *path = [[NSBundle mainBundle] pathForResource:@"Questions" ofType:@"plist"];
         NSLog(@"%s: path=%@", __func__, path);
         NSMutableArray* tmpArray = [[NSMutableArray alloc]initWithContentsOfFile:path];
         self.questions = tmpArray;
         [tmpArray release];
         [self reset];     
    - (void)shuffleArray:(NSMutableArray*)array {
         int total = [array count];
         if (total <= 1)
              return;
         NSMutableArray *poolArray = [[NSMutableArray alloc] initWithArray:array];
         [array removeAllObjects];
         for (int i = 0; i < total; i++) {
              int index = random() % [poolArray count];
              [array addObject:[poolArray objectAtIndex:index]];
              [poolArray removeObjectAtIndex:index];
    - (IBAction)reset {
         srandomdev();
         counter = 0;
         [self shuffleArray:questions];
         if ([questions count]) {
              NSDictionary *Question = [questions objectAtIndex:counter];
              NSString *imageFileName = [Question objectForKey:@"backgroundImage"];
              UIImage *bkgdImage = [UIImage imageNamed:imageFileName];
              [backgroundImage setImage:bkgdImage];
              NSDictionary *correctPts = [Question objectForKey:@"correctButtonLocation"];
              CGRect correctRect = CGRectMake(
                                                      [[correctPts objectForKey:@"x"] doubleValue],
                                                      [[correctPts objectForKey:@"y"] doubleValue],
                                                      [[correctPts objectForKey:@"w"] doubleValue],
                                                      [[correctPts objectForKey:@"h"] doubleValue]
              [correctButton setFrame:correctRect];
         } else {
              [backgroundImage setImage:nil];     
         [self enableButton];
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
         // Return YES for supported orientations
         return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    - (IBAction) correctButtonPressed:(id) sender {
         NSLog(@"correct button pressed");
         nextButton.hidden = NO;
         backButton.hidden = NO;
         UIImage *correctImage = [UIImage imageNamed:@"thatIsCorrect.png"];
         [backgroundImage setImage:correctImage];
         [correctImage release];
    - (IBAction) nextButtonPressed:(id)sender {
         NSLog(@"Next button pressed");
         int count = [questions count];
         if (counter < count - 1) {
              NSDictionary *nextItem = [self.questions objectAtIndex:++counter];
              NSString *imageFileName = [nextItem objectForKey:@"backgroundImage"];
              UIImage *bkgdImage = [UIImage imageNamed:imageFileName];
              [backgroundImage setImage:bkgdImage];
              NSDictionary *correctPts = [nextItem objectForKey:@"correctButtonLocation"];
              CGRect correctRect = CGRectMake(
                                                      [[correctPts objectForKey:@"x"] doubleValue],
                                                      [[correctPts objectForKey:@"y"] doubleValue],
                                                      [[correctPts objectForKey:@"w"] doubleValue],
                                                      [[correctPts objectForKey:@"h"] doubleValue]
              [correctButton setFrame:correctRect];
         [self enableButton];
    - (IBAction) incorrectButtonPressed:(id) sender {
         NSLog(@"incorrect button pressed");
         IncorrectResponseViewController *incorrectResponseViewController = [[IncorrectResponseViewController alloc] initWithNibName:@"IncorrectResponseViewController" bundle:nil];
         incorrectResponseViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
         [self presentModalViewController:incorrectResponseViewController animated:YES];
         [incorrectResponseViewController release];
    - (IBAction) backButtonPressed:(id) sender {
         NSLog(@"Back button pressed");
         if (counter > 0) {
              NSDictionary *nextItem = [self.questions objectAtIndex:--counter];
              NSString *imageFileName = [nextItem objectForKey:@"backgroundImage"];
              UIImage *bkgdImage = [UIImage imageNamed:imageFileName];
              [backgroundImage setImage:bkgdImage];
              NSDictionary *correctPts = [nextItem objectForKey:@"correctButtonLocation"];
              CGRect correctRect = CGRectMake(
                                                      [[correctPts objectForKey:@"x"] doubleValue],
                                                      [[correctPts objectForKey:@"y"] doubleValue],
                                                      [[correctPts objectForKey:@"w"] doubleValue],
                                                      [[correctPts objectForKey:@"h"] doubleValue]
              //NSLog(@"Question %d:\n\timageFileName=%@\n\tcorrectRect=%@", count++, imageFileName, NSStringFromCGRect(correctRect));
              [correctButton setFrame:correctRect];
         [self enableButton];     
    - (void)didReceiveMemoryWarning {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
        // Release any cached data, images, etc that aren't in use.
    - (void)viewDidUnload {
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    @end
    The only issue I was having was with "counter" which I see in James' .m file but I wasnt sure what the ivar was. So I used your recommendation Ray and searched all his posts here on the forum and found that it was an fact an int. Now it appears everything is actually working! I just need to tweak the UI to hide and unhide my back and next buttons consistently but so far this is exactly what I was looking for.
    Next up I have to figure out how to convert the coordinates to landscape so my correctButton lands up in the right spot and of course... score keeping! LOL
    Thanks again Ray!

  • Data Mining - Pattern identification T Sql

    Hi All ,
    I have a table that stores customer complaints on daily basis .
    Example :
    The table stores customer Information : Customer Name, Complaint Description , Priority .. i want to group the complaints that share the Nearly the same Complaint Description ..
    CustomerName
    Complaint Description 
    Priority
    Aroan
    AMC server Down
    High
    James
    MNC server Down
    Critical
    Ryun
    node not responding al1232
    low
    Fred
    node not responding 54313
    Medium
    Maroon 
    Network down type rt:1234
    High
    Rish
    Network Down Type rt :3828
    Critical
    So here even though Complaint Description for Aroan and James is not exactly same but the issue is same server down .Same for Ryun and Fred . is there a way to find the common patterns and present output somewhat like below :
    Count 
    Complaint Type 
    2
    Server Down 
    2
    Node Not Responding 
    2
    Network Down 
    The Data base is OLTP one but not with frequent loads please help with an example how a query should look like for above requirement .
    Thanks
    Priya

    There are 100 ways to answer this question, ranging from reasonably simple (my answer) to getting extremely sophisticated, but in the case of text matching like this, no matter how sophisticated you get, you'll never get a perfect answer (the closest thing
    to perfect would be to force the user or help desk agent to pick from a list of complaints up front, before you get this far). 
    If your scenario is as simple and predictable as your posted example, this should work fine.  For this answer, I mocked up the data via a SQL statement, but I would recommend creating a permanent table for the "Similarity List Table", that you can easily
    add to (so if a new common complaint like 'I can't find the "any key"' needs to be added, you just add to the table, you don't need to modify the query). Note that this also uses "top 1" plus "order by rank" so that only one, the one that you designate
    as the highest ranking will ever match.
    With EXAMPLE_DATA (Name, Complaint, Severity) as (
    Select 'Aroan', 'AMC server Down', 'High'
    UNION ALL Select 'James', 'MNC server Down', 'Critical'
    UNION ALL Select 'JRyun ', 'node not responding al1232', 'low'
    UNION ALL Select 'JFred', 'node not responding 54313', 'Medium'
    UNION ALL Select 'JMaroon', 'Network down type rt:1234', 'High'
    UNION ALL Select 'JRish', 'Network Down Type rt :3828', 'Critical'
    UNION ALL Select 'John', 'The darn network is down again rt:5646', 'High'
    UNION ALL Select 'Tom', 'MNC server down, my node not responding abcd1234, and network down type jm:1234', 'Critical'
    , Similarity_List_Table (rank, match_wildcard, Complaint_Category) as
    Select 1, '%Server Down%', '0001 - Server Down'
    UNION ALL Select 2, '%node not responding%', '0002 - Node not responding'
    UNION ALL Select 3, '%network down type%', '0003 - Network down type'
    Select *, Coalesce(complaint_category, Complaint) as filtrered_complain
    from Example_Data
    Outer Apply (Select top (1) complaint_category
    from Similarity_list_table
    where complaint like match_wildcard order by rank) as X
    If your situation is more complex and unpredictable (which I am guessing it is), keep in mind what I said, no matter how complex you make something like this, it will still never be perfect.  Consider forcing the users up front to pick a category, and
    even with that, expect an inordinate number of "Other" categories being chosen.  :-)

  • PARTITION BY RANGE question

    I have a table which is partitioned as follows:
    PARTITION BY RANGE (CALL_TIME_MONTH, RECORD_TYPE)
    PARTITION PARTITION_200309_MOC VALUES LESS THAN ('200309', 2)
    NOLOGGING
    TABLESPACE POST_CDR_200309_MOC
    How is it possible that this partition holds data of 200309 (and not 200308) ???!?:
    select min(CALL_TIME_MONTH), max(CALL_TIME_MONTH) from my_table partition (PARTITION_200309_MOC)
    200309, 200309

    CREATE TABLE POST_CDR
    ID NUMBER NOT NULL,
    ENTRY_DATE DATE NOT NULL,
    RECORD_TYPE NUMBER,
    CALL_TIME_MONTH VARCHAR2(6 BYTE) NOT NULL,
    FNAME VARCHAR2(100 BYTE),
    FILE_ID NUMBER
    NOLOGGING
    TABLESPACE POST_CDR_MAIN
    PARTITION BY RANGE (CALL_TIME_MONTH, RECORD_TYPE)
    PARTITION PARTITION_200406_MOC VALUES LESS THAN ('200406', MAXVALUE)
    NOLOGGING
    TABLESPACE POST_CDR_200406_MOC
    PARTITION PARTITION_200406_MTC VALUES LESS THAN ('200406', MAXVALUE)
    NOLOGGING
    TABLESPACE POST_CDR_200406_MTC
    PARTITION PARTITION_200407_MOC VALUES LESS THAN ('200407', 2)
    NOLOGGING
    TABLESPACE POST_CDR_200407_MOC
    PARTITION PARTITION_200407_MTC VALUES LESS THAN ('200407', MAXVALUE)
    NOLOGGING
    TABLESPACE POST_CDR_200407_MTC
    PARTITION PARTITION_200408_MOC VALUES LESS THAN ('200408', 2)
    NOLOGGING
    TABLESPACE POST_CDR_200408_MOC
    PARTITION PARTITION_200408_MTC VALUES LESS THAN ('200408', MAXVALUE)
    NOLOGGING
    TABLESPACE POST_CDR_200408_MTC

  • Is there any plan of allowing non-range partitioning of spatial indexes

    our application is really lacking the ability of spatial index being partitioned by list. We are binning information in our data warehouse by spatial locations, and when we query it (actually, MapViewer is generating a tile), entire geometry set is searched because table is list-partitioned and we cannot have local spatial index.

    Hi,
    I'm not in a position to answer the question about list partitioning, but would a pseudo-list partition implemented as a range partition work? For example, something like this:
    CREATE TABLE customers (
      first_name    VARCHAR2(20),
      last_name     VARCHAR2(20),
      address_1     VARCHAR2(20),
      address_2     VARCHAR2(20),
      city          VARCHAR2(20),
      state_abrv    VARCHAR2(3),
      postal_code   VARCHAR2(10),
      customer_id   NUMBER NOT NULL UNIQUE)
      PARTITION BY RANGE (state_abrv) 
       PARTITION ALASKA         VALUES LESS THAN ('AKz'),
       PARTITION ALABAMA        VALUES LESS THAN ('ALz'),
       PARTITION ARKANSAS       VALUES LESS THAN ('ARz'),
       PARTITION AMERICANSAMOA  VALUES LESS THAN ('ASz'),
       PARTITION ARIZONA        VALUES LESS THAN ('AZz'),
       PARTITION CALIFORNIA     VALUES LESS THAN ('CAz'),
       PARTITION WYOMING        VALUES LESS THAN ('WYz')
       );I've used this method in the past, although I agree a list partitioning solution is much preferred.
    Dan

  • Partitioning on a Table - Few Questions, Confusions

    Hello All,
       I've a table with around 300 Million Records. This Table has one Key Column (Auto Incremented by 1 ) and a Unique ID Field.
    Primary Key (Clustered Primary Key) was created on Key Column of this Table.
    Now If I want to partition this table based on UniqueID Field, SQL Server is not allowing me to do it! It throws the error something like "Partitioned Column should present in Primary Key (Clustered Index)"
    Is it mandatory that the partitioned column should definitely be present in the clustered index or primary key of the table if exists.
    Could someone tell me what are the prerequisites to partition a table that already have a primary key on FieldA and Unique Non Clustered Index on FieldB and I'd like to partition the table based on FieldC?
    Thanks in Advance...
    Unknown

    Hi Roger,
    I am a little confused, why do you want to partition a table based on a UniqueID? Partioning is more of a logical thing to do like dividing a table yearly, for ex the table can be divided on a year by year basis which would make more sense as the older data
    can be moved over to slow storage if it's used as often as the new one based on the environment.
    A UniqueID would just be a random number, I am not sure how are you planning to create a partition scheme on this and would that be effective.
    Just to answer your question, it's not mandatory to have a PK column included in the partitioning.
    For Ex, one of the scripts that I wrote
    --CREATE PARTITION FUNCTION PF_test (datetime)
    AS RANGE LEFT FOR VALUES
     ('2010-12-31 23:59:59.999',
     '2011-12-31 23:59:59.999',
     '2012-12-31 23:59:59.999',
     '2013-12-31 23:59:59.999',
     '2014-12-31 23:59:59.999',
     '2015-12-31 23:59:59.999')
    GO
    I would suggest that you watch the below video to have a better understanding:-
    http://technet.microsoft.com/en-US/sqlserver/gg545008.aspx
    Please mark the answer as helpful if i have answered your query. Thanks and Regards, Kartar Rana

  • Range partitioning and update to range value

    There is a V. large table on our system, where a column is initally set to NULL, but updated with sysdate when processed. The majority of qureies against this table are for those with NULL values. I'm considering range partitioning by this column, where all NULLs will appear in the one partition, all non_NULLs in the other. The questions are.....
    1)will a row automatically move from one partion to the next on update of the NULL value
    2) If so, what are the overheads

    Using ENABLE ROW MOVEMENT will work, but the overhead of moving the rows is fairly high. If the date column is only updated once over the life of the record, then this overhead may be acceptable. However, if the date field is updated to sysdate most times the record is touched, then this may be a large performance hit.
    You may want to investigate the use of a function based index to get the NULL dates indexed. A function like:
    DECODE(date_field,NULL,1,NULL)
    would create an index containing only the null rows. Then a query like:
    SELECT stuff
    FROM table
    WHERE DECODE(date_field,NULL,1,NULL) = 1would likely do and index range scan.
    TTFN
    John

  • Range Partitioning on Varchar2 column???

    We hava table and it has a date column and its type is varchar2.
    This column's format is '16021013' ('ddmmyyyy').
    We want to make range partition on this column. What will be the best way?
    do you think virtal column partitioning will be efficient?

    >
    I'm not a new DBA:-) You can be sure. I asked only about range partitioning trick with varchar2 column because we did our examination about this table. We will need to archive this table quarter by quarter to the other archive database. Then, off course, nearly all queries are coming firstly by using this date column and they can have different filtering inside "where" conditions. Already, this table has index on this column but with huge number of data, index performance is not enough for us. This is a 7x24 banking system and we are lately joined to this project. Because of this, we cant change everything like changing data type of that column after this moment.
    >
    You are taking things way too personally. No one said anything about whether you were, or were not, a DBA or made any other comments about your skill or abilities.
    What we ask was for you to tell us WHAT the problem was that you were trying to solve and WHY you thought partitioning would solve it.
    And now, after several generic posts, you have finally provided that information. We can only comment based on the information that you post. We can't guess as to what types of queries you use or what kinds of predicates you use in those queries. But we need to know that information in order to provide the best advice.
    Next time you post put the important information in your original question:
    1. A table column is VARCHAR2 but contains a date value. We are unable to change the datatype of this column.
    2. We need to archive data quarterly based on this date value
    3. Nearly all queries use this date value and then also may have additional filter conditions
    4. This date column is indexed but we would like to improve the performance beyond what this index can give us.
    The above is a summary that includes all important information that is needed to know how best to help you.
    And I made a pretty good guess since two replies ago I provided you with example code that shows just how to partition the table.
    >
    Now, our only aim is how to make range partitioning this varchar2 date column.
    >
    As I showed you in my example code earlier you can add a virtual column to the table and partition on it. My example code creates a monthly partitioned table that allows you to archive by month or archive every three months to archive by quarter.
    You can modify that example to use quarterly partitions if you want but I would recommend that you use standard monthly partitions since they will satisfy the widest range of predicates.

  • Question about table partitioning...

    Hello, all.  I'm using SQL 2012 Enterprise.  I have 8 very large tables (the largest two having 227M and 118M records, and the others between 11M-44M records).  For performance reasons, I'm considering partitioning the tables across multiple
    files/filegroups.  For my largest table (227M records), the data is spread across years 2011, 2012, and 2013 with 2013 having 104M records.  So naturally I'm considering partitioning on a Date column.  My question is should I go with four partitions
    (2011, 2012, 2013 and 2014 for new data) and still end up with a very large aggregation of data on the 2013 partition (104M) or should I further breakdown the 2013 partition into months now having 12 partitions for 2013 alone, and then I'm OK with all
    of 2011 and 2012 on their own partitions.  Again, this is for one table.  I'd still like to partition the other 7 large tables.  In the end, I could end up with many, many partitions and hence many, many filegroups.  I'm interested in how
    others partition MULTIPLE large tables.  Can you share partition functions/schemes across tables?
    Any thoughts, your own personal experiences, etc would be greatly appreciated.  Also, can someone recommend a good book, article, blog, etc on partitioning large databases.
    Thanks much in advance.
    Roz

    If you query against more than one partition I have doubts  you will gain performance...
    -- Create partition functions
    CREATE PARTITION FUNCTION PF1(INT) AS RANGE RIGHT FOR VALUES (1, 2, 3);
    CREATE PARTITION FUNCTION PF2(INT) AS RANGE RIGHT FOR VALUES (1, 2);
    -- Create filegroups
    ALTER DATABASE testdb ADD FILEGROUP FG7;
    ALTER DATABASE testdb ADD FILEGROUP FG6;
    ALTER DATABASE testdb ADD FILEGROUP FG5;
    ALTER DATABASE testdb ADD FILEGROUP FG4;
    ALTER DATABASE testdb ADD FILEGROUP FG3;
    ALTER DATABASE testdb ADD FILEGROUP FG2;
    ALTER DATABASE testdb ADD FILEGROUP FG1;
    -- Create partition schemes
    CREATE PARTITION SCHEME PS1 AS PARTITION PF1
    TO (FG1, FG2, FG3, FG4);
    CREATE PARTITION SCHEME PS2 AS PARTITION PF2
    TO (FG5, FG6, FG7);
    CREATE VIEW [dbo].[partition_info] 
    AS
    SELECT
    DB_NAME() AS 'DatabaseName'
    ,OBJECT_NAME(p.OBJECT_ID) AS 'TableName'
    ,p.index_id AS 'IndexId'
    ,CASE
    WHEN p.index_id = 0 THEN 'HEAP'
    ELSE i.name
    END AS 'IndexName'
    ,p.partition_number AS 'PartitionNumber'
    ,prv_left.value AS 'LowerBoundary'
    ,prv_right.value AS 'UpperBoundary'
    ,ps.name as PartitionScheme
    ,pf.name as PartitionFunction
    ,CASE
    WHEN fg.name IS NULL THEN ds.name
    ELSE fg.name
    END AS 'FileGroupName'
    ,CAST(p.used_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'UsedPages_MB'
    ,CAST(p.in_row_data_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'DataPages_MB'
    ,CAST(p.reserved_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'ReservedPages_MB'
    ,CASE
    WHEN p.index_id IN (0,1) THEN p.row_count
    ELSE 0
    END AS 'RowCount'
    ,CASE
    WHEN p.index_id IN (0,1) THEN 'data'
    ELSE 'index'
    END 'Type'
    FROM sys.dm_db_partition_stats p
    INNER JOIN sys.indexes i
    ON i.OBJECT_ID = p.OBJECT_ID AND i.index_id = p.index_id
    INNER JOIN sys.data_spaces ds
    ON ds.data_space_id = i.data_space_id
    LEFT OUTER JOIN sys.partition_schemes ps
    ON ps.data_space_id = i.data_space_id
    LEFT OUTER JOIN sys.partition_functions pf
    ON ps.function_id = pf.function_id
    LEFT OUTER JOIN sys.destination_data_spaces dds
    ON dds.partition_scheme_id = ps.data_space_id
    AND dds.destination_id = p.partition_number
    LEFT OUTER JOIN sys.filegroups fg
    ON fg.data_space_id = dds.data_space_id
    LEFT OUTER JOIN sys.partition_range_values prv_right
    ON prv_right.function_id = ps.function_id
    AND prv_right.boundary_id = p.partition_number
    LEFT OUTER JOIN sys.partition_range_values prv_left
    ON prv_left.function_id = ps.function_id
    AND prv_left.boundary_id = p.partition_number - 1
    WHERE
    OBJECTPROPERTY(p.OBJECT_ID, 'ISMSSHipped') = 0
    AND p.index_id IN (0,1)
    GO
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Change partitioned column range in range partioning in 11g

    Hi All,
    First of all , i am thankful to all of you for your help and suggestions in past. I have one new issue. I am using Oracle 11. There is one new functionality in 11g to do range paritioning while table creation and do daily partitioning.
    CREATE TABLE TEST(
    DUE_DAY DATE,
    ID VARCHAR2(10 BYTE),
    NAME VARCHAR2(25 BYTE)
    PARTITION BY RANGE (DUE_DAY)
    INTERVAL( NUMTODSINTERVAL(1,'DAY'))
    PARTITION FIRST VALUES LESS THAN (TO_DATE('2012-02-05 12:00:00', 'SYYYY-MM-DD HH24:MI:SS')));
    Now I found i create the partition range wrong so each partition has data from previous day 12:00 afternoon to today 12:00 afternoon instead of daily data from 00:00 am to 11:59 pm because i mentioned wrong range in partition.
    I supposed to do like this:
    CREATE TABLE TEST(
    DUE_DAY DATE,
    ID VARCHAR2(10 BYTE),
    NAME VARCHAR2(25 BYTE)
    PARTITION BY RANGE (DUE_DAY)
    INTERVAL( NUMTODSINTERVAL(1,'DAY'))
    PARTITION FIRST VALUES LESS THAN (TO_DATE('2012-02-05 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')));
    My question is: Is there any way i can change it now as table already has huge data in it, so i cant go with creation of another partitioned table with correct partition range? Please let me know your suggestions and comments to resolve this issue.
    Regards
    Dev
    Edited by: Keen2Learn on Feb 10, 2012 9:12 AM

    Keen2Learn wrote:
    My question is: Is there any way i can change it now as table already has huge data in it, so i cant go with creation of another partitioned table with correct partition range? Please let me know your suggestions and comments to resolve this issue.Nope.
    I don't think it is possible to achieve this without creating a new/an intermediate table.
    If you can afford down-time, you should create new table, load data into it (in parallel with nologging), drop original table and rename new table.
    If you want this switchover as online operation, you can use DBMS_REDEFINITION as follows:
    SQL> select * from v$version ;
    BANNER                                                                                                                                                                    
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production                                                                                                    
    PL/SQL Release 11.2.0.2.0 - Production                                                                                                                                    
    CORE     11.2.0.2.0     Production                                                                                                                                                
    TNS for Linux: Version 11.2.0.2.0 - Production                                                                                                                            
    NLSRTL Version 11.2.0.2.0 - Production                                                                                                                                    
    SQL> CREATE TABLE TEST(
      2  DUE_DAY DATE,
      3  ID VARCHAR2(10 BYTE),
      4  NAME VARCHAR2(25 BYTE)
      5  )
      6  PARTITION BY RANGE (DUE_DAY)
      7  INTERVAL( NUMTODSINTERVAL(1,'DAY'))
      8  (
      9  PARTITION FIRST VALUES LESS THAN (TO_DATE('2012-02-01 12:00:00', 'SYYYY-MM-DD HH24:MI:SS')));
    Table created.
    SQL> insert into test(due_day, id) select (trunc(sysdate, 'MM')+(10/24)) + ((5*level)/24), level from dual connect by level <= 12 ;
    12 rows created.
    SQL> commit ;
    Commit complete.
    SQL> exec dbms_stats.gather_table_stats(user, 'TEST');
    PL/SQL procedure successfully completed.
    SQL> select partition_name, num_rows from user_tab_partitions where table_name = 'TEST' ;
    PARTITION_NAME                   NUM_ROWS                                                                                                                                 
    FIRST                                   0                                                                                                                                 
    SYS_P115                                5                                                                                                                                 
    SYS_P116                                4                                                                                                                                 
    SYS_P117                                3                                                                                                                                 
    SQL> SELECT * FROM TEST PARTITION (FIRST) ;
    no rows selected
    SQL> SELECT * FROM TEST PARTITION (SYS_P115) ;
    DUE_DAY              ID         NAME                                                                                                                                      
    01-FEB-2012 15:00:00 1                                                                                                                                                    
    01-FEB-2012 20:00:00 2                                                                                                                                                    
    02-FEB-2012 01:00:00 3                                                                                                                                                    
    02-FEB-2012 06:00:00 4                                                                                                                                                    
    02-FEB-2012 11:00:00 5                                                                                                                                                    
    SQL> SELECT * FROM TEST PARTITION (SYS_P116);
    DUE_DAY              ID         NAME                                                                                                                                      
    02-FEB-2012 16:00:00 6                                                                                                                                                    
    02-FEB-2012 21:00:00 7                                                                                                                                                    
    03-FEB-2012 02:00:00 8                                                                                                                                                    
    03-FEB-2012 07:00:00 9                                                                                                                                                    
    SQL> SELECT * FROM TEST PARTITION (SYS_P117);
    DUE_DAY              ID         NAME                                                                                                                                      
    03-FEB-2012 12:00:00 10                                                                                                                                                   
    03-FEB-2012 17:00:00 11                                                                                                                                                   
    03-FEB-2012 22:00:00 12                                                                                                                                                   
    SQL> exec DBMS_REDEFINITION.CAN_REDEF_TABLE('hr','TEST',DBMS_REDEFINITION.CONS_USE_ROWID);
    PL/SQL procedure successfully completed.
    SQL> CREATE TABLE INTR_TEST(
      2  DUE_DAY DATE,
      3  ID VARCHAR2(10 BYTE),
      4  NAME VARCHAR2(25 BYTE)
      5  )
      6  PARTITION BY RANGE (DUE_DAY)
      7  INTERVAL( NUMTODSINTERVAL(1,'DAY'))
      8  (
      9  PARTITION FIRST VALUES LESS THAN (TO_DATE('2012-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')));
    Table created.
    SQL> exec DBMS_REDEFINITION.START_REDEF_TABLE('hr', 'TEST', 'INTR_TEST', 'due_day due_day, id id, name name', dbms_redefinition.cons_use_rowid);
    PL/SQL procedure successfully completed.
    SQL> exec DBMS_REDEFINITION.SYNC_INTERIM_TABLE('hr', 'TEST', 'INTR_TEST');
    PL/SQL procedure successfully completed.
    SQL> exec DBMS_REDEFINITION.FINISH_REDEF_TABLE('hr', 'TEST', 'INTR_TEST');
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_table_stats(user, 'TEST');
    PL/SQL procedure successfully completed.
    SQL> select partition_name, num_rows from user_tab_partitions where table_name = 'TEST' ;
    PARTITION_NAME                   NUM_ROWS                                                                                                                                 
    FIRST                                   0                                                                                                                                 
    SYS_P118                                2                                                                                                                                 
    SYS_P119                                5                                                                                                                                 
    SYS_P120                                5                                                                                                                                 
    SQL> SELECT * FROM TEST PARTITION (FIRST) ;
    no rows selected
    SQL> SELECT * FROM TEST PARTITION (SYS_P118) ;
    DUE_DAY              ID         NAME                                                                                                                                      
    01-FEB-2012 15:00:00 1                                                                                                                                                    
    01-FEB-2012 20:00:00 2                                                                                                                                                    
    SQL> SELECT * FROM TEST PARTITION (SYS_P119);
    DUE_DAY              ID         NAME                                                                                                                                      
    02-FEB-2012 01:00:00 3                                                                                                                                                    
    02-FEB-2012 06:00:00 4                                                                                                                                                    
    02-FEB-2012 11:00:00 5                                                                                                                                                    
    02-FEB-2012 16:00:00 6                                                                                                                                                    
    02-FEB-2012 21:00:00 7                                                                                                                                                    
    SQL> SELECT * FROM TEST PARTITION (SYS_P120);
    DUE_DAY              ID         NAME                                                                                                                                      
    03-FEB-2012 02:00:00 8                                                                                                                                                    
    03-FEB-2012 07:00:00 9                                                                                                                                                    
    03-FEB-2012 12:00:00 10                                                                                                                                                   
    03-FEB-2012 17:00:00 11                                                                                                                                                   
    03-FEB-2012 22:00:00 12                                                                                                                                                   
    SQL> select dbms_metadata.get_ddl('TABLE','TEST') from dual ;
    DBMS_METADATA.GET_DDL('TABLE','TEST')                                                                                                                                     
      CREATE TABLE "HR"."TEST"                                                                                                                                                
       (     "DUE_DAY" DATE,                                                                                                                                                      
         "ID" VARCHAR2(10),                                                                                                                                                       
         "NAME" VARCHAR2(25)                                                                                                                                                      
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255                                                                                                                        
      STORAGE(                                                                                                                                                                
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)                                                                                                       
      TABLESPACE "USERS"                                                                                                                                                      
      PARTITION BY RANGE ("DUE_DAY") INTERVAL (NUMTODSINTERVAL(1,'DAY'))                                                                                                      
    (PARTITION "FIRST"  VALUES LESS THAN (TO_DATE(' 2012-02-01 00:00:00', 'SYYYY-MM                                                                                          
    -DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) SEGMENT CREATION DEFERRED                                                                                                     
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING                                                                                                        
      STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)                                                                                              
      TABLESPACE "USERS" )                                                                                                                                                    
    SQL> drop table intr_test purge ;
    Table dropped.
    SQL> drop table test purge ;
    Table dropped.
    SQL> spool offHope this helps.

  • Range interval partitioning with null value

    Hello,
    I have question, how can I create table with partition and after that I will insert null value in the partition key like this kind of
    range interval partitioning with null value.
    I have Oracle 11g.
    Thanks
    Mohammed

    user13777053 wrote:
    Thank you, but my question is about range interval not for range?http://docs.oracle.com/cd/E11882_01/server.112/e25523/partition.htm#VLDBG00220
    A MAXVALUE literal can be defined for the highest partition. MAXVALUE represents a virtual infinite value that sorts higher than any other possible value for the partitioning key, *including the NULL value.*
    So since you're trying to partition by interval (which doesn't support a MAXVALUE clause) you're out of luck.
    There's probably fancy hacks and what not you could try to implement, but i'm not about to recommend any of those here :)
    Cheers,

  • Question on Creating table from another table and copying the partition str

    Dear All,
    I want to know whether is there any way where we can create a table using another table and have the partitions of the new table to be exactly like the used table.
    Like
    CREATE TABLE TEST AS SELECT * FROM TEMP;
    The table TEMP is having range and hash partitions.
    Is there any way when we use the above command, we get the table partitions of TEMP to be copied to the new table TEST.
    Appreciate your suggestions on this one.
    Thanks,
    Madhu K.

    may this answer your question...
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:595568200346856483
    Ravi Kumar

  • Data Warehouse Partitioning question

    Hi All,
    I have a data warehousing partitioning question - I am defining partitions on a fact table in OWB and have range partitioning on a contract number field. Because I am on 10gR2 still, I have to put the contract number field into the fact table from its dimension in order to partition on it.
    The tables look like
    Contract_Dim (dimension_key, contract_no, ...)
    Contract_Fact(Contract_Dim, measure1,measure2, contract_no)
    So my question:
    When querying via reporting tools, my users are specifying contract_no conditions on the dimension object and joining into the contract_fact via the dimension_key->Contract_dim fields.
    I am assuming that the queries will not use partition pruning unless I put the contract_fact.contract_no into the query somehow. Is this true?
    If so, how can I 'hide' that additional step from my end-users? I want them to specify contract numbers on the dimension and have the query optimizer be smart enough to use partition pruning when running the query.
    I hope this makes sense.
    Thanks,
    Mike

    I am about to start a partitioning program on my dimension / fact tables and was hoping to see some responses to this thread.
    I suggest that you partition the tables on the dimension key, not any attribute. You could partition both fact and dimension tables by the same rule. Hash partitions seem to make sense here, as opposed to range or list partitions.
    tck

Maybe you are looking for