Está en la página 1de 5

Gu�a 4 - parte 1 - Perfiles de usuario

0. Definir cada par�metro que se indica a continuaci�n:


COMPOSITE_LIMIT =
SESSION_PER_USER =
CPU_PER_SESSION =
CPU_PER_CALL =
LOGICAL_READS_PER_SESSION =
LOGICAL_READS_PER_CALL=
IDLE_TIME =
CONNECT_TIME =
PRIVATE_SGA =
FAILED_LOGIN_ATTEMPTS =
PASSWORD_LIFE_TIME =
PASSWORD_REUSE_TIME =
PASSWORD_REUSE_MAX =
PASSWORD_VERIFY_FUNCTION =
PASSWORD_LOCK_TIME =
PASSWORD_GRACE_TIME =

1. Verificar que usuarios de base de datos o que roles tienen asignado el


privilegio �CREATE PROFILE�.

2.
Crear un usuario(utilizar su nombre)
CREATE USER nombre IDENTIFIED BY FRIEND
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA 500K ON USERS;

asignarle al usuario creado en el punto anterior el permiso de CREATE PROFILE por


medio del rol de nombre perfiles00

3. Crear un perfil llamado perfil01 con las siguientes especificaciones:


Sessions_per_user : 2
Cpu_per_session : unlimited
Cpu_per_call : 6000
Connect_time : 480
Idle_time : 2
Failed_login_attempts : 2
Password_life_time : 120

create profile perfil01 limit sessions_per_user 2 cpu_per_session unlimited


cpu_per_call 6000 connect_time 480 idle_time 2 failed_login_attempts 2
password_life_time 120;

4. Verificar el perfil creado en la base de datos y que


l�mites de recursos fija cada uno de ellos.

select profile, resource_name,


resource_type, limit from dba_profiles where PROFILE='PERFIL01' order by
profile,resource_name;

5. Asignar el perfil anterior al usuario creado por usted.


alter user nombre profile perfil01;

6. Intentar la conexi�n dos veces con el usuario creado por usted,fallando la


contrase�a, �qu� sucede?.

7. Comprobar si la cuenta ha sido bloqueada en la vista de base de


datos correspondiente.

select username, lock_date from dba_users where username like 'NOMBRE%';

8. Desbloquear la cuenta del usuario.

9. Crear un usuario clase desde system, con el par�metro password expire, sus
tablespace por defecto y temporal ser�n USERS (cuota 0k) y TEMP. Asignar
roles que permitan crear session. Conectarse al usuario y comentar �qu� sucede?

create user clase identified by FRIEND


default tablespace users
temporary tablespace temp
quota 0k on users
password expire;

Comente:

Microsoft Windows [Versión 10.0.19041.928]


(c) Microsoft Corporation. Todos los derechos reservados.

C:\Users\falco>SQLplus

SQL*Plus: Release 11.2.0.2.0 Production on Vie Abr 30 14:43:35 2021

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Enter user-name: system


Enter password:

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> select * from dba_tab_privs where privilege='CREATE PROFILE';

no rows selected

SQL> select * from dba_sys_privs where privilege='CREATE PROFILE';

GRANTEE PRIVILEGE ADM


------------------------------ ---------------------------------------- ---
SYS CREATE PROFILE NO
DBA CREATE PROFILE YES
IMP_FULL_DATABASE CREATE PROFILE NO
DATAPUMP_IMP_FULL_DATABASE CREATE PROFILE NO

SQL> CREATE USER diego IDENTIFIED BY FRIEND


2 DEFAULT TABLESPACE USERS
3 TEMPORARY TABLESPACE TEMP
4 QUOTA 500K ON USERS;
User created.

SQL> CREATE ROLE perfiles00;

Role created.

SQL> grant CREATE PROFILE to perfiles00;

Grant succeeded.

SQL> grant perfiles00 to diego;

Grant succeeded.

SQL> create profile perfil01 limit sessions_per_user 2 cpu_per_session unlimited


2 cpu_per_call 6000 connect_time 480 idle_time 2 failed_login_attempts 2
3 password_life_time 120;

Profile created.

SQL> select profile, resource_name,


2 resource_type, limit from dba_profiles where PROFILE='PERFIL01' order by
profile, resource_name;

PROFILE RESOURCE_NAME RESOURCE


------------------------------ -------------------------------- --------
LIMIT
----------------------------------------
PERFIL01 COMPOSITE_LIMIT KERNEL
DEFAULT

PERFIL01 CONNECT_TIME KERNEL


480

PERFIL01 CPU_PER_CALL KERNEL


6000

PROFILE RESOURCE_NAME RESOURCE


------------------------------ -------------------------------- --------
LIMIT
----------------------------------------
PERFIL01 CPU_PER_SESSION KERNEL
UNLIMITED

PERFIL01 FAILED_LOGIN_ATTEMPTS PASSWORD


2

PERFIL01 IDLE_TIME KERNEL


2

PROFILE RESOURCE_NAME RESOURCE


------------------------------ -------------------------------- --------
LIMIT
----------------------------------------
PERFIL01 LOGICAL_READS_PER_CALL KERNEL
DEFAULT
PERFIL01 LOGICAL_READS_PER_SESSION KERNEL
DEFAULT

PERFIL01 PASSWORD_GRACE_TIME PASSWORD


DEFAULT

PROFILE RESOURCE_NAME RESOURCE


------------------------------ -------------------------------- --------
LIMIT
----------------------------------------
PERFIL01 PASSWORD_LIFE_TIME PASSWORD
120

PERFIL01 PASSWORD_LOCK_TIME PASSWORD


DEFAULT

PERFIL01 PASSWORD_REUSE_MAX PASSWORD


DEFAULT

PROFILE RESOURCE_NAME RESOURCE


------------------------------ -------------------------------- --------
LIMIT
----------------------------------------
PERFIL01 PASSWORD_REUSE_TIME PASSWORD
DEFAULT

PERFIL01 PASSWORD_VERIFY_FUNCTION PASSWORD


DEFAULT

PERFIL01 PRIVATE_SGA KERNEL


DEFAULT

PROFILE RESOURCE_NAME RESOURCE


------------------------------ -------------------------------- --------
LIMIT
----------------------------------------
PERFIL01 SESSIONS_PER_USER KERNEL
2

16 rows selected.

SQL> alter user diego profile perfil01;

User altered.

SQL> disc
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit
Production
SQL> conn
Enter user-name: diego
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
SQL> conn
Enter user-name: diego
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

SQL> conn
Enter user-name: system
Enter password:
Connected.

SQL> select username, lock_date from dba_users where username like 'DIEGO%';

USERNAME LOCK_DAT
------------------------------ --------
DIEGO 30/04/21

SQL> alter user diego account unlock;

User altered.

SQL> create user clase identified by FRIEND


2 default tablespace users
3 temporary tablespace temp
4 quota 0k on users
5 password expire;

User created.

SQL>

También podría gustarte