Estoy haciendo una base de datos de 0, he creado desde SYSTEM un usuario Administrador con estos privilegios:
Código PHP:
CREATE ROLE ADMIN;
CREATE USER ADMINISTRADOR IDENTIFIED BY ADMINISTRADOR;
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON USERS;
GRANT CREATE RESOURCE TO ADMIN;
GRANT CREATE USER TO ADMIN;
GRANT ALTER USER TO ADMIN;
GRANT CREATE SESSION TO ADMIN;
GRANT CREATE TABLE TO ADMIN;
C.SESSION.USER.
--R
C.USER.ROLE.
--R
GRANT ADMIN TO ADMINISTRADOR;
CREATE ROLE USERS;
GRANT CREATE RESOURCE TO USERS;
GRANT CREATE SESSION TO USERS;
GRANT UNLIMITED TABLESPACE TO USERS;
ALTER USER ADMINISTRADOR QUOTA UNLIMITED ON USERS;
Código PHP:
--------------------------------------------------------
-- TABLA MATERIAPRIMA
--------------------------------------------------------
CREATE TABLE MATERIAPRIMA
( "CODMP" VARCHAR2(20 BYTE) NOT NULL ENABLE,
"DESCRIP" VARCHAR2(40 BYTE),
CONSTRAINT "MATERIAPRIMA_PK" PRIMARY KEY ("CODMP"))
--------------------------------------------------------
-- TABLA INFOMP
--------------------------------------------------------
CREATE TABLE INFOMP
( "FECHARECEPCION" DATE,
"ALBARAN" NUMBER(*,0),
"PARTERECEPCION" NUMBER(*,0),
"LOTE" VARCHAR2(20 BYTE),
"CENTRADA" NUMBER(*,0),
"CSALIDA" NUMBER(*,0),
"CODMP" VARCHAR2(20 BYTE) NOT NULL ENABLE,
CONSTRAINT "INFOMP_FK1" FOREIGN KEY ("CODMP")
REFERENCES MATERIAPRIMA ("CODMP") ENABLE)
Código PHP:
---------------------------------------------------------
-- CREACIÓN USUARIOS DEL SISTEMA
---------------------------------------------------------
CREATE USER PRODUCCION IDENTIFIED BY PRODUCCION
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON USERS;
GRANT USERS TO PRODUCCION
CREATE USER ALMACEN IDENTIFIED BY ALMACEN
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON USERS;
CREATE USER ALMACEN IDENTIFIED BY ALMACEN
GRANT USERS TO ALMACEN;
Código PHP:
---------------------------------------------------------
--OTORGAR PERMISOS AL ROL USERS
---------------------------------------------------------
GRANT SELECT ON MATERIAPRIMA TO USERS;
GRANT UPDATE ON MATERIAPRIMA TO USERS;
GRANT INSERT ON MATERIAPRIMA TO USERS;
GRANT DELETE ON MATERIAPRIMA TO USERS;
GRANT SELECT ON INFOMP TO USERS;
GRANT UPDATE ON INFOMP TO USERS;
GRANT INSERT ON INFOMP TO USERS;
GRANT UPDATE ON INFOMP TO USERS;
Espero haberme explicado bien y que me podais echar un cable.