Is there any subset of sql that deals specifically with horizontally fragmenting a table for distribution?
I have to fragment a stock table to be distributed between stores. Im not looking for a complete solution just a nod in the right direction.
I have founs an IBM example that does similar to what I want (i think)
CREATE TABLE Tab1 (Col1 INT...)
FRAGMENT BY RANGE (Col1 MIN 100 MAX 200)
IN db1, db2, db3, db4;
but I need an example for Oracle (up to 11g2).
If you want the data to be distributed between different Oracle databases (i.e. there is an Oracle database instance that is installed at each store), you would generally accomplish that by creating materialized views in each store's database that includes a predicate on whatever data the store needs access to.
If you want the data to distributed across multiple segments in the same database, you would use partitioning as @tbone suggested in his comment. From the CREATE TABLE documentation, for example, you can create a
SALES
table that is partitioned by quarter.