This requirement was achieved using database links. These are defined in this script link
This requirement was achieved using SYNONYMS for tables' names.
Scripts for each site:
This requirement was achieved using RECONSTRUCTION EXPRESSIONS for each entity:
These are views that use the reconstruction expressions.
For example, Sucursal view is:
'''sql create or replace view SUCURSAL as select sucursal_id,clave,es_taller,es_venta,nombre,latitud,longitud,url from SUCURSAL_f1 union all select sucursal_id,clave,es_taller,es_venta,nombre,latitud,longitud,url from SUCURSAL_f2 union all select sucursal_id,clave,es_taller,es_venta,nombre,latitud,longitud,url from SUCURSAL_f3 union all select sucursal_id,clave,es_taller,es_venta,nombre,latitud,longitud,url from SUCURSAL_f4; '''
As can be seen, reconstruction expression is used to show all rows from all entitie's fragments distributed across all nodes.
All views for all nodes are in 05-views-creation directory
This requirement was implemented using INSTEAD OF TRIGGERS for the views created for SELECT Fragmentation Transparency.
When INSERT or DELETE is made on a view, triggers operation on the corresponding entitie's fragment.
All scripts to create triggers can be found in 06-triggers directory
Instantaneous replication using Triggers to have the following tables replicated across all nodes:
- TIPO_PROCESADOR
- TIPO_TARJETA_VIDEO
- TIPO_ALMACENAMIENTO
- TIPO_MONITOR
These entities are replicated on all nodes, this is accomplished using INSTEAD OF TRIGGERS, when a DML operation is made on the view, triggers that operation to all nodes.
All scripts to create triggers can be found in 06-triggers directory