Trabajo. Revisión de privilegios de usuario
Enviado por jbastos291 • 14 de Febrero de 2019 • Biografía • 1.190 Palabras (5 Páginas) • 89 Visitas
Clase 01-02-2019
SQL> set linesize 140
SQL> column profile format a8
SQL> column password format a6
SQL> column username format a10
SQL> select username, password, account_status, lock_date, default_tablespace, profile from dba_users;
[pic 1]
Donde coloca las cosas el usuario SYS o system o dbsnmp
Owner: propietario
[pic 2]
Revisión de privilegios de usuario.
[pic 3]
[pic 4]
[pic 5][pic 6]
HR CONS01 (select)[pic 7]
Propietario de las bd
[pic 8]
OPERA01 (select, update, delete, insert)
Esquema
Usuario+ objetos (tablas, índices, vistas, procesos,…)
Desbloquear el usuario
[pic 9]
SQL> connect hr/hr
Connected.
SQL> select * from cat where table_type='TABLE';
TABLE_NAME TABLE_TYPE
------------------------------ -----------
REGIONS TABLE
LOCATIONS TABLE
JOB_HISTORY TABLE
JOBS TABLE
EMPLOYEES TABLE
DEPARTMENTS TABLE
COUNTRIES TABLE
7 rows selected.
SQL> SELECT * FROM REGIONS;
REGION_ID REGION_NAME
---------- -------------------------
1 Europe
2 Americas
3 Asia
4 Middle East and Africa
SQL> DESCR REGIONS;
Name Null? Type
----------------------------------------------------------------------------- -------- ----------------------------------------------------
REGION_ID NOT NULL NUMBER
REGION_NAME VARCHAR2(25)
27 rows selected.
SQL> SELECT DEPARTMENT_ID, DEPARTMENT_NAME FROM DEPARTMENTS &CLAUS; (PARA INCLUIR UN PATRON O FILTRO)
Enter value for claus: WHERE DEPARTMENT_ID>100
old 1: SELECT DEPARTMENT_ID, DEPARTMENT_NAME FROM DEPARTMENTS &CLAUS
new 1: SELECT DEPARTMENT_ID, DEPARTMENT_NAME FROM DEPARTMENTS WHERE DEPARTMENT_ID>100
DEPARTMENT_ID DEPARTMENT_NAME
------------- ------------------------------
110 Accounting
120 Treasury
130 Corporate Tax
140 Control And Credit
150 Shareholder Services
160 Benefits
170 Manufacturing
180 Construction
190 Contracting
200 Operations
210 IT Support
DEPARTMENT_ID DEPARTMENT_NAME
------------- ------------------------------
220 NOC
230 IT Helpdesk
240 Government Sales
250 Retail Sales
260 Recruiting
270 Payroll
17 rows selected.
SQL> SELECT DEPARTMENT_ID, DEPARTMENT_NAME FROM DEPARTMENTS &CLAUS;
...