Commit cb809124 authored by Erik Alexandre Pucci's avatar Erik Alexandre Pucci

database: Replanning the database and its data marts 2

Signed-off-by: default avatarErik Alexandre Pucci <eap08@c3sl.ufpr.br>
parent 1f0f6df9
......@@ -20,9 +20,9 @@
*/
CREATE TABLE mectb99_control (
ctr_id SERIAL PRIMARY KEY,
ctr_bd VARCHAR(2),
ctr_inicio VARCHAR,
ctr_fim VARCHAR,
ctr_total INTEGER
id SERIAL PRIMARY KEY,
bd VARCHAR(2),
inicio VARCHAR,
fim VARCHAR,
total INTEGER
);
......@@ -19,14 +19,6 @@
* USA.
*/
-- Enum type for the MEC Project which the machines belong to
CREATE TYPE MECPROJECT AS ENUM (
'Proinfo',
'UCAClassmate',
'UCAServer',
'Projector'
);
-- Enum type for the classification of the machines according to their
-- availability
CREATE TYPE CLASSIFICATION AS ENUM (
......
......@@ -19,14 +19,21 @@
* USA.
*/
--DROP DATABASE proinfodata;
CREATE DATABASE proinfodata;
\c proinfodata;
CREATE TABLE sa_inventory (
inep VARCHAR(16),
mac_address MACADDR,
-- Enum type for the MEC Project which the machines belong to
CREATE TYPE MECPROJECT AS ENUM (
'Proinfo',
'UCAClassmate',
'UCAServer',
'Projector'
);
CREATE TABLE saInventory (
INEP VARCHAR(10),
Machine MACADDR,
disco1_modelo TEXT,
disco1_capacidade INTEGER,
disco1_usado INTEGER,
......@@ -34,14 +41,25 @@ CREATE TABLE sa_inventory (
disco2_capacidade INTEGER,
disco2_usado INTEGER,
discos_ad INTEGER,
memoria INTEGER,
processador TEXT,
Memory INTEGER,
Processor TEXT,
so_nome TEXT,
so_distribuicao TEXT,
so_kernel TEXT,
uso_up INTEGER,
uso_down INTEGER,
data TIMESTAMP,
conexao BIT,
projeto INTEGER
ContactTime TIMESTAMP,
--data TIMESTAMP,
HasInternetConection BIT,
Project MECPROJECT
);
CREATE TABLE saNetworkUsage (
INEP VARCHAR(10),
Machine MACADDR,
ContactTime TIMESTAMP,
--net_data date,
--net_hora time without time zone,
net_pacotes_in integer,
net_bytes_in real,
net_pacotes_out integer,
net_bytes_out real
);
......@@ -19,10 +19,10 @@
* USA.
*/
GRANT INSERT ON sa_inventory TO my_user;
GRANT INSERT ON sa_network_usage TO my_user;
GRANT INSERT ON saInventory TO my_user;
GRANT INSERT ON saNetworkUsage TO my_user;
GRANT SELECT ON dim_school TO my_user;
GRANT SELECT ON dimSchool TO my_user;
GRANT SELECT ON mectb02_catalogo_dim TO my_user;
GRANT SELECT ON mectb03_data_dim TO my_user;
GRANT SELECT ON mectb04_maquina_dim TO my_user;
......@@ -30,9 +30,19 @@ GRANT SELECT ON mectb05_disponibilidade_fact TO my_user;
GRANT SELECT ON mectb06_uso_fact TO my_user;
GRANT SELECT ON mectb07_inventario_fact TO my_user;
GRANT SELECT ON dm_availability TO my_user;
GRANT SELECT ON dm_avail_history TO my_user;
GRANT SELECT ON dm_inventory TO my_user;
GRANT SELECT ON dm_audit TO my_user;
GRANT SELECT ON dm_installation_history TO my_user;
GRANT SELECT ON dm_network_usage TO my_user;
GRANT SELECT ON dmAvailState TO my_user;
GRANT SELECT ON dmAvailCity TO my_user;
GRANT SELECT ON dmAvailSchool TO my_user;
GRANT SELECT ON dmAvailMachine TO my_user;
GRANT SELECT ON dmAvailStateHistory TO my_user;
GRANT SELECT ON dmAvailCityHistory TO my_user;
GRANT SELECT ON dmInventMachine TO my_user;
GRANT SELECT ON dmAvailState TO my_user;
GRANT SELECT ON dmAvailCity TO my_user;
GRANT SELECT ON dmAvailSchool TO my_user;
GRANT SELECT ON dmAlertMachine TO my_user;
GRANT SELECT ON dmAlertStateHistory TO my_user;
GRANT SELECT ON dmAlertCityHistory TO my_user;
GRANT SELECT ON dmNetUsageState TO my_user;
GRANT SELECT ON dmNetUsageCity TO my_user;
GRANT SELECT ON dmNetUsageSchool TO my_user;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment