You are on page 1of 13

will be assigned to substitution variables in the script.

When SQL*Plus starts, and after CONNECT commands, the site profile (e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile (e.g. login.sql in the working directory) are run. The files may contain SQL*Plus commands.

Refer to the SQL*Plus User's Guide and Reference for more information.

C:\Users\Estudiante> C:\Users\Estudiante> C:\Users\Estudiante>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Mi Feb 19 14:54:14 2014

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

ERROR: ORA-01031: insufficient privileges

Enter user-name: system Enter password:

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

SQL> creater user dbejemplo identified by dbejemplo; SP2-0734: unknown command beginning "creater us..." - rest of line ignored. SQL> create user dbejemplo identified by dbejemplo;

User created.

SQL> create user dbaejemplo identified by dbaejemplo;

User created.

SQL> grant all to dbaejemplo; grant all to dbaejemplo * ERROR at line 1: ORA-01919: role 'ALL' does not exist

SQL> grant all previleges to dbaejemplo; grant all previleges to dbaejemplo * ERROR at line 1: ORA-00990: missing or invalid privilege

SQL> grant all previlege to dbaejemplo;

grant all previlege to dbaejemplo * ERROR at line 1: ORA-00990: missing or invalid privilege

SQL> grant all privileges to dbaejemplo;

Grant succeeded.

SQL> connect dbaejemplo/dbaejemplo Connected. SQL> create user mjackson identified gy abc; create user mjackson identified gy abc * ERROR at line 1: ORA-00924: missing BY keyword

SQL> create user mjackson identified by abc;

User created.

SQL> create user sleon identified by abc;

User created.

SQL> grant create session to mjackson;

Grant succeeded.

SQL> grant create table to mjackson;

Grant succeeded.

SQL> ALTER USER mjackson DEFAULT TABLESPACE USERS;

User altered.

SQL> ALTER USER mjackson QUOTA UNLIMITED ON USERS ;

User altered.

SQL> connect mjackson/abc Connected. SQL> CREATE TABLE EMPLEADOS(OID NUMBER, NOMBRES VARCHAR2(30));

Table created.

SQL> CREATE ROLE ADMINISTRADOR; CREATE ROLE ADMINISTRADOR *

ERROR at line 1: ORA-01031: insufficient privileges

SQL> connect dbaejemplo/dbaejemplo; Connected. SQL> CREATE ROLE ADMINISTRADOR;

Role created.

SQL> GRANT CREATE SESSION TO ADMINISTRADOR;

Grant succeeded.

SQL> GRANT CREATE TABLE TO ADMINISTRADOR;

Grant succeeded.

SQL> GRANT ADMINISTRADOR TO SLEON;

Grant succeeded.

SQL> GRANT ADMINISTRADOR TO mjackson WITH ADMIN OPTION;

Grant succeeded.

SQL> create user pedroperez identified by pedroperez;

User created.

SQL> GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez; GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez * ERROR at line 1: ORA-00942: table or view does not exist

SQL> GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez; GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez * ERROR at line 1: ORA-00942: table or view does not exist

SQL> GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez; GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez * ERROR at line 1: ORA-00942: table or view does not exist

SQL> grant select,insert,delete on empleados to pedroperez;

grant select,insert,delete on empleados to pedroperez * ERROR at line 1: ORA-00942: table or view does not exist

SQL> grant select, insert, delete on empleados to pedroperez; grant select, insert, delete on empleados to pedroperez * ERROR at line 1: ORA-00942: table or view does not exist

SQL> GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez; GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez * ERROR at line 1: ORA-00942: table or view does not exist

SQL> CREATE TABLE EMPLEADOS(OID NUMBER, NOMBRES VARCHAR2(30));

Table created.

SQL> GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez;

Grant succeeded.

SQL> ALTER USER pedroperez DEFAULT ROLE NONE 2 create role operarios; create role operarios * ERROR at line 2: ORA-00922: missing or invalid option

SQL> ALTER USER pedroperez DEFAULT ROLE NONE 2 CREATE ROLE OPERARIOS; CREATE ROLE OPERARIOS * ERROR at line 2: ORA-00922: missing or invalid option

SQL> ALTER USER pedroperez DEFAULT ROLE NONE 2 create role operarios 3 SQL> ALTER USER pedroperez DEFAULT ROLE NONE;

User altered.

SQL> CREATE ROLE OPERARIOS;

Role created.

SQL> GRANT OPERARIOS TO pedroperez;

Grant succeeded.

SQL> GRANT ADMINISTRADOR TO pedroperez;

Grant succeeded.

SQL> ALTER USER pedroperez DEFAULT ROLE OPERARIOS;

User altered.

SQL> create profile usrfinales 2 limit 3 PASSWORD_LIFE_TIME 365 4 PASSWORD_GRACE_TIME 10 5 PASSWORD_REUSE_TIME UNLIMITED 6 PASSWORD_REUSE_MAX 0 7 FAILED_LOGIN_ATTEMPTS 3 8 PASSWORD_LOCK_TIME UNLIMITED; FAILED_LOGIN_ATTEMPTS 3 * ERROR at line 7:

ORA-02377: invalid resource limit

SQL> create profile usrfinales; create profile usrfinales * ERROR at line 1: ORA-02000: missing LIMIT keyword

SQL> create profile usrfinales 2 limit; create profile usrfinales * ERROR at line 1: ORA-02379: profile USRFINALES already exists

SQL> delete profile userfinales 2 limit; limit * ERROR at line 2: ORA-00933: SQL command not properly ended

SQL> create profile usrfinales1 2 limit;

Profile created.

SQL> create profile usrfinales 2 limit 3 PASSWORD_LIFE_TIME 365 4 PASSWORD_GRACE_TIME 10 5 PASSWORD_REUSE_TIME UNLIMITED 6 PASSWORD_REUSE_MAX 0 7 FAILED_LOGIN_ATTEMPTS 3 8 PASSWORD_LOCK_TIME UNLIMITED; FAILED_LOGIN_ATTEMPTS 3 * ERROR at line 7: ORA-02377: invalid resource limit

SQL> create profile usrfinales2 2 limit 3 PASSWORD_LIFE_TIME 365 4 PASSWORD_GRACE_TIME 10 5 PASSWORD_REUSE_TIME UNLIMITED 6 PASSWORD_REUSE_MAX 0 7 PASSWORD_LOCK_TIME UNLIMITED;

PASSWORD_LOCK_TIME UNLIMITED * ERROR at line 7: ORA-02377: invalid resource limit

SQL> create profile usrfinales 2 limit 3 PASSWORD_LIFE_TIME 365 maximo contrasea un ao 4 PASSWORD_GRACE_TIME 10. Cuando revoco cuanto tiempo puede estar entrando ocn la contrasea hasta que el se canse 5 PASSWORD_REUSE_TIME UNLIMITED que le cambie 6 PASSWORD_REUSE_MAX 5 7 FAILED_LOGIN_ATTEMPTS 3 tres o lo saca intentos 8 PASSWORD_REUSE_TIME UNLIMITED tiempo en que va ha estar la contrasea ilimitado

Bnnnnnnnnnnnnnnnnnnnnnnnnnn create profile usrfinales4 limit PASSWORD_LIFE_TIME 365 PASSWORD_GRACE_TIME 10 PASSWORD_REUSE_TIME UNLIMITED PASSWORD_REUSE_MAX 5 FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME UNLIMITED;

create user pedroperez1 identified by abc profile usrfinales;

GRANT SELECT, INSERT, DELETE ON EMPLEADOS TO pedroperez1; alter profile usrfinales set failed_login_attempts = 4; intentar ingresar a un sistema y se bloque automticamente .. alter profile usrfinales4 limit failed_login_attempts 6;

eliminar usuarios SELECT SID, SERIAL#, USERNAME FROM V$SESSION;