Listing 2

-- ****************************************************************

-- Dynamic SGA modification
--
-- Copyright (c) 2003 By Donald K. Burleson - All Rights reserved.
-- ****************************************************************

set heading off
set feedback off
set verify off

accept decrease_pool char   prompt 'Enter cache to decrease: '

accept increase_pool char   prompt 'Enter cache to increase: '
accept change_amount number prompt 'Enter amount to  change: Ô

spool run_sga.sql
select
   'alter system set &decrease_pool = '||to_char(to_number(value)-&change_amount)||';'

from 
   v$parameter
where 
   name = lower(Ô&decrease_poolÔ);
select
   'alter system set &increase_pool = '||to_char(to_number(value)+&change_amount)||';'
from 

   v$parameter
where 
   name = lower(Ô&increase_poolÕ;
spool off
set feedback on
@run_sga