title: How to store periodicity in Oracle?
body: <p>Which column type should be used to store a periodicity in Oracle? </p>
  
  <ul>
  <li><em>Daily</em>: time, e. g. "14:00"</li>
  <li><em>Weekly</em>: day of week, time, e. g. "Mon 14:00"</li>
  <li><em>Monthly</em>: day of month, time, e. g. "24 14:00"</li>
  <li><em>Yearly</em>: month, day, time, e. g. "12-24 14:00"</li>
  <li><em>Week of year</em>: calendar week, day, time, e. g. "W01 Mon 14:00"</li>
  </ul>
  
  <p>Especially because of the calendar week I guess storing a pattern as text in <a href="https://de.wikipedia.org/wiki/ISO_8601" rel="nofollow noreferrer">ISO 8601 format</a> could work. Or is there a better solution that works e. g. on timestamps?</p>
  
  <p>The intent is only to store a pattern in the database. This pattern will then be used to create a periodicity for dates in a given time interval.</p>
  
  <p>Example using Jodatime in Java:</p>
  
  <pre><code>Start DateTime: 2017-01-01
  End DateTime: 2017-01-03
  Periodicity: Daily, 02:00 - 06:00 
  (this is what my question is about, i. e. how to store it)
  </code></pre>
  
  <p>In Java the following intervals will be created using these data, the created intervals will not be stored in the database, they'll be only processed:</p>
  
  <pre><code>2017-01-01 02:00 - 2017-01-01 06:00
  2017-01-02 02:00 - 2017-01-02 06:00
  </code></pre>