| |
 |
|
Oracle Tips by Burleson Consulting
|
Changing RAM configuration
with UNIX scripts
In a UNIX environment it is very easy to schedule a task to change
the RAM memory configuration when the processing needs change. For
example, many Oracle database operate in OLTP mode during normal
work hours, while at night the database services memory-intensive
batch reports.
As we have noted, an OLTP database should have a large value for
db_cache_size while memory-intensive batch tasks require additional
RAM in the pga_aggregate_target.
The UNIX scripts below can be used to re-configure the SGA between
OLTP and DSS without stopping the instance. In this example, we
assume that we have an isolated Oracle server with 8 gigabytes of
RAM. We also assume that we reserve 20% of RAM for UNIX overhead,
leaving a total of 6 gigabytes for Oracle and Oracle connections.
These scripts are for HP/UX or Solaris, and accept the $ORACLE_SID
as an argument.
The dss_config.ksh script will be run at 6:00 PM each evening to
re-configure Oracle for the memory-intensive batch tasks that run
each night.
dss_config.ksh
#!/bin/ksh
# First, we must set the environment . . . .
ORACLE_SID=$1
export ORACLE_SID
ORACLE_HOME=`cat /etc/oratab|grep ^$ORACLE_SID:|cut -f2 -d':'`
#ORACLE_HOME=`cat /var/opt/oracle/oratab|grep ^$ORACLE_SID:|cut -f2
-d':'`
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH
$ORACLE_HOME/bin/sqlplus –s /nologin<<!
connect system/manager as sysdba;
alter system set db_cache_size=1500m;
alter system set shared_pool_size=500m;
alter system set pga_aggregate_target=4000m;
exit
!
The oltp_config.ksh script will be run at 6:00 AM each morning to
re-configure Oracle for the OLTP usage during the day.
oltp_config.ksh
#!/bin/ksh
# First, we must set the environment . . . .
ORACLE_SID=$1
export ORACLE_SID
ORACLE_HOME=`cat /etc/oratab|grep ^$ORACLE_SID:|cut -f2 -d':'`
#ORACLE_HOME=`cat /var/opt/oracle/oratab|grep ^$ORACLE_SID:|cut -f2
-d':'`
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH
$ORACLE_HOME/bin/sqlplus –s /nologin<<!
connect system/manager as sysdba;
alter system set db_cache_size=4000m;
alter system set shared_pool_size=500m;
alter system set pga_aggregate_target=1500m;
exit
!
|
Download your Oracle scripts now:
www.oracle-script.com
The
definitive Oracle Script collection for every Oracle professional DBA
|
|