MERCADOS FINANCIEROS

sábado, 20 de junio de 2020

CREATE USER ROLE DBA

SQL> grant sysdba to dbo;

SQL> revoke sysdba from dbo;

SQL>SELECT grantee,granted_role from DBA_ROLE_PRIVS where granted_role='DBA';

select * from v$pwfile_users;

SQL> select * from v$pwfile_users;

USERNAME        SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM     CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS        TRUE  TRUE  FALSE FALSE FALSE FALSE     0
SYSDG        FALSE FALSE FALSE FALSE TRUE  FALSE     0
SYSBACKUP        FALSE FALSE FALSE TRUE  FALSE FALSE     0
SYSKM        FALSE FALSE FALSE FALSE FALSE TRUE     0


set define on 
prompt 'Digite el nombre de usuario:' "&&USERNAME"
CREATE USER "&USERNAME" PROFILE "DBA" IDENTIFIED BY XXXXXX PASSWORD EXPIRE DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK;

GRANT ADMINISTER ANY SQL TUNING SET TO "&USERNAME" ;
GRANT ADMINISTER DATABASE TRIGGER TO "&USERNAME" ;
GRANT DBA TO "&USERNAME" ;
GRANT SYSDBA TO "&USERNAME" ;
GRANT ADMINISTER SQL TUNING SET TO "&USERNAME" ;
GRANT ADVISOR TO "&USERNAME" ;
GRANT ALTER ANY INDEX TO "&USERNAME" ;
GRANT ALTER ANY INDEXTYPE TO "&USERNAME" ;
GRANT ALTER ANY MATERIALIZED VIEW TO "&USERNAME" ;
GRANT ALTER ANY PROCEDURE TO "&USERNAME" ;
GRANT ALTER ANY SEQUENCE TO "&USERNAME" ;
GRANT ALTER ANY TABLE TO "&USERNAME" ;
GRANT ALTER ANY TRIGGER TO "&USERNAME" ;
GRANT ALTER DATABASE TO "&USERNAME" ;
GRANT ALTER SESSION TO "&USERNAME" ;
GRANT ALTER SYSTEM TO "&USERNAME" ;
GRANT ALTER TABLESPACE TO "&USERNAME" ;
GRANT ALTER USER TO "&USERNAME" ;
GRANT ANALYZE ANY TO "&USERNAME" ;
GRANT ANALYZE ANY DICTIONARY TO "&USERNAME" ;
GRANT BACKUP ANY TABLE TO "&USERNAME" ;
GRANT BECOME USER TO "&USERNAME" ;
GRANT CREATE ANY DIRECTORY TO "&USERNAME" ;
GRANT CREATE DATABASE LINK TO "&USERNAME" ;
GRANT CREATE JOB TO "&USERNAME" ;
GRANT CREATE PROFILE TO "&USERNAME" ;
GRANT CREATE ROLE TO "&USERNAME" ;
GRANT CREATE PUBLIC DATABASE LINK TO "&USERNAME" ;
GRANT CREATE PUBLIC SYNONYM TO "&USERNAME" ;
GRANT CREATE SESSION TO "&USERNAME" ;
GRANT EXECUTE ANY PROCEDURE TO "&USERNAME" ;
GRANT EXPORT FULL DATABASE TO "&USERNAME" ;
GRANT FLASHBACK ANY TABLE TO "&USERNAME" ;
GRANT GRANT ANY OBJECT PRIVILEGE TO "&USERNAME" ;
GRANT GRANT ANY PRIVILEGE TO "&USERNAME" ;
GRANT GRANT ANY ROLE TO "&USERNAME" ;
GRANT IMPORT FULL DATABASE TO "&USERNAME" ;
GRANT MANAGE TABLESPACE TO "&USERNAME" ;
GRANT RESTRICTED SESSION TO "&USERNAME" ;
GRANT SELECT ANY DICTIONARY TO "&USERNAME" ;
GRANT SELECT ANY SEQUENCE TO "&USERNAME" ;
GRANT SELECT ANY TABLE TO "&USERNAME" ;
GRANT "DBA" TO "&USERNAME" ;
GRANT "EXECUTE_CATALOG_ROLE" TO "&USERNAME" ;
GRANT "EXP_FULL_DATABASE" TO "&USERNAME" ;
GRANT "GATHER_SYSTEM_STATISTICS" TO "&USERNAME" ;
GRANT "IMP_FULL_DATABASE" TO "&USERNAME" ;
GRANT "MGMT_USER" TO "&USERNAME" ;
GRANT "OEM_ADVISOR" TO "&USERNAME" ;
GRANT "OEM_MONITOR" TO "&USERNAME" ;
GRANT "SELECT_CATALOG_ROLE" TO "&USERNAME" ;

No hay comentarios: