A table of partitioning, as every hour

Hello

I want to create a table and this table has a 24 (fixed) partitions for data every hour. If the partition column (date type) key is equal to '2009-01-17 01:05:09 ', it must be written second partition. If key of partition column equals '2009-01-17 00:05:08 ', it must be written first partition, even if the partition key is equal to "2009-01-24 00:35:47"it must be written to new first partition. How can I create this partitioned table? If we have a chance to write the substr function in the partition key, I could handle by using the partitioning of the list, but there is no chance to write a function in the column name partitoin except the to_date function key. Can you give me an idea or an example?

I use Oracle 11.1.0.7.

Thank you.

Hoek wrote:
Hello

(Given that you're on 11g and I'm not, I can't give some info tested)

Before 11g, it was not possible to partition by a function.
http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:1612281449571 #378322100346018401

But maybe you could try also:

not tested

create table t( dt date )
partition by list (to_char(dt, 'hh24'))
(
partition h01 values ('1'),
partition h02 values ('2'),
partition h03 values ('3'),
partition h04 values ('4'),
partition h05 values ('5'),
--etc...
)
/  

I don't think that this is possible even in 11g. But you're heading in the right direction. Tom probably meant was partitioning by virtual columns that both have have been introduced in 11 g (virtual columns and partitioning by virtual columns).

Something like this maybe:

drop table test_part_virtual_column purge;

create table test_part_virtual_column
(
col1 date not null,
col2 varchar2(20),
col3 as (to_char(col1, 'HH24'))
)
partition by list (col3)
(
partition p_00 values ('00'),
partition p_01 values ('01'),
partition p_02 values ('02'),
partition p_03 values ('03'),
partition p_04 values ('04'),
partition p_05 values ('05'),
partition p_06 values ('06'),
partition p_07 values ('07'),
partition p_08 values ('08'),
partition p_09 values ('09'),
partition p_10 values ('10'),
partition p_11 values ('11'),
partition p_12 values ('12'),
partition p_13 values ('13'),
partition p_14 values ('14'),
partition p_15 values ('15'),
partition p_16 values ('16'),
partition p_17 values ('17'),
partition p_18 values ('18'),
partition p_19 values ('19'),
partition p_20 values ('20'),
partition p_21 values ('21'),
partition p_22 values ('22'),
partition p_23 values ('23')
);

insert into test_part_virtual_column (col1, col2) values (to_date('17/01/2009 01:05:09', 'DD/MM/YYYY HH24:MI:SS'), '1');

insert into test_part_virtual_column (col1, col2) values (to_date('17/01/2009 00:05:08', 'DD/MM/YYYY HH24:MI:SS'), '2');

insert into test_part_virtual_column (col1, col2) values (to_date('24/01/2009 00:35:47', 'DD/MM/YYYY HH24:MI:SS'), '3');

commit;

exec dbms_stats.gather_table_stats(null, 'test_part_virtual_column')

select partition_name, num_rows from user_tab_statistics where table_name = 'TEST_PART_VIRTUAL_COLUMN';

In pre - 11 g a trigger might help:

drop table test_part_nonvirtual_column purge;

-- pre 11g with trigger
create table test_part_nonvirtual_column
(
col1 date not null,
col2 varchar2(20),
col3 varchar2(2) not null
)
partition by list (col3)
(
partition p_00 values ('00'),
partition p_01 values ('01'),
partition p_02 values ('02'),
partition p_03 values ('03'),
partition p_04 values ('04'),
partition p_05 values ('05'),
partition p_06 values ('06'),
partition p_07 values ('07'),
partition p_08 values ('08'),
partition p_09 values ('09'),
partition p_10 values ('10'),
partition p_11 values ('11'),
partition p_12 values ('12'),
partition p_13 values ('13'),
partition p_14 values ('14'),
partition p_15 values ('15'),
partition p_16 values ('16'),
partition p_17 values ('17'),
partition p_18 values ('18'),
partition p_19 values ('19'),
partition p_20 values ('20'),
partition p_21 values ('21'),
partition p_22 values ('22'),
partition p_23 values ('23')
);

create trigger trg_test_part_nonvirtual_col
before insert
on test_part_nonvirtual_column
for each row
begin
  :new.col3 := to_char(:new.col1, 'HH24');
end;
/

insert into test_part_nonvirtual_column (col1, col2) values (to_date('17/01/2009 01:05:09', 'DD/MM/YYYY HH24:MI:SS'), '1');

insert into test_part_nonvirtual_column (col1, col2) values (to_date('17/01/2009 00:05:08', 'DD/MM/YYYY HH24:MI:SS'), '2');

insert into test_part_nonvirtual_column (col1, col2) values (to_date('24/01/2009 00:35:47', 'DD/MM/YYYY HH24:MI:SS'), '3');

commit;

exec dbms_stats.gather_table_stats(null, 'test_part_nonvirtual_column')

select partition_name, num_rows from user_tab_statistics where table_name = 'TEST_PART_NONVIRTUAL_COLUMN';

To the OP: why do you think you really need your table of partition by hours? Are you sure that this partitioning scheme is useful for the treatment of your data?

Kind regards
Randolf

Oracle related blog stuff:
http://Oracle-Randolf.blogspot.com/

SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676 /.
http://sourceforge.NET/projects/SQLT-pp/

Tags: Database

Similar Questions

  • Every hour until the disabled feature

    In the Web of the campaign, then the addition and modification of a segment, there is the option to add members hour segment until the campaign is disabled, or only once during activation. How deactivate and then reactivate a campaign would influence these two options? For example, if you have activated a campaign that had the segment members from all the hours until this campaign has been disabled, would be that reactivate if you re-activated the campaign?

    Hey rlfranco!

    Here are a few clarifications:

    If you add once upon activation and activate Monday to 8, it will shoot everyone in the segment at this time here. If disable you and re-enable it won't have new members, it will draw only ONCE during the FIRST activation.

    If you choose every hour until deactivated, it will check on an hourly basis and pull in the newest member of the segment. If the campaign is disabled, segment operates on his own time table and when re-activated it will be he who is in the segment at the time of the re-activation of the capture and still continue on a base schedule.

    Hope that helps!

  • How can I stop my Officejet Pro 8600 one beep every hour on the hour...

    HP Officejet Pro 8600 works very well but the hourly beep is very annoying.

    Hello The_Majar,

    Welcome to the HP Forums!

    I understand that your Officejet 8600 beeps every hour. I will do my best to help you! Please make sure that the printer is connected to a live wall, not a surge protector. I recommend this step, that the printer can not get enough power.

    Then, try to reset the printer for more information, then 60 seconds.

    Please post your results, I'll be looking forward to hear from you.

  • Connection Bluetooth for mobile phone disconnects every hour

    I connect my laptop to my cell phone (Palm Pixi to be exact) via Bluetooth and use it as a wireless router to connect to the internet. This is my only form of internet I have here in the Woods (Yes, I have cell phone coverage, but no cable/DSL). The only problem I have with it is that the Bluetooth connection is reset every hour since when I first connected to it when I turn on my computer. Normally, this isn't a problem for web browsing, since it will automatically reconnect, but I do a lot of games with her and sometimes download large files, and this reset can sometimes extremely boring all at stake in the middle of a fight and is enough to kill a large download. I searched Google many times on how to change the login/timeout settings and haven't found anything useful. Is that what I can do to change how long the Bluetooth remains connected without discount to zero/expire?

    I run Windows XP SP3 and I stack Bluetooth version 4.00.38 (also tried the latest version, the same question).

    Thanks in advance for any advice.

    What type of connection do you have on your mobile phone (DUN or NAP)?
    As far as I know there is time to stop for the connection of ONE of the side BONES (it was at least the case in XP).

  • Recording of data every hour, labview stops responding when the program stopped

    Hello. I'm doing a labview program to read the data and recording to a PDM file every hour for as long as it runs. First of all, I wanted to test it on every 15 minutes to work the bugs how. I made the attached VI and simulated data. It works fine but when I press the stop button to stop the program, the mouse cursor becomes the "wait cursor" and it remains like that until the program says "(ne répond pas) ' and then it crashes." Needless to say that the data is not recorded or corrupt. Do not do this with shorter time intervals (say, record data every 15 seconds). Is the long time period why its happening? Is there a better way to address the issue? Thank you!


  • Windows 2K 3 is removed from the network, every hour, sixth of its previous disconnection

    Hi all

    I have a problem here in a production environment. We use the combination W2K3 SP2 and SQL 2008. It is the server gets disconnected from the network, every hour, sixth of its previous logout. SQL resources are working well, but the server itself becomes not accessible. When I mean the server by its IP address or name DNS etc.

    While closely watching the issue, we found that even the RDP connection to it expires exactly at the same time. It's just an interruption of 10-30 seconds, and after him, everything is normal. Only clue is, it happens exactly every sixth hour. We also found his happens for all servers in the VIRTUAL local area network at the same time.

    Sixth hour that I mean, is the model... for example it happes to 09:15 then it will happen about 15:16 and then 21:17, then new tomorrow 03:18, 09:19, 15:20, 21:21 etc. If this isn't exactly every six hours, it every hour, sixth of its previous logout. The calendar is always in motion.

    Note:

    DHCP is not enabled on the server. Its configured to use a static ip address. The server is based. No DHCP server in the environment.
    Client DHCP is running on the machine to register DNS for the DNS server. No windows firewall is turned on.

    So its more like a configuration problem which is something set up to do something every time sixth from his previous instance.

    Please let me know if you think anything.

    Thank you
    Damien

    Hello

    We have a separate Department of Microsoft who work with servers. Thanks for posting your query in the link below:

    http://social.technet.Microsoft.com/forums/en-us/winserverfiles/threads

    Thank you

  • About every hour, without any warning or action by me, my PC suddenly goes into Shut Down and restart immediately.

    About every hour, without any warning or action by me, my PC suddenly goes into Shut Down and restart immediately.  Everything is as I left it.  But all this takes time.

    original title: How can I stop my PC restarted on every hour.

    still having problems?

  • [SPA3102] SIP recording every hour with the 401 error and directly 12 OK

    Location: INET-ADSL modem in bridge mode-SPA3102.
    Problem: not really, everything seems to work, can dial in and out.
    But...
    Because I'm curious, I have a logserver of installation and checked what happened every hour of registration.

    What I see in the syslog hourly the 3102 made re - enroll by the SIP provider, but first I think 401 Unauthorized een 12 error and measured, I see an OK message.

    Seems weird to me.

    The same thing happens when I compose, firstly a 401 that OK.

    Can someone explain why the first attempt gives an error and how to avoid this?

    Some details of syslog:

    I replaced a text in the syslog:

    x.x.x.x is real My outside IP address.
    yyyyyyyyy = my local phone number including the area code, such as 31201234567, 31 = NL, 20 = codeZone for Amsterdam
    username = username by my SIP provider

    message 1:
    REGISTER SIP:SIP.poivy.com SIP/2.0
    Via: SIP/2.0/UDP x.x.x.x:5060; direction = z9hG4bK-2283ef7b
    From: + 31yyyyyyyyy ; tag = c85fff819484d288o0
    To: + 31yyyyyyyyy
    Call ID: [email protected]

    CSeq: 6104 REGISTRY
    Max-Forwards: 70
    Authorization: Digest username = "username", realm = "sip.poivy.com", nonce = "1663445546", uri = "sip:sip.poivy.com", algorithm = MD5 response = "c8c5b94c384559bb490b59b72be1c674"
    Contact: + 31yyyyyyyyy ; expires = 3600
    User-Agent: Linksys/SPA3102-3.3.6(GW)
    Content-Length: 0
    Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFICATION OPTIONS, see
    Support: x-sipura

    Message 2:
    SIP/2.0 401 Unauthorized
    Via: SIP/2.0/UDP x.x.x.x:5060; direction = z9hG4bK-2283ef7b
    From: + 31yyyyyyyyy ; tag = c85fff819484d288o0
    To: + 31yyyyyyyyy
    Contact: sip:x.x.x.x:5060
    Call ID: [email protected]
    CSeq: 6104 REGISTRY
    Server: (very nice Sip Registrar/Proxy Server)
    Allow: ACK, BYE, CANCEL, INVITE, REGISTER, OPTIONS, INFO, MESSAGE
    WWW-Authenticate: Digest realm = "sip.poivy.com", nonce = "1667015687", algorithm = MD5
    Content-Length: 0

    Message 3:
    REGISTER SIP:SIP.poivy.com SIP/2.0
    Via: SIP/2.0/UDP x.x.x.x:5060; direction = z9hG4bK-4d7052c
    From: + 31yyyyyyyyy ; tag = c85fff819484d288o0
    To: + 31yyyyyyyyy
    Call ID: [email protected]

    CSeq: 6105 REGISTRY
    Max-Forwards: 70
    Authorization: Digest username = "username", realm = "sip.poivy.com", nonce = "1667015687", uri = "sip:sip.poivy.com", algorithm = MD5 response = "46f2176652c0ad8d27f8d3ad1cf72c24"
    Contact: + 31yyyyyyyyy ; expires = 3600
    User-Agent: Linksys/SPA3102-3.3.6(GW)
    Content-Length: 0
    Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFICATION OPTIONS, see
    Support: x-sipura

    Message 4:
    SIP/2.0 200 Ok
    Via: SIP/2.0/UDP x.x.x.x:5060; direction = z9hG4bK-4d7052c
    From: + 31yyyyyyyyy ; tag = c85fff819484d288o0
    To: + 31yyyyyyyyy
    Contact: + 31yyyyyyyyy ; expires = 3600
    Call ID: [email protected]

    CSeq: 6105 REGISTRY
    Server: (very nice Sip Registrar/Proxy Server)
    Allow: ACK, BYE, CANCEL, INVITE, REGISTER, OPTIONS, INFO, MESSAGE
    Content-Length: 0

    @hw: thank you for your tip and your right on the spot!

    Never, ever, thought of this way of "logging" in a system and use delberatley an error response. With your tip, I thought that allows to read the RFC and found RFC 3665. This RFC describes the Protocol SIP basic call flow. And there he was, almost at the beginning of the real story on page 5! The protocol uses a command register which gives a message of 401 error back just to be sure to avoid security problems "man in the middle" (if I understand correctly). He present a challenge and you the answer to a totalizer new order including your answer on the challenge. Which will lead to an OK return the message.

    To resume: nothing weird, it is as expected. My curiosity is frankly satisfied. Another day with what I've learned something. Thank you.

  • Phone keeps beep every hour approximately

    I don't know why, and it drives me crazy!
    Just after the upgrade to the lollipop, he started playing two beeps every hour or less, even at night with all the sounds are disabled. What should I try?

    Sorry for not responding earlier. I had other issues with my phone as broken my SD card and all my apps inside have been corrupted, so I had to format it completely and restore all applications and settings. Now, everything's fine.

  • How can I save a single file every hour?

    I have a folder on my desktop I want to back up every hour approximately. so that if something happens to him, I could just copy and paste the version, so I just want to make a copy of the file. For example, at the moment I'm just copy and paste the folder into another folder every time I check it, about once a day and it is very annoying and I would like to automate this process. The record is a world for a game and I want to copy the file every hour, so that I can have a selection that I can restore from. Sorry if im doing not a lot of sense. But if someone understands what says im and could help id be very grateful!

    Thanks in advance

    Hi Josh,.

    It is not possible on this specific issue.

    As an alternative, you can download and install the SkyDrive to Windows desktop application.

    You can add this file on SkyDrive and whenever you make changes, it will automatically change into the SkyDrive folder.

    You must be connected to the network, in order to get the changes take effect in the SkyDrive folder.

    For more information, see the articles:

    SkyDrive apps

    SkyDrive desktop application for Windows: frequently asked questions

    Hope the helps of information.

  • Every hour at the exact minute, my internet will disconnect me for a second, then reconnect

    As the title explains, I am disconnected for a second and then reconnected immediately.  It's annoying because I have to listen and do a lot of online games.  I don't know if it was a windows update it does, because a few months ago, I used to never have this problem.  I have this problem all the time now.  I'm sure that it is not my ISP, because my brother can never disconnects.  It's just my PC.  We have the exact same map network as well.

    I tried to do what he says to do in the link above with no result.  I did the first 2 methods.  I couldn't find the GUID in the method 3.  Help, please!  I don't really know what to do at this point and it's a very boring game experience!

    Not so much how strongly the processor is loaded, but if a process (or sub-process) is associated with the problem. The CPU chart will give you time to refine the search for any stray process that occurs every hour.

    J W Stuart: http://www.pagestart.com

  • Restart the computer every hour

    My computer restarts its self every hour on the hour. The first time I had this problem, I have re-installed Windows 7 64 bit because I wasn't sure the copy that is given to me. It worked great for a few months and yesterday that he started to do it again. I sleep off, screen never goes out, also I have it so it does not automatically restart, but it's almost as if I hold the power button to turn off. The only warning I get is the power will be rev and just restart. If I could get any help, it would be greatly appreciated.

    Critical Kernel-Power 41 05/04/2011-08:51:27 (63)
    Critical Kernel-Power 41 05/04/2011-07:51:37 (63)
    Critical Kernel-Power 41 05/04/2011-06:51:19 (63)
    Critical Kernel-Power 41 05/04/2011-05:51:02 (63)
    Critical Kernel-Power 41 05/04/2011-04:50:45 (63)
    Critical Kernel-Power 41 05/04/2011-03:50:27 (63)
    Criticism 05/04/2011 02:50:08 Kernel-Power 41 (63)
    Criticism 05/04/2011 01:49:50 Kernel-Power 41 (63)
    Critical 05/04/2011 12:49:32 AM Kernel-Power 41 (63)
    Critical Kernel-Power 41 04/04/2011-23:49:15 (63)
    Critical Kernel-Power 41 04/04/2011-22:48:58 (63)
    Critical Kernel-Power 41 04/04/2011-21:48:39 (63)
    Critical Kernel-Power 41 04/04/2011-20:48:21 (63)
    Critical Kernel-Power 41 04/04/2011-19:48:01 (63)
    Critical Kernel-Power 41 04/04/2011-18:47:44 (63)
    Critical Kernel-Power 41 04/04/2011-17:47:26 (63)
    Critical Kernel-Power 41 04/04/2011-16:47:08 (63)
    Critical Kernel-Power 41 04/04/2011-15:46:46 (63)
    Critical Kernel-Power 41 04/04/2011-14:46:33 (63)
    Critical Kernel-Power 41 04/04/2011-13:46:16 (63)
    Critical Kernel-Power 41 04/04/2011-12:45:58 (63)
    Critical Kernel-Power 41 04/04/2011-11:45:44 (63)

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

    Log name: System
    Source: Microsoft-Windows-Kernel-Power
    Date: 05/04/2011 08:51:27
    Event ID: 41
    Task category: (63)
    Level: critical
    Key words: (2).
    User: SYSTEM
    Computer: Tabby-PC
    Description:
    The system has rebooted without judgment properly first. This error can be caused if the system unresponsive, crashed or unexpected power loss.
    The event XML:

     
       
        41
        2
        1
        63
        0
        0 x 8000000000000002
       
        8237
       
       
        System
        Tabby-PC
       
     

     
        0
        0 x 0
        0 x 0
        0 x 0
        0 x 0
        fake
        0
     

    Heating issues - read this link unexpected shutdown

    To isolate a possible software problem, then follow the steps recommended in the Windows Explorer has stopped working [don't be put off by the title, it has a much wider applicability].

  • alter table Exchange partition

    Dear Experts,

    I could ask does change exchange table partition depends on the size of the table or partition?

    Thank you for your help.

    Best regards, Atanas.

    Hello Atanas,

    It's the good point: it does not depend on the size. Data is actually exchanged between the two segments, the work is only level 'dictionary': Oracle exchange the roles of both existing segments, it is now regarded as a table and the other as a partition, as opposed to their roles before the "swap partition.

    Thanks to this, Exchange a partition can be a very quick way of loading new data or old data archiving...

    Best regards

    Bruno Vroman.

  • Windows 8 freezes and gives the Blue error screen every hour approximately

    Hello guys. I have a problem with my system: windows 8 freezes and gives the Blue error screen every hour or more. usually it freezes, displays a blue error screen (clock watchdog timeout knode or not handled exception or something on a system request), I force restart it, and then it happens again (sometimes 3 - 4 times in a row, then it will be fine for another time). Here is the link to my dump leader : https://www.dropbox.com/s/uv27xr54esjlen0/MEMORY.DMP?dl... . The machine I built myself: amd fx 8350, card mother m5a97, dvd - r, 1 ssd, 1 hdd, PSU 500w, gtx 650 ti video. Also, here is a report of CPU monitor ID: https://www.dropbox.com/s/k1ma0m6maap404q/HWMonitor.txt... . I have already done all the windows, direct x updates and drivers and ran ideas
    If anyone has advice like how to do to solve this problem, please help me because I'm going crazy.

    Thank you.

    AS

    DMP file is corrupted and useless.  Please reconfigure your system for dmp files small as described in this wiki


    Please follow our instructions to find and download the files, we need to help you fix your computer. They can be found at here

    If you have any questions regarding the procedure, please ask

    Please provide us with your administrative Event Viewer logs by following these steps:
    Press Win + 'R' and type eventvwr > enter
    Expand custom views
    Click the administrative events
    Right-click Administrative events
    Record all events in custom view as...
    Save them to a folder where you will remember which folder and save it as Errors.evtx
    Go where you saved Errors.evtx
    Make a right click Errors.evtx-> send to compressed (zipped) folder of->
    Download the .zip for Onedrive or a file sharing service file and link to it in your next post

    *
    If you have updated to win 8.1 and you get the error message " " " the system cannot find the specified file" it is a known problem.  The work around is to change the registry.  If you are not comfortable doing this DON'T.  If you are, save the key before making
    Press Win + 'R' and enter regedit


    Navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels. Delete "Microsoft-Windows-DxpTaskRingtone/analytical.


  • When you add a Segment to the canvas of the campaign, you would add members every hour until the campaign turned in what scenario?

    Hello

    When you add a Segment to the canvas of the campaign, you would add members every hour until the campaign turned in what scenario?

    Thank you

    Hello...

    The segment will have new members added periodically, and you want that they are added to the campaign as soon as it happens

    Thank you

    edynamic expert Eloqua

Maybe you are looking for