User Tools

Site Tools


informatica:oracle:sqlplus

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
Last revisionBoth sides next revision
informatica:oracle:sqlplus [2015/07/15 12:19] joseinformatica:oracle:sqlplus [2017/06/15 19:57] jose
Line 6: Line 6:
   SQL> show user;   SQL> show user;
   USER is "SYS"   USER is "SYS"
 +  
 +Saber en que BBDD estoy:
 +  show parameter db_name
 +  
 +Version
 +  SELECT * FROM V$VERSION;
 +  SELECT version FROM V$INSTANCE;
  
- +Espaco 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/sqlplus.txt · Last modified: 2019/11/06 13:00 by jose