Professional Documents
Culture Documents
Administrao de Usurios
SQL> create user aluno identified by aluno;
User created.
SQL> conn aluno
Enter password:
ERROR:
ORA-01045: user ALUNO lacks CREATE SESSION privilege; logon denied
Warning: You are no longer connected to ORACLE.
SQL>
SQL> conn sys as sysdba
Enter password:
Connected.
SQL>
SQL> grant connect to aluno;
Grant succeeded.
SQL> conn aluno/aluno;
Connected.
SQL> select * from dual;
D
X
Quais so os privilgios que esse usurio possui? PUBLIC
SQL> shutdown immediate;
ORA-01031: insufficient privileges
SQL> conn sys as sysdba
Enter password:
Connected.
SQL> grant dba to aluno;
Grant succeeded.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 64bit Production
[root@localhost ~]# sqlplus aluno/aluno
SQL*Plus: Release 11.2.0.2.0 Production on Mon Oct 13 23:11:51 2014
Copyright (c) 1982, 2011, Oracle.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
[root@localhost ~]# sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Mon Oct 13 23:15:30 2014
Copyright (c) 1982, 2011, Oracle.
Enter password:
Connected to an idle instance.
SQL> startup;
ORACLE instance started.
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted.
Database opened.
839282688
2231136
507511968
327155712
2383872
bytes
bytes
bytes
bytes
bytes
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 64bit Production
[root@localhost ~]#
[root@localhost ~]# sqlplus aluno/aluno
SQL*Plus: Release 11.2.0.2.0 Production on Mon Oct 13 23:19:38 2014
Copyright (c) 1982, 2011, Oracle.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
Por que o erro aconteceu? Quando no se usa a clausula SYSDBA, o Oracle no verifica o
password file.
Enter user-name: aluno as sysdba
Enter password:
Connected to an idle instance.
Administrao de Perfis
SQL> create role r_select;
Role created.
SQL> create table tabela_1 as select * from dual;
Table created.
SQL> grant connect to r_select;
Grant succeeded.
SQL> grant select on tabela_1 to r_select;
Grant succeeded.
SQL> create user aluno2 identified by aluno2;
User created.
SQL> grant r_select to aluno2;
Grant succeeded.
SQL> conn aluno2/aluno2
Connected.
TYPE
VALUE
----------- -----------------------------string
/u01/app/oracle/admin/XE/adump
boolean
FALSE
string
string
NONE
SQL> quit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit
Production
[root@localhost ~]# sqlplus sys as sysdba;
[root@localhost ~]# cd /u01/app/oracle/admin/XE/adump/
VERIFICAR ARQUIVO DE AUDITORIA GERADO.
---------S--------------S------
SESSION REC
SESSION REC
SES_ACTIONS
---------------------------S--------------S--------------S------
ACTION_NAME
---------------------------SESSION REC
SESSION REC
SESSION REC