undefine TotalMemory
col name format a30
col value format a30
col status format a30
set pages 10000
set lines 180

select name, to_char(value) value, case when value <= 2000 then '*' else '' end                                 || 2000 Status from v$parameter where NAME = lower('open_cursors')
UNION ALL
select name, to_char(value/1024/1024/1024), case when value/1024/1024/1024 >=  (&&TotalMemory*60/100) then '*' else '' end || (&&TotalMemory*60/100) Status from v$parameter where NAME = lower('sga_max_size')
UNION ALL
select name, to_char(value/1024/1024/1024), case when value/1024/1024/1024 >=  (&&TotalMemory*60/100) then '*' else '' end || (&&TotalMemory*60/100) Status from v$parameter where NAME = lower('sga_target')
UNION ALL
select name, to_char(value/1024/1024/1024), case when value/1024/1024/1024 >=  (select value/1024/1024/1024*60/100-0.100 from v$parameter where NAME = lower('sga_target') ) then '*' else '' end || (select value/1024/1024/1024*60/100-0.100 from v$parameter where NAME = lower('sga_target') ) Status from v$parameter where NAME = lower('shared_pool_size')
UNION ALL
select name, to_char(value/1024/1024/1024), case when value/1024/1024/1024 >=  (select value/1024/1024/1024*40/100-0.100 from v$parameter where NAME = lower('sga_target') ) then '*' else '' end || (select value/1024/1024/1024*40/100-0.100 from v$parameter where NAME = lower('sga_target') ) Status from v$parameter where NAME = lower('db_cache_size')
UNION ALL
select name, to_char(value/1024/1024/1024), case when value/1024/1024/1024 >=  ( &&TotalMemory*60/100*60/100 -0.100) then '*' else '' end || ( &&TotalMemory*60/100*60/100 -0.100) Status from v$parameter where NAME = lower('shared_pool_size')
UNION ALL
select name, to_char(value/1024/1024/1024), case when value/1024/1024/1024 >=  ( &&TotalMemory*60/100*40/100 -0.100) then '*' else '' end || ( &&TotalMemory*60/100*40/100 -0.100) Status from v$parameter where NAME = lower('db_cache_size')
UNION ALL
select name, to_char(value/1024/1024), case when value/1024/1024 <=  152 then '*' else '' end          || 152 Status from v$parameter where NAME = lower('java_pool_size')
UNION ALL
select name, value, case when value <>  70 then '*' else '' end                                        || 70 Status from v$parameter where NAME = lower('optimizer_index_caching')
UNION ALL
select name, value, case when value <>  'EXACT' then '*' else '' end                                   || 'EXACT' Status from v$parameter where NAME = lower('cursor_sharing')
UNION ALL
select name, value, case when value <>  20 then '*' else '' end                                        || 20 Status from v$parameter where NAME = lower('job_queue_processes')
UNION ALL
select name, value, case when value <>  'OFF' then '*' else '' end                                     || 'OFF' Status from v$parameter where NAME = lower('recyclebin')
UNION ALL
select name, value, case when value <>  1 then '*' else '' end                                         || 1 Status from v$parameter where NAME = lower('optimizer_index_cost_adj')
UNION ALL
select name, value, case when value <>  'ALL_ROWS' then '*' else '' end                                || 'ALL_ROWS' Status from v$parameter where NAME = lower('optimizer_mode')
;
--create pfile='/home/oracle/pfile.ora' from spfile;
--alter system set JAVA_POOL_SIZE = 160M scope = spfile;
--alter system set OPEN_CURSORS = 1000 scope = spfile;
--alter system set OPTIMIZER_INDEX_CACHING = 70 scope = spfile;
--alter system set OPTIMIZER_INDEX_COST_ADJ = 1 scope = spfile;
--alter system set PROCESSES = 500 scope = spfile;
--alter system set RECYCLEBIN = OFF scope = spfile;
--alter system set FILESYSTEMIO_OPTIONS = SETALL scope = spfile;
--alter system set NLS_LENGTH_SEMANTICS = BYTE scope = spfile;
--grant SELECT on GV_$ACCESS to tasy;
--grant SELECT on GV_$ACCESS to tasy_versao;
