Skip to content

Instantly share code, notes, and snippets.

@olaferlandsen
Last active November 25, 2018 02:50
Show Gist options
  • Save olaferlandsen/bfb166e1e8b9df51b6465275abd6e7f6 to your computer and use it in GitHub Desktop.
Save olaferlandsen/bfb166e1e8b9df51b6465275abd6e7f6 to your computer and use it in GitHub Desktop.
Ejercicios base de datos
@olaferlandsen
Copy link
Author

olaferlandsen commented Nov 25, 2018

EJERCICIO 5.a

CREATE ROLE ROL_CONSULTA;
GRANT select ON PRUEBA.CLIENTE TO ROL_CONSULTA;
GRANT select ON PRUEBA.PEDIDO TO ROL_CONSULTA;
GRANT select ON PRUEBA.DETALLE_PEDIDO TO ROL_CONSULTA;
GRANT select ON PRUEBA.v_clientes TO ROL_CONSULTA;

CREATE ROLE ROL_CARDTIME;
GRANT select, update ON PRUEBA.CLIENTE TO ROL_CARDTIME;
GRANT select, update ON PRUEBA.PEDIDO TO ROL_CARDTIME;
GRANT select, update ON PRUEBA.DETALLE_PEDIDO TO ROL_CARDTIME;
GRANT select ON PRUEBA.V_EMPLEADOS_ICENTIVOSTO ROL_CARDTIME;

EJERCICIO 5.b

CREATE USER CONSULTA_USR IDENTIFIED BY "1234";
GRANT CONNECT, ROL_CONSULTA TO CONSULTA_USR ;
GRANT SELECT ON PRUEBA.EMPLEADO TO CONSULTA_USR;

CREATE USER CARDTIME_USR IDENTIFIED BY "1234";
GRANT CONNECT, RESOURCE, ROL_CARDTIME TO CARDTIME_USR ;
GRANT SELECT,UPDATE ON PRUEBA.EMPLEADO TO CARDTIME_USR;
GRANT SELECT ON PRUEBA.V_EMPLEADOS_INCENTIVOS TO CARDTIME_USR;
GRANT CREATE VIEW TO CARDTIME_USR;

EJERCICIO 5.c

CREATE PUBLIC SYNONYM EMPLEADO FOR PRUEBA.EMPLEADO;
CREATE PUBLIC SYNONYM CLIENTE FOR PRUEBA.CLIENTE;
CREATE PUBLIC SYNONYM PEDIDO FOR PRUEBA.PEDIDO;
CREATE PUBLIC SYNONYM DETALLE_PEDIDO FOR PRUEBA.DETALLE_PEDIDO;

CREATE SYNONYM CONSULTA_USR.V_CLIENTE FOR PRUEBA.V_CLIENTE;
CREATE SYNONYM CARDTIME_USR.V_CLIENTE FOR PRUEBA.V_CLIENTE;

EJERCICIO 5.d

CREATE SYNONYM CARDTIME_USR.V_EMPLEADOS_SUELDO FOR PRUEBA.V_EMPLEADOS_SUELDO;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment