PROMPT Por Favor ingrese los siguientes Datos ( CTRL + C para cancelar ): 
accept pathData char prompt '    Ubicaci�n datafiles de Datos   (LNX_DATA_?): ';
accept pathIndx char prompt '    Ubicaci�n datafiles de Indices (LNX_INDX_?): ';
accept passSys  char prompt '    Contrase�a usuario SYS : ';
accept passSystem  char prompt '    Contrase�a usuario SYSTEM : ';

PROMPT --> Creando Tablespace LNX_DATA_A en &pathData
 
CREATE TABLESPACE LNX_DATA_A
    LOGGING 
    DATAFILE '&pathData/lnx_data_a01.dbf' SIZE 2100M
    AUTOEXTEND ON NEXT 20M
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace LNX_DATA_D en &pathData

CREATE TABLESPACE LNX_DATA_D
    LOGGING 
    DATAFILE '&pathData/lnx_data_d01.dbf' SIZE 20000M 
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace LNX_DATA_M en &pathData

CREATE TABLESPACE LNX_DATA_M
    LOGGING 
    DATAFILE '&pathData/lnx_data_m01.dbf' SIZE 6700M
    AUTOEXTEND ON NEXT  20M
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace LNX_INDX_A en &pathIndx

CREATE TABLESPACE LNX_INDX_A
    LOGGING 
    DATAFILE '&pathIndx/lnx_indx_a01.dbf' SIZE 1500M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace LNX_INDX_D en &pathIndx

CREATE TABLESPACE LNX_INDX_D
    LOGGING 
    DATAFILE '&pathIndx/lnx_indx_d01.dbf' SIZE 20000M 
    AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace LNX_INDX_M en &pathIndx

CREATE TABLESPACE LNX_INDX_M
    LOGGING 
    DATAFILE '&pathIndx/lnx_indx_m01.dbf' SIZE 8100M 
    AUTOEXTEND ON NEXT  20M
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace LNX_USER en &pathData

CREATE TABLESPACE LNX_USER
    LOGGING
    DATAFILE '&pathData/lnx_user01.dbf' SIZE 5000M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace LNX_TEMP en &pathData

CREATE 
    TEMPORARY TABLESPACE LNX_TEMP TEMPFILE 
    '&pathData/lnx_temp01.dbf' SIZE 1500M EXTENT 
    MANAGEMENT LOCAL UNIFORM SIZE 50M;

CREATE 
    TEMPORARY TABLESPACE LNX_TEMP2 TEMPFILE 
    '&pathIndx/lnx_temp02.dbf' SIZE 1500M EXTENT 
    MANAGEMENT LOCAL UNIFORM SIZE 50M;

PROMPT --> Creando Tablespace LNX_ADT_DATA_A en &pathData

CREATE TABLESPACE LNX_ADT_DATA_A
    LOGGING 
    DATAFILE '&pathData/lnx_adt_data_a01.dbf' SIZE 15M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT  AUTO;

PROMPT --> Creando Tablespace LNX_ADT_DATA_D en &pathData

CREATE TABLESPACE LNX_ADT_DATA_D
    LOGGING 
    DATAFILE '&pathData/lnx_adt_data_d01.dbf' SIZE 6700M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace LNX_ADT_DATA_M en &pathData

CREATE TABLESPACE LNX_ADT_DATA_M
    LOGGING 
    DATAFILE '&pathData/lnx_adt_data_m01.dbf' SIZE 6100M
    AUTOEXTEND ON NEXT  20M
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT  AUTO;

PROMPT --> Creando Tablespace LNX_ADT_INDX_A en &pathIndx

CREATE TABLESPACE LNX_ADT_INDX_A
    LOGGING 
    DATAFILE '&pathIndx/lnx_adt_indx_a01.dbf' SIZE 15M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT  AUTO;

PROMPT --> Creando Tablespace LNX_ADT_INDX_D en &pathIndx

CREATE TABLESPACE LNX_ADT_INDX_D
    LOGGING 
    DATAFILE '&pathIndx/lnx_adt_indx_d01.dbf' SIZE 8700M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT  AUTO;

PROMPT --> Creando Tablespace LNX_ADT_INDX_M en &pathIndx

CREATE TABLESPACE LNX_ADT_INDX_M
    LOGGING 
    DATAFILE '&pathIndx/lnx_adt_indx_m01.dbf' SIZE 1100M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT  AUTO;

PROMPT --> Creando Tablespace LNX_ADT_USER en &pathData

CREATE TABLESPACE LNX_ADT_USER
    LOGGING 
    DATAFILE '&pathData/lnx_adt_user01.dbf' SIZE 35M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT  AUTO;

PROMPT --> Creando Tablespace BOD_DATA_H en &pathData

CREATE TABLESPACE BOD_DATA_H 
    LOGGING 
    DATAFILE '&pathData/bod_data_h01.dbf' SIZE 500M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace BOD_DATA_D en &pathData

CREATE TABLESPACE BOD_DATA_D 
    LOGGING 
    DATAFILE '&pathData/bod_data_d01.dbf' SIZE 20M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace BOD_INDX_H en &pathIndx

CREATE TABLESPACE BOD_INDX_H
    LOGGING 
    DATAFILE '&pathIndx/bod_indx_h01.dbf' SIZE 1100M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace BOD_INDX_D en &pathIndx

CREATE TABLESPACE BOD_INDX_D
    LOGGING 
    DATAFILE '&pathIndx/bod_indx_d01.dbf' SIZE 20M 
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando Tablespace BOD_USER en &pathData

CREATE TABLESPACE BOD_USER
    LOGGING 
    DATAFILE '&pathData/bod_user01.dbf' SIZE 70M
    AUTOEXTEND ON NEXT  20M 
    MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL 
    SEGMENT SPACE MANAGEMENT AUTO;

PROMPT --> Creando profile LINIX 

CREATE PROFILE LINIX LIMIT
  SESSIONS_PER_USER UNLIMITED
  CPU_PER_SESSION UNLIMITED
  CPU_PER_CALL UNLIMITED
  CONNECT_TIME UNLIMITED
  IDLE_TIME UNLIMITED
  LOGICAL_READS_PER_SESSION UNLIMITED
  LOGICAL_READS_PER_CALL UNLIMITED
  COMPOSITE_LIMIT UNLIMITED
  PRIVATE_SGA UNLIMITED
  FAILED_LOGIN_ATTEMPTS 10
  PASSWORD_LIFE_TIME UNLIMITED
  PASSWORD_REUSE_TIME UNLIMITED
  PASSWORD_REUSE_MAX UNLIMITED
  PASSWORD_LOCK_TIME 1
  PASSWORD_GRACE_TIME 7
  PASSWORD_VERIFY_FUNCTION NULL;

PROMPT --> Creando rol para LINIX LNXADT BODEGA

CREATE ROLE LNX NOT IDENTIFIED;
Grant CREATE CLUSTER to "LNX";
Grant CREATE INDEXTYPE to "LNX";
Grant CREATE OPERATOR to "LNX";
Grant CREATE PROCEDURE to "LNX";
Grant CREATE SEQUENCE to "LNX";
Grant CREATE SESSION to "LNX";
Grant CREATE TABLE to "LNX";
Grant CREATE TRIGGER to "LNX";
Grant CREATE TYPE to "LNX";
Grant CREATE VIEW to "LNX";
Grant ALTER SESSION to "LNX";
Grant ALTER USER to "LNX";
Grant CREATE USER to "LNX";
Grant DELETE ANY TABLE to "LNX";
Grant EXECUTE ANY PROCEDURE to "LNX";
Grant INSERT ANY TABLE to "LNX";
Grant SELECT ANY SEQUENCE to "LNX";
Grant SELECT ANY TABLE to "LNX";
Grant UPDATE ANY TABLE to "LNX";


PROMPT --> Creando Usuario LNXADT ( Clave LNXADT )

CREATE USER LNXADT PROFILE LINIX 
    IDENTIFIED BY LNXADT DEFAULT TABLESPACE LNX_ADT_USER 
    TEMPORARY TABLESPACE LNX_TEMP 
    ACCOUNT UNLOCK;

PROMPT --> Creando Usuario LINIX ( Clave LINIX )

CREATE USER LINIX PROFILE LINIX 
    IDENTIFIED BY LINIX DEFAULT TABLESPACE LNX_USER 
    TEMPORARY TABLESPACE LNX_TEMP2 
    ACCOUNT UNLOCK;

PROMPT --> Creando Usuario LINIX ( Clave LINIX )

CREATE USER BODEGA PROFILE LINIX 
    IDENTIFIED BY LINIX DEFAULT TABLESPACE LNX_USER 
    TEMPORARY TABLESPACE LNX_TEMP 
    ACCOUNT UNLOCK;

PROMT --> Dando privilegios al rol LNX

Grant "LNX" to "LINIX";
Grant "U_CONECTAR" to "LINIX";
Grant "U_FINAL" to "LINIX";
Grant CREATE PUBLIC SYNONYM to "LINIX";
Grant CREATE SESSION to "LINIX";
Grant CREATE TRIGGER to "LINIX";
Grant DROP PUBLIC SYNONYM to "LINIX";
Grant INSERT ANY TABLE to "LINIX";
Grant SELECT ANY DICTIONARY to "LINIX";
Grant SELECT ANY TABLE to "LINIX";
Grant UNLIMITED TABLESPACE to "LINIX";
Grant EXECUTE on SYS."DBMS_RANDOM" to "LINIX";
Grant EXECUTE on SYS."UTL_FILE" to "LINIX";
Grant EXECUTE on SYS."UTL_HTTP" to "LINIX";
Grant EXECUTE on SYS."UTL_SMTP" to "LINIX";
Grant EXECUTE on XDB."DBMS_XSLPROCESSOR" to "LINIX";
Grant EXECUTE on SYS."DBMS_RESOURCE_MANAGER_PRIVS" to "LINIX";
Grant EXECUTE on SYS."DBMS_RULE_ADM" to "LINIX";
Grant EXECUTE on SYS."DBMS_AQADM" to "LINIX";
Grant EXECUTE on XDB."DBMS_XMLPARSER" to "LINIX";
Grant EXECUTE on SYS."UTL_TCP" to "LINIX";
Grant "LNX" to "LNXADT";
Grant CREATE PUBLIC SYNONYM to "LNXADT";
Grant CREATE SESSION to "LNXADT";
Grant SELECT ANY DICTIONARY to "LNXADT";
Grant SELECT ANY TABLE to "LNXADT";
Grant UNLIMITED TABLESPACE to "LNXADT";
Grant EXECUTE on SYS."DBMS_RANDOM" to "LNXADT";
Grant EXECUTE on SYS."UTL_FILE" to "LNXADT";
Grant EXECUTE on SYS."UTL_HTTP" to "LNXADT";
Grant EXECUTE on SYS."UTL_SMTP" to "LNXADT";
Grant EXECUTE on SYS."UTL_TCP" to "LNXADT";
Grant EXECUTE on XDB."DBMS_XSLPROCESSOR" to "LNXADT";
Grant EXECUTE on SYS."DBMS_RULE_ADM" to "LNXADT";
Grant EXECUTE on SYS."DBMS_AQADM" to "LNXADT";
Grant EXECUTE on SYS."DBMS_AQADM" to "LNXADT";
Grant EXECUTE on XDB."DBMS_XMLPARSER" to "LNXADT";
Grant EXECUTE on SYS."DBMS_RESOURCE_MANAGER_PRIVS" to "LNXADT";

PROMT --> Asignando rol a los usuarios LINIX LNXADT BODEGA

ALTER USER LINIX DEFAULT ROLE LNX;
ALTER USER LNXADT DEFAULT ROLE LNX;
ALTER USER BODEGA DEFAULT ROLE LNX;

