Vous êtes sur la page 1sur 5

components of SGA shared pool large pool database buffer cache(default) keep buffer cache recycle buffer cache

nk buffer cache

parameter shared_pool_size large_pool_size db_cache_size db_keep_cache_size db_recycle_cache_size db_2k|4k|16k|32k_cache_size

configure keep buffer cache SQL> alter system set db_keep_cache_size=16M scope=both; use keep buffer pool SQL> create table emp(eid,ename,esal,did) 2 storage(buffer_pool keep) 3 as 4 select employee_id,last_name,salary,department_id 5 from employees 6 where department_id between 10 and 40; Table created. check the buffer_pool used by the object SQL> select table_name,buffer_pool from dba_tables where table_name='EMP' and o wner='HR'; /* TABLE_NAME BUFFER_ ------------------------------ ------EMP KEEP */ cache a table in memory SQL> alter table hr.emp cache; SQL> select table_name,cache,buffer_pool from dba_tables where table_name='EMP' and owner='HR'; /*TABLE_NAME CACHE BUFFER_ ------------------------------ ----- ------EMP Y KEEP */ configure a non standard buffer cache SQL> alter system set db_2k_cache_size=16M scope=both; create a non standard block size tablespace SQL> create tablespace "2ktbs" datafile '/u01/app/oracle/oradata/jarvis/2ktbs01. dbf' size 10M extent management local autoallocate segment space management auto blocksize 2k;

to display SGA dynamic components SQL> select component,current_size/(1024*1024)current_size,user_specified_size/( 1024*1024) user_specified_size from v$sga_dynamic_components;

################################## Automatic Shared Memory Management ################################## Automatic shared memory management is a self management enhancement in Oracle database. SGA size initialization parameter includes all memory in SGA sga_target Configuring ASMM manually set sga_target to a non zero value(>0) ASSM require statistics_level set to typical or all

##################################### collecting statistics at system level ##################################### Collecting no workload statistics SQL> execute dbms_stats.gather_system_stats

The system statistcs collected is stored in aux_stats$ table SQL> select pname,pval1 from aux_stats$; /* PNAME PVAL1 ------------------------------ ---------STATUS DSTART DSTOP FLAGS 1 CPUSPEEDNW 1993.19 IOSEEKTIM 8.965 IOTFRSPEED 4096 SREADTIM MREADTIM CPUSPEED MBRC PNAME PVAL1 ------------------------------ ---------MAXTHR SLAVETHR */ ############################## Collecting workload statistics ##############################

SQL> execute dbms_stats.gather_system_stats('START'); /*generate workload SQL> create table bigtable as select * from all_objects; SQL> insert into bigtable select * from bigtable; 49875 rows created. SQL> insert into bigtable select * from bigtable; 99750 rows created. SQL> insert into bigtable select * from bigtable; 199500 rows created. SQL> insert into bigtable select * from bigtable; 399000 rows created. */ SQL> execute dbms_stats.gather_system_stats('STOP'); display statistics collected after generating workload SQL> select pname,pval1 from aux_stats$; /* PNAME PVAL1 ------------------------------ ---------STATUS DSTART DSTOP FLAGS 1 CPUSPEEDNW 1993.19 IOSEEKTIM 8.965 IOTFRSPEED 4096 SREADTIM 4 MREADTIM 3.149 CPUSPEED 1987 MBRC 14 PNAME PVAL1 ------------------------------ ---------MAXTHR SLAVETHR */ Note: SREADTIM,MREADTIM,CPUSPEED,MBRC represents workload statistics SREADTIM :: Single block read time(millisecs) :: Average time Oracle takes to re ad a block MREADTIM :: Multi block read time(millisecs) :: Average time taken by Oracle to read multiple blocks CPUSPEED :: CPU SPEED during workload MBRC :: Multi block read count :: Average number of multiple bloc ks read during multiblock sequ

ential reads.

statistics level 1)Basic: The computation of AWR statistics and metrics is turned off. 2)Typical: Only some of the statistics are collected. They represent what is typically need ed to monitor the Oracle database behavior.This automatic gathering of st atistics reduces the likelihood of poorly performing SQL statements due t o stale or invalid statistics. 3)All: All possible statistics are captured. This level of capture should not be used e xcept in certain rare cases for which you need extra SQL diagnostics i nformation.

to display statistics level SQL> show parameter statistics_level /* NAME TYPE VALUE ------------------------------------ ----------- -----------------------------statistics_level string TYPICAL */

To display the snapshot setting SQL> select * from dba_hist_wr_control; /* DBID SNAP_INTERVAL RETENTION TOPNSQL ---------- ---------------------------------------- --------------------------------------- ---------2037971371 +00000 01:00:00.0 +00007 00:00:00.0 DEFAULT */

to moidify snapshot setting SQL> execute dbms_workload_repository.modify_snapshot_settings(retention=>1*24*6 0,interval=>30); To display the snapshots already present in the system SQL> select snap_id,begin_interval_time,end_interval_time from dba_hist_snapshot order by 1;

create snapshot manually SQL> execute dbms_workload_repository.create_snapshot; drop snapshots SQL> execute dbms_workload_repository.drop_snapshot_range(low_snap_id=>41,high_s

nap_id=>41); create baseline SQL> execute dbms_workload_repository.create_baseline(start_snap_id=>10,end_snap _id=>40,baseline_name=>'baseline1'); to display existing baseline SQL> select * from dba_hist_baseline; /* DBID BASELINE_ID BASELINE_NAME START_SNAP_ID START_SNAP_TIME END_SNAP_ID END_SNAP_TIME ---------- ----------- -------------------- ------------- ----------------------------- ----------- -----------------------------2037971371 1 baseline1 10 01-JUL-13 03.30.59.648 PM 40 08-JUL-13 05.30.25.307 PM */ ############################ generate AWR report manually ############################ SQL> @$ORACLE_HOME/rdbms/admin/awrrpt.sql

Vous aimerez peut-être aussi