SET LINESIZE 3500
SET PAGESIZE   10000
SET VERIFY     OFF
SET FEEDBACK   OFF

alter session set nls_numeric_characters = ',.';

SET FEEDBACK   OFF
DEFINE parametro = ''
COLUMN parametro_val NOPRINT NEW_VALUE parametro
SELECT '&&1' parametro_val FROM dual;

SET FEEDBACK   OFF
DEFINE numrows = ''
COLUMN numrows_val NOPRINT NEW_VALUE numrows
SELECT '&&2' numrows_val FROM dual;

--SELECT '&parametro' FROM dual;

@@header_dbinfo 107 DC


begin
    dbms_output.put_line('  ');
    dbms_output.put_line('-------------------------------------------------------------------------------------------------');
    dbms_output.put_line('Lista parametros:');

    dbms_output.put(rpad(' - db_cache_size',25,' '));	    
    dbms_output.put(rpad(' - db_keep_cache_size',25,' '));	    
    dbms_output.put(rpad(' - db_recycle_cache_size',25,' '));	    
    dbms_output.put(rpad(' - db_2k_cache_size',25,' '));	    
    dbms_output.put_line(rpad(' - db_4k_cache_size',25,' '));

    dbms_output.put(rpad(' - db_8k_cache_size',25,' '));	    
    dbms_output.put(rpad(' - db_16k_cache_size',25,' '));	    
    dbms_output.put(rpad(' - db_32k_cache_size',25,' '));	    
    dbms_output.put(rpad(' - inmemory_size',25,' '));	    
    dbms_output.put_line(rpad(' - java_pool_size',25,' '));

    dbms_output.put(rpad(' - large_pool_size',25,' '));	    
    dbms_output.put(rpad(' - shared_pool_size',25,' '));	    
    dbms_output.put_line(rpad(' - streams_pool_size',25,' '));	    

    dbms_output.put_line('-------------------------------------------------------------------------------------------------');

end;
/

CLEAR COLUMNS
COLUMN tipo      FORMAT A12             HEADING "Operacion"
COLUMN modo      FORMAT A9             HEADING "Modo"
COLUMN parameter FORMAT A17            HEADING "Parameter"
COLUMN start FORMAT A17            HEADING "start"
COLUMN end FORMAT A17            HEADING "end"
COLUMN initial   FORMAT 99999 HEADING "Initial_mb"
COLUMN target   FORMAT 99999 HEADING "Target_mb"
COLUMN final   FORMAT 99999 HEADING "Final_mb"

select tipo,modo,parameter,"start","end","initial","target","final",status
from(
SELECT oper_type tipo,oper_mode modo,parameter,to_char(start_time,'ddmmyyyy hh24:mi:ss') "start",
to_char(end_time,'ddmmyyyy hh24:mi:ss') "end", 
initial_size/1024/1024 "initial",target_size/1024/1024 "target",final_size/1024/1024 "final",status
FROM V$SGA_RESIZE_OPS
WHERE parameter = lower('&parametro') and component not like 'ASM%'
order by end_time desc
)
where rownum < &numrows;

undefine &1
undefine &parametro