PROMPT --> Creando rol LNXWEB

CREATE ROLE LNXWEB NOT IDENTIFIED;

PROMPT --> Creando Usuario WEB ( Clave WEB )

CREATE USER WEB PROFILE LINIX 
    IDENTIFIED BY WEB DEFAULT TABLESPACE LNX_USER 
    TEMPORARY TABLESPACE LNX_TEMP2 
    ACCOUNT UNLOCK;

GRANT LNXWEB TO LINIX WITH ADMIN OPTION;
GRANT LNXWEB TO SYS WITH ADMIN OPTION;
GRANT LNXWEB TO WEB;
Grant CREATE SESSION to "LNXWEB";
Grant DELETE on LINIX."AP1962TCLIXEMP" to "LNXWEB";
Grant DELETE on LINIX."AP1973MEMPADI" to "LNXWEB";
Grant DELETE on LINIX."AP1974TCLIXNOM" to "LNXWEB";
Grant DELETE on LINIX."TP1956REPTEMP" to "LNXWEB";
Grant DELETE on LINIX."WE1219TSESION" to "LNXWEB";
Grant DELETE on LINIX."WE1308TPARAMET" to "LNXWEB";
Grant DELETE on LINIX."GO1915DREPOSI" to "LNXWEB";
Grant DELETE on LINIX."CC1990DDOCUME" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AHORRO_PROGRAMADO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AP_AP016" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AP_AP150" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AP_AP1960" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AP_AP1961" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AP_AP1962" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AP_AP1973" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AP_AP794" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AP_EMPRESAS_COMPL" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_AUTENTICAR" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_BENEFICIO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CA_CA097" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CDT" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CENTROS_VAC" to "LNXWEB";
Grant EXECUTE on LINIX."PK_DR_GENERAR" to "LNXWEB";
Grant EXECUTE on LINIX."PK_DR_VENCIMIENTO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_GR_GMF" to "LNXWEB";
Grant EXECUTE on LINIX."PK_GR_MOVIMIENTO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_GR_PARAMETRO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_GR_PARAMGENER" to "LNXWEB";
Grant EXECUTE on LINIX."PK_CA_PARAMETRO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_GR_REGLAS" to "LNXWEB";
Grant EXECUTE on LINIX."PK_GR_XML" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CONSULTA" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CONSULTAR_DETALLE_DOC" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CONSULTAR_DOCUMENTO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CONSULTA_GARANTIA_CDT" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CONSULTA_GARANTIA_CHEQUE" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CONSULTA_GARANTIA_HIPO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CONSULTA_GARANTIA_VEHIC" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CREAR_CUENTA_AHORRO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_CREAR_SEGURO_SERVICIO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_DESCARGUE_DOCUMENTOS" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_DISPONIBILIDAD" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_ENVIAR_CORREO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_FLUJO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_FORMA_PAGO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_FORMULARIO_DINAMICO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_GENERAL" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_GO_GO1910" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_GR" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_GR_GENERAL" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_GR_GR001" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_GR_GR005" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_GR_GR1191" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_GR_RNG_CWAHP009" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_MENU" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_MOSTRAR_CUENTA_AHORRO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_PAGARE" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_PLASTICO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_PQ_PQRS" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_PRELIQUI" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_REGISTRO_DOCUMENTO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_REGLA" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_REPORTE" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_REPORTE_AHORRPROG" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_REQUISITO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_SEGYSERV" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_SIMULAR" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_TP_TP1956" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_TRANSACCION" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_TR_TRANS_SOLIDARIA" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_VEHICULO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_WORKFLOW" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_XML" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WF_FLUJO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WF_PARAMETRO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_GR_CONTROL_ERROR" to "LNXWEB";
Grant EXECUTE on LINIX."PK_GR_FECHA" to "LNXWEB";
Grant EXECUTE on LINIX."PK_CU_ACTUALIZAR_PRODUCTO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_CU_GENERAL" to "LNXWEB";
Grant EXECUTE on LINIX."PK_CU_VIGENCIA_SUGERIDA" to "LNXWEB";
Grant EXECUTE on LINIX."PK_AP_ACTUALIZACION_WEB" to "LNXWEB";
Grant EXECUTE on LINIX."PK_AP_ACTUALIZACION_WEB_WF" to "LNXWEB";
Grant EXECUTE on LINIX."PK_AP_AFILIACION" to "LNXWEB";
Grant EXECUTE on LINIX."PK_AP_AP014" to "LNXWEB";
Grant EXECUTE on LINIX."PK_CA_CICLO" to "LNXWEB";
Grant EXECUTE on LINIX."PK_CA_CONDIC_CLIENTE" to "LNXWEB";
Grant EXECUTE on LINIX."PK_CA_FUNCION" to "LNXWEB";
Grant EXECUTE on LINIX."PK_CA_FUNUNIMONET" to "LNXWEB";
Grant EXECUTE on LINIX."PK_DR_CANCELA_DS" to "LNXWEB";
Grant EXECUTE on LINIX."PK_DR_FUNCAUSAC" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_ACTUALIZA_WF" to "LNXWEB";
Grant EXECUTE on LINIX."PK_WE_ADMINPLAST" to "LNXWEB";
Grant INSERT on LINIX."AP1962TCLIXEMP" to "LNXWEB";
Grant INSERT on LINIX."AP1973MEMPADI" to "LNXWEB";
Grant INSERT on LINIX."AP1974TCLIXNOM" to "LNXWEB";
Grant INSERT on LINIX."TP1956REPTEMP" to "LNXWEB";
Grant INSERT on LINIX."WE1219TSESION" to "LNXWEB";
Grant INSERT on LINIX."WE1308TPARAMET" to "LNXWEB";
Grant INSERT on LINIX."GO1915DREPOSI" to "LNXWEB";
Grant INSERT on LINIX."CC1990DDOCUME" to "LNXWEB";
Grant SELECT on LINIX."CAV_CA104" to "LNXWEB";
Grant SELECT on LINIX."CC149MCONCOB" to "LNXWEB";
Grant SELECT on LINIX."CC164GCTACOB" to "LNXWEB";
Grant SELECT on LINIX."CC172TAJUSCTA" to "LNXWEB";
Grant SELECT on LINIX."AP150TEMPRESA" to "LNXWEB";
Grant SELECT on LINIX."AP1962TCLIXEMP" to "LNXWEB";
Grant SELECT on LINIX."AP1973MEMPADI" to "LNXWEB";
Grant SELECT on LINIX."AP1974TCLIXNOM" to "LNXWEB";
Grant SELECT on LINIX."CA796DREQXSOLI" to "LNXWEB";
Grant SELECT on LINIX."CA080TDESTINAC" to "LNXWEB";
Grant SELECT on LINIX."CA083MMODALIDA" to "LNXWEB";
Grant SELECT on LINIX."CA090MGSOLCRED" to "LNXWEB";
Grant SELECT on LINIX."CA093MDSOLCRED" to "LNXWEB";
Grant SELECT on LINIX."AX1184MGSOLICI" to "LNXWEB";
Grant SELECT on LINIX."CU066MGDOCUMEN" to "LNXWEB";
Grant SELECT on LINIX."CU067MDDOCUMEN" to "LNXWEB";
Grant SELECT on LINIX."CU1477MPERETEX" to "LNXWEB";
Grant SELECT on LINIX."CC1990DDOCUME" to "LNXWEB";
Grant SELECT on LINIX."CC232TAJUSCONT" to "LNXWEB";
Grant SELECT on LINIX."CG_REF_CODES" to "LNXWEB";
Grant SELECT on LINIX."AX1173MAUXILIO" to "LNXWEB";
Grant SELECT on LINIX."CA765TREQUISIT" to "LNXWEB";
Grant SELECT on LINIX."CA142MDSOLICOD" to "LNXWEB";
Grant SELECT on LINIX."GR1752DPRODXMO" to "LNXWEB";
Grant SELECT on LINIX."AH386MCLASIFIC" to "LNXWEB";
Grant SELECT on LINIX."AP014MCLIENTE" to "LNXWEB";
Grant SELECT on LINIX."AP016MDEFNOMIN" to "LNXWEB";
Grant SELECT on LINIX."WF1728DMODXAPL" to "LNXWEB";
Grant SELECT on LINIX."CD401TPARAMETR" to "LNXWEB";
Grant SELECT on LINIX."CD842MDPARTASA" to "LNXWEB";
Grant SELECT on LINIX."GR815MPROFESIO" to "LNXWEB";
Grant SELECT on LINIX."GRV_AH135_CA104_CO057_DR044" to "LNXWEB";
Grant SELECT on LINIX."GRV_CA104_CC164_CC165_DR044_0" to "LNXWEB";
Grant SELECT on LINIX."CA1520MESTSOEC" to "LNXWEB";
Grant SELECT on LINIX."CA651MGRADICAC" to "LNXWEB";
Grant SELECT on LINIX."AP484TCLAVECLI" to "LNXWEB";
Grant SELECT on LINIX."AP568TCAURETIR" to "LNXWEB";
Grant SELECT on LINIX."AP570DSOLICRET" to "LNXWEB";
Grant SELECT on LINIX."AP794DNOVESTCL" to "LNXWEB";
Grant SELECT on LINIX."CD388TTIPOCDT" to "LNXWEB";
Grant SELECT on LINIX."WE1219TSESION" to "LNXWEB";
Grant SELECT on LINIX."WE1305MFORMSOL" to "LNXWEB";
Grant SELECT on LINIX."WE1308TPARAMET" to "LNXWEB";
Grant SELECT on LINIX."GO1915DREPOSI" to "LNXWEB";
Grant SELECT on LINIX."GR001MTERCERO" to "LNXWEB";
Grant SELECT on LINIX."GR002MCIUDAD" to "LNXWEB";
Grant SELECT on LINIX."GR003MDEPARTAM" to "LNXWEB";
Grant SELECT on LINIX."GR005MDIRECCIO" to "LNXWEB";
Grant SELECT on LINIX."GR021MSUCURSAL" to "LNXWEB";
Grant SELECT on LINIX."GR023TBANCO" to "LNXWEB";
Grant SELECT on LINIX."GR027MTIPOMOVI" to "LNXWEB";
Grant SELECT on LINIX."CA284DDESTXMOD" to "LNXWEB";
Grant SELECT on LINIX."GR1068MGRUPFAM" to "LNXWEB";
Grant SELECT on LINIX."GR1191MPROMOTO" to "LNXWEB";
Grant SELECT on LINIX."GR1201TCORREO" to "LNXWEB";
Grant SELECT on LINIX."GR1202TDESTINA" to "LNXWEB";
Grant SELECT on LINIX."GR028G0000" to "LNXWEB";
Grant SELECT on LINIX."GR147TSALDOCLI" to "LNXWEB";
Grant SELECT on LINIX."GR1512MZONANEG" to "LNXWEB";
Grant SELECT on LINIX."GR1518MNEGOCIO" to "LNXWEB";
Grant SELECT on LINIX."GR1519DNEGXUBI" to "LNXWEB";
Grant SELECT on LINIX."CA563TFACTTASA" to "LNXWEB";
Grant SELECT on LINIX."DR039MTIPDOCRE" to "LNXWEB";
Grant SELECT on LINIX."DR041MGDOCUMEN" to "LNXWEB";
Grant SELECT on LINIX."AH136MCUENTA" to "LNXWEB";
Grant SELECT on LINIX."AD054MUSUAXSUC" to "LNXWEB";
Grant SELECT on LINIX."AD078MUSUARIO" to "LNXWEB";
Grant SELECT on LINIX."TS072MCAJA" to "LNXWEB";
Grant SELECT on LINIX."TS574AFORMAPAG" to "LNXWEB";
Grant SELECT on LINIX."DR1534DAHORENO" to "LNXWEB";
Grant SELECT on LINIX."DR013MPARCONTA" to "LNXWEB";
Grant SELECT on LINIX."TP1956REPTEMP" to "LNXWEB";
Grant SELECT on LINIX."TP671MDVENCIMI" to "LNXWEB";
Grant UPDATE on LINIX."AP1962TCLIXEMP" to "LNXWEB";
Grant UPDATE on LINIX."AP1973MEMPADI" to "LNXWEB";
Grant UPDATE on LINIX."AP1974TCLIXNOM" to "LNXWEB";
Grant UPDATE on LINIX."CC1990DDOCUME" to "LNXWEB";
Grant UPDATE on LINIX."TP1956REPTEMP" to "LNXWEB";
Grant UPDATE on LINIX."WE1219TSESION" to "LNXWEB";
Grant UPDATE on LINIX."WE1308TPARAMET" to "LNXWEB";
Grant UPDATE on LINIX."GO1915DREPOSI" to "LNXWEB";
Grant UPDATE on LINIX."AP484TCLAVECLI" to "LNXWEB";
ALTER USER WEB DEFAULT ROLE LNXWEB;

PROMPT --> Creando rol COPIA

CREATE ROLE COPIA NOT IDENTIFIED;

PROMPT --> Creando Usuario COPIA ( Clave COPIA )

CREATE USER COPIA PROFILE LINIX IDENTIFIED BY COPIA;

GRANT CREATE SESSION, COPIA TO COPIA;
GRANT EXP_FULL_DATABASE, IMP_FULL_DATABASE, UNLIMITED TABLESPACE, COPIA TO COPIA;

ALTER USER COPIA DEFAULT ROLE COPIA;

PROMPT --> Creando Directorio Data_pump

CREATE OR REPLACE DIRECTORY DATA_PUMP_DIR_LINIX AS '/media/datos/imp';
GRANT READ, WRITE ON DIRECTORY DATA_PUMP_DIR_LINIX TO COPIA;

PROMPT --> Conectando como SYSDBA

CONNECT sys/&passSys as sysdba;

ALTER SYSTEM SET OPEN_CURSORS=19400 SCOPE=SPFILE;
ALTER SYSTEM SET UNDO_MANAGEMENT=AUTO SCOPE=SPFILE;
ALTER SYSTEM SET PROCESSES=300 SCOPE=SPFILE;
ALTER SYSTEM SET UTL_FILE_DIR=* SCOPE=SPFILE;

PROMPT --> Bajando Instancia 

SHUTDOWN IMMEDIATE;

PROMPT --> Generando archivo Init[Instancia].ora

CREATE PFILE FROM SPFILE;

PROMPT --> Subiendo la Instancia
STARTUP;

PROMPT --> Conectando como SYSTEM
CONNECT SYSTEM/&passSystem

PROMPT --> Creando ROL U_CONECTAR

CREATE ROLE "U_CONECTAR"  NOT IDENTIFIED;
Grant CREATE SESSION to "U_CONECTAR";
Grant EXECUTE ANY PROCEDURE to "U_CONECTAR";
Grant SELECT on LINIX."GR021MSUCURSAL" to "U_CONECTAR";
Grant SELECT on LINIX."AD078MUSUARIO" to "U_CONECTAR";
Grant SELECT on LINIX."AD054MUSUAXSUC" to "U_CONECTAR";

PROMPT --> Creando ROL U_FINAL

CREATE ROLE "U_FINAL"  NOT IDENTIFIED;
Grant ALTER SESSION to "U_FINAL";
Grant ALTER USER to "U_FINAL";
Grant CREATE SESSION to "U_FINAL";
Grant DELETE ANY TABLE to "U_FINAL";
Grant EXECUTE ANY PROCEDURE to "U_FINAL";
Grant INSERT ANY TABLE to "U_FINAL";
Grant SELECT ANY SEQUENCE to "U_FINAL";
Grant SELECT ANY TABLE to "U_FINAL";
Grant UPDATE ANY TABLE to "U_FINAL";
