How to create and delete partitions automatically?

How to create and delete partitions automatically?
The environment is (10.2.0.3) 10g Oracle on the RHEL4.0 system.
I want to partition the table of MESSAGES by date (NUMTODSINTERVAL(1,'DAY')). One partition per day. Because the table is huge, only 2 partitions (as of yesterday and today) are required to be available online. All partitions as earlier than the day before will be saved, and then dropped. I want to do the partition to create and delete the work performed automatically. How to do?

Thank you

junez wrote:
Could do in detail?

Here is an example of a procedure (part of a package) that adds/add a partition to an existing partitioned table schedule:

procedure AddHourlyPartition( tableName varchar2, hour date, partitionName IN OUT varchar2 ) is
        sqlCreate       varchar2(4000);
        d               date;
begin
        partitionName := GetHourlyPartitionName( hourly );  -- name of partition to create

        if existsPartition( tableName, partitionName ) then
                -- nothing to do
                return;
        end if;

        d := TRUNC(hour,'hh') + (1/24);                                -- upper date limit of the partition

        sqlCreate :=
        'ALTER TABLE '||tableName||'
                ADD PARTITION '||partitionName||'
                values less than
                        (TO_DATE('''|| TO_CHAR(d,'yyyy/mm/dd hh24:mi:ss') ||''',''yyyy/mm/dd hh24:mi:ss''))'
        ;

        ExecSQL( sqlCreate );

end;

The partition is safer to create partitions according to the experience?

It is always better to write good packages in PL/SQL. Packages can (and should) use the application programming interfaces (API). Because our partition custom package that allows the management of partition. Or a messageLog package that allows for logging of application messages, errors, and debugging messages. Or a Notification package that allows to be send by email or SMS notifications. Etc.

Design and software development, we should always approaches a "+ Lego mentality +"-which is to create building blocks ("+ Lego bricks +") which can be used and reused over and over again. Modularization is of crucial importance in software engineering as the result is not only of reusable code, but also the code that is easier to maintain, extend easier and easier to debug.

Tags: Database

Similar Questions

  • How to create and delete accounts

    How can I delete and create accounts?

    Hello

    Your question is off-topic for this forum, you may find the answer here:

    http://support.Microsoft.com/kb/279783

    Good luck

    Donald Anadell

  • How to remove and delete the in computer HP recovery Partition.

    Hello

    How to remove and delete the Partition Recovery on HP computer after I installed win 7 (clean install) befor was Vista?

    Thank you


  • Folder hierarchy: how to create and modify a folder hierarchy?

    How to create and modify a folder hierarchy?

    Here's how to change the default template for a folder:http://www.vistax64.com/tutorials/70819-windows-explorer-folder-view-settings.html.  Default behavior is to select the model based on the first type of file placed in the folder (you must choose something).  Vista sets thefolder type template according to what are the types of files in the window and the settings display window Explorer. This will show you how to resetthe Windows Explorer folder view settings, disable Automatic folder Type discovery and increase theview of the folder cache to have Vista don't forget display settings, model of file type, size, or position of a specific window for when it was still closed to the location of specific path.

    It does not work with the Sub record under, Open with,open in a new tab (Internet Explorer), etc... dialog windows of type through the goodFile menu bar item. These don't seem to be able to have their size or their position to recall. For the latter, you can use the free programhttp://autosizer.en.softonic.com/to resize them.

    Here is another article on how to modify the columns in Windows Explorer and sort in Vista:http://www.vistax64.com/tutorials/108665-column-customize.html.  This will show you how Add, Remove, move, change the widthand change the sort order of the columns in Windows Explorer in the way that you want.

    Here is another article on how to change the display of the default folders in Vista (but she argues, it is not a perfect solution and can revert to the previous behavior is not as good as the two prior links provided:http://news.cnet.com/8301-13880_3-10019957-68.html.)

    I hope this helps in your situation.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to create (or delete) a new tag for a Web site, so that his tag appears (or does not appear) whenever I restart Firefox?

    How to create (or delete) a new tag for a Web site, so that his tag appears (or does not appear) whenever I restart Firefox?

    See this - https://support.mozilla.org/en-US/kb/How%20to%20set%20the%20home%20page

  • CHKUPD loads at startup. How to find and delete this file?

    CHKUPD loads at startup. How to find and delete this file?

    CHKUPD loads at startup. How to find and delete this file?

    Not a matter of Microsoft/Windows.

    http://answers.Microsoft.com/en-us/search/search?searchterm=CHKUPD&CurrentScope.ForumName=Windows&CurrentScope.filter=windows_xp-files&askingquestion=false

  • How to create and boot from a separate removable usb drive?

    Do some testing software and wish not to overwrite my MBR disk (c :))

    It's a matter of Google:

    http://www.google.com.au/search?hl=en&source=HP&q=How+to+Create+and+boot+from+a+separate+Removable+USB+Drive&btnG=Google+Search&Meta=&aq=f&OQ=

    Help us with the problems here with the Vista operating system installed.

    See you soon. Mick Murphy - Microsoft partner

  • How to create and apply a vc in jdev 12.2.1?

    Mr President

    How to create and apply a vc in jdev 12.2.1?

    I did like this, but do not know what my name of vc, it's VdetViewWhereCriteria.

    My name of vc is

    vc.png

    Concerning

    In the AppModule, you must select the view criteria.

    Open AppModule--> Data Model--> Select the VO (VdetView1)--> press the Edit button--> shuttle view criteria

    as:

  • How to add and delete pages in a pdf document?

    How to add and delete pages in a pdf document?

    The easiest way is to use the Page thumbnails Panel.

    But you can also use the Pages pane.

  • How to create and use Webservice using WSDL controls in weblogic portal10.3

    I have WSDL, how to create webservice control using WSDL in portal weblogic 10.3 and use these controls to call the Web service methods?
    Please give me the links of documents for this.

    Thank you

    Published by: user9041086 on August 12, 2010 09:26

    See the discussion below

    How to create and use Webservice using WSDL controls in weblogic portal10.3

    Thank you
    Vincent Sarvabatla

  • How to create a second partition on the hard drive?

    Hello to all members!

    I recently got some virus on my laptop. So I had to use my recovery cd to recover my system.
    Now the problem is that I have asked me for the partition where are the files are being extracted. I scored at 30 GB.
    Thus, windows works fine but do not appear my rest of 50 GB.
    I thought that the recovery cd will make a second partition as well, but he did not. Now how some other partitions?
    Second question related to the first is how long I can use this recovery disk. I mean windows will remain genuine?

    For the problem of the partition, I don't know of a few possible solutions of cause that I had need of three partitions, 30 GB 1st (Windows default) and two others of 25 GB.
    The best Solution to come in my mind is to make any windows ME or 98 bootable cd and run fdisk to create the remaining partitions.
    But's done it some new questions in my mind. Do I have to use a recovery again cd? If so I don't use this process causes once again he'll wonder partition extract windows files and I will choose 30 GB again.
    And again, it will remove additional partitions.

    Please, help me and erase the questions coming in my mind...

    [Edited by: admin on March 31, 2007 08:32]

    Hello

    Partition Magic 8 is my favorite.
    I use it to create partitions, Manager, mobile, etc. This tool is really great.

    > To how long I can use this recovery disk. I mean the windows remain authentic?
    I put t know what you mean exactly, but the image on the recovery CD is already activated and genuine.
    It s a full version of Windows OS

  • How to create the disk partition in vista

    I had a preloaded Vista laptop with a backup/restore partition.

    I would like to create another partition to install Windows7, can someone help me.

    the type held

    collyns abdulmujeer

    Hello

    read this information

    How to cut and create a Partition with Vista disk management

    http://www.Vistax64.com/tutorials/95398-disk-management-shrink-partition.html

    and read the related links, too

  • Windows 7 - How to create installation of the automatic system restore points

    After installing Norton 2010 Security Suite, my hp officejet pro 8500 printer stopped printing. When I tried to do a system restore, I found that I had only a restore point and that was created after the installation of Norton.

    Under XP, I had restore points created every day, automatically.

    How to configure the creation of automatic system restore points in Windows 7 Pro?

    Hello Mikeoncamano,

    Welcome to the Microsoft Answers site

    Turn on or turn off System Restore

    System Restore regularly changes made to your computer's system files and uses a feature called system protection to create restore points. System protection is turned on by default on the hard disk that Windows is installed. You can enable restoring the system for other disks by turning on system protection for these disks.

    You can not turn on protection system for a disc is formatted by using the FAT or FAT32 file systems.

    To turn on System Protection

    Open system by clicking Start , right-clicking computer, and then click Properties.

    In the left pane, click system protection.  If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.

    Under Parameters of Protection, click the disk, and then click Configure.

    Do one of the following:

    To be able to restore system settings and previous versions of files, click on restore system settings and previous versions of the file.

    To be able to only restore previous versions of files, click only restore previous versions of files.

    Click OK, and then click OK again.

    Kind regards

    It will create automatically restore points when there are changes to the computer or Windows.

    Disable your Norton protection system and check if she created the restore point...

    Bharath
    Microsoft technical support

  • How to create and print an 8 x 10 Headshot?

    I use LR CC and trying to learn how to create a picture of head of 8 x 10 with the names of customers in the text at the bottom of the photo.  8 x 10 must also have a white border around it.  Thanks in advance for anyone who can help me with this!

    The steps shown above do not address the case when you export the picture for later use

    1. Photos are automatically 'saved' in Lightroom; There is no need for to run you a "Save" command (or y at - it a "Save" command). File-> export creates a copy of the file on your external (or other) Player for later use. To include a text on the pictures, you need a plugin called Mogrify
    2. Ignore these instructions, they do not apply to your situation. You can apply corrections to several photos in any number of ways. You can do this via copy and paste at the bottom left of the develop module, buttons or by using automatic synchronization (see Auto Sync ' Blog of Julieanne Kost ")

    In addition, if you want to print at 8 x 10, you have to first harvest to a lengthening of the 8 x 10.

  • How to create the recovery partition

    How to create a recovery for OSX on an existing SSD partition?

    What Mac OS X you are using?

    To boot from OS X Recovery, hold down the command (⌘) r immediately after start-up or that you restart your Mac. Release when you see the Apple logo.

    More information on the recovery of the operating system partition: On OS X Recovery - Apple Support

    If you want to create a bootable USB, here is a useful guide: create a bootable OS x - Apple support Installer

Maybe you are looking for