User Tools

Site Tools


informatica:oracle:comandos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatica:oracle:comandos [2013/07/18 08:12] joseinformatica:oracle:comandos [2024/06/19 09:46] (current) jose
Line 1: Line 1:
-Comprobar usuario bloqueado:+<code> 
 +SELECT 'DROP TABLE ' || owner || '.' || table_name || ' CASCADE CONSTRAINTS;' AS drop_command 
 +FROM all_tables 
 +WHERE owner = 'WZC_AUTHORIZATION_OWN'; 
 +</code> 
 + 
 +<code> 
 +set sqlformat insert; 
 +select * from WZC_AUTHORIZATION_OWN.AUTHORIZATION_CONFIGURATION; 
 +set sqlformat default; 
 +</code> 
 + 
 +====== Crear Usuario ====== 
 + 
 +  CREATE USER usuari IDENTIFIED BY contrasenya 
 + 
 +  GRANT CREATE SESSION TO usuari 
 + 
 + 
 + 
 +====== Comprobar usuario bloqueado: ====== 
 <code> <code>
 select username,account_status,profile from dba_users where username='jose' select username,account_status,profile from dba_users where username='jose'
Line 44: Line 65:
 ====== Cambiar contraseña ====== ====== Cambiar contraseña ======
   alter user user_name identified by new_password;   alter user user_name identified by new_password;
 +  
 +====== Porcentaje tablespaces ======
 +<code>
 +COLUMN tsname FORMAT a30
 +COLUMN allocation_type FORMAT A4 TRU HEADING ALLO
 +COLUMN contents FORMAT A4 TRU HEADING MGMT
 +COLUMN Tot_Size FORMAT 999,999 HEADING "TOTAL(M)"
 +COLUMN Tot_Free FORMAT 999,999 HEADING "FREE(M)"
 +COLUMN Pct_Free FORMAT 999 HEADING "FREE %"
 +COLUMN Fragments FORMAT 99,999 HEADING "FRAGMTS"
 +COLUMN Large_Ext FORMAT 999,999 HEADING "LARG(M)"
 +set lines 120
 +set feedback off pages 999 trims on
 +SELECT a.tablespace_name TSNAME, SUM(a.tots)/1048576 Tot_Size,
 +SUM(a.sumb)/1048576 Tot_Free,
 +SUM(a.sumb)*100/sum(a.tots) Pct_Free,
 +SUM(a.largest)/1048576 Large_Ext, SUM(a.chunks) Fragments,
 +b.contents, b.allocation_type
 +FROM (SELECt tablespace_name, 0 tots, SUM(bytes) sumb,
 +MAX(bytes) largest, COUNT(*) chunks
 +FROM dba_free_space a
 +GROUP BY tablespace_name
 +UNION
 +SELECT tablespace_name, SUM(bytes) tots, 0, 0, 0
 +FROM dba_data_files
 +GROUP BY tablespace_name
 +UNION
 +SELECT tablespace_name, SUM(bytes) tots, 0, 0, 0
 +FROM dba_temp_files
 +GROUP BY tablespace_name) a, dba_tablespaces b
 +WHERE b.tablespace_name = a.tablespace_name
 +GROUP BY a.tablespace_name, b.contents, b.allocation_type
 +ORDER BY 4
 +/
 +</code>
informatica/oracle/comandos.1374135138.txt.gz · Last modified: 2015/04/13 20:19 (external edit)