SlideShare ist ein Scribd-Unternehmen logo
1 von 27
DBAMETRIX Solutions
     Present

 Oracle SGA in a Nutshell
DBA Learn by Presentation
               series
   DBA learning by presentation offered by
    DBAMETRIX Solutions.
   This all presentations have been prepared by
    Gitesh P Trivedi.
   Gitesh Trivedi has work excellent 14 years
    experience in DBA field and as consultant faculty.
   For more details please contact to
    www.dbametrix.com or gitesh@dbametrix.com or
    giteshtrivedi@yahoo.com
What is SGA

   SGA called as Shared Global Area
   It populates in Oracle’s memory region
   Size of SGA depends on Granule
    distribution
   Sometime it also called as Shared Memory
    Area
   It populates when Oracle database started
Sub Components of SGA

                                                                    SGA

Buffer Cache         Log Buffer                           Shared Pool                Java Pool             Stream Pool                Large Pool

  Dictionary Cache                Library Cache                                                         Control Structure

                                                                    Shared SQL Area                                         Locks

                                                                                                                            Latches
                                                                                       Execution Plan


                                                                                        Parse Tree
                                                                      Private Area


                                                  Persistent Area


                                                  Runtime Area
Parameters of SGA

   Db_cache_size    (Buffer Cache)
   Log_buffer      (Log Buffer)
   Shared_pool_size (Shared Pool)
   Java_pool_size   (Java Pool)
   Large_pool_size (Large Pool)
   Stream_pool_size (Stream Pool)
What is granules
   With dynamic SGA, the unit of allocation is
    called a granule
   Allocation of SGA components, as unit of
    granule
   Granule size is determined by total SGA
    size
   We can check size of granule from
    v$sgainfo dynamic view
Size of Granules
   It depends on operating system and kernel bit version.
   In Oracle 9i, if SGA is smaller than 128 MB than size of
    granule is 4MB. If more than 128MB than size of granule
    is 16MB.
   From Oracle 10g, if SGA is smaller than 1GB than size of
    granule is 4MB and bigger for 16MB.
   For 32bit Windows platform if SGA is bigger than 128MB
    than size of granule is 8MB
   Expanding size of component of SGA depends on
    multiple of Granule size
SGA Structure

                                 Dict Cache        Lib Cache
Buffer Cache    Log Buffer                                       Con Str


                                 Sort Ext Pool   Shared Pool




                   Stream Pool                   Java Pool     Large Pool
Database Buffer Cache
   For fetching data, Oracle first check in Buffer Cache.
   If no found data in Buffer Cache then Oracle fetch data
    from disk and copy in Buffer Cache for avoiding
    unnecessary disk I/O.
   3 types of Buffers available in Buffer Cache.
   Those are free buffers, pinned buffers and dirty buffers.
   When Oracle don’t find room for pinning new buffers
    then dirty buffers are flushed and written in to disk.
   For managing these all buffers, Oracle utilizes a least
    recently used algorithm for flushing buffers in Disk.
Type of Buffer Cache
   Multiple Buffer Cache
   DEFAULT Buffer Cache db_cache_size
   KEEP Buffer Cache db_keep_cache_size
   RECYCLE Buffer Cache
    db_recycle_cache_size
   Non standard Buffer Cache also available
    with parameter db_nK_cache_size where n is
    2,4,8,16,32.
   In Oracle 8i and prior version parameter was
    db_block_buffers
How Buffers work
        All are free Buffers in Buffer Cache
How Buffers work

          Pinned Buffers in
            Buffer Cache


           Free Buffers in Buffer Cache
How Buffers work

           Pinned Buffers




                  Free Buffers



                      Dirty Buffers
How Buffers work

        No free Buffers available, all occupied.
How Buffers work
        Now free Buffers
        available

                    Dirty Buffers flushed to disk
Log Buffers
   Redo log buffer is circular buffer that hold
    data of changes in database.
   Each redo entries contain data about
    dml/ddl operations.
   It is usable to reconstruct data from redo
    entries.
   Periodically Log Writer process writes data
    from redo log buffer to disk.
How Log buffer works

LGWR flushes data from buffer
to disk                                   Log Buffer




                                Redo        Redo       Redo
                                Log         Log        Log
                                group 1     group 2    group 3
Shared Pool
   Information of data dictionary views and privileges
    stores in Dictionary Cache.
   Explain plans, Cursors, Bind variables, store
    procedures store in Library Cache.
   Lock and Latches store in Control structure.
   Sort Extent Pool contains mapping of sort segment
    and sorting information.
   There is no separate parameter for any sub
    components.
   Parameter of Shared Pool is shared_pool_size.
How Shared Pool works

        Raw Cache                         Library Cache
                                                               Control
                                                               Structure


        Sort extent Pool




Tracking sort
segment                                             Stores
                           Contains dictionary      cursors,           Hold locks &
                           data, privileges,        PL/SQL             latches
                           system data
Managing Shared Pool
   Shared pool can be flushed using “alter system
    flush shared_pool” command.
   While flushing shared pool, all objects wipe off
    and cursors become invalidate. Oracle reparse
    all cursors after reuse.
   If object pinned using dbms_shared_pool.keep,
    would never flush (after using above command).
   Default size of shared pool is 8 MB in 32 bit
    platform and 64 MB in 64 bit platform.
Large Pool
   It contains I/O of server process
   It contains memory of Backup & Restore
    operations
   It contains memory for shared server process
    (mts configuration)
   It contains parallel server process and buffers
   There is no LRU algorithm to manage request in
    Large Pool
   Parameter is large_pool_size
Java Pool
   It handles Java related memories
   It contains Java class, definitions and JVM components
   It handles request for session specific java code
   In Oracle 8i can be disable, but from Oracle 9i it can't
    due to dependencies like feature of data warehousing
    (SYS.DBMS_CDC_PUBLISH), export and import etc
   It determines from following query from database
   SELECT name, bytes FROM V$SGASTAT WHERE pool =
    'java pool';
   Parameter is java_pool_size
Stream Pool

   It uses allocation of memory of stream
    buffers
   If size is greater than 0, then allocates
    stream in pool. If size is 0 then memory
    will be allocated in shared pool
   Parameter is stream_pool_size
SGA_TARGET (Oracle 10g and
          higher version)
   Introduce in 10g as Automatic Shared
    Memory Management.
   If set nonzero value then Oracle
    automatically determine and adjust SGA size.
   Oracle re-distribute memory allocation when
    found change of workload.
   For re-organization of SGA size, responsible
    background process is called MMAN (Memory
    Manager).
Components of SGA_TARGET
   Buffer Cache (default)
   Log Buffer
   Shared Pool
   Stream Pool
   Java Pool
   Large Pool
   Manual allocation of buffer pools (keep & recyle)
   Manual allocation of Non-standard Buffer Cache
    ((controlled by DB_nK_CACHE_SIZE, n = {2, 4, 8,
    16, 32})
New Automatic Memory
      Management in Oracle 11g
   New parameters memory_target and
    memory_max_target are introduced.
   Whole instance memory automatically managed using
    these parameters.
   It overrides sga_target and pga_target.
   If both set then it will be treated as lower bound of
    memory of same region.
   Memory_target is dynamic and memory_max_target is
    static parameter.
   V$memory_target_advice dynamic view for more
    reference and guidance of same new feture.
Oracle SGA in Nutshell

Presented by Gitesh P Trivedi
    DBAMETRIX Solutions
    www.dbametrix.com

Weitere ähnliche Inhalte

Was ist angesagt?

Mcitp server administrator
Mcitp server administratorMcitp server administrator
Mcitp server administrator
97148881557
 
Shared Personalization Service - How To Scale to 15K RPS, Patrice Pelland
Shared Personalization Service - How To Scale to 15K RPS, Patrice PellandShared Personalization Service - How To Scale to 15K RPS, Patrice Pelland
Shared Personalization Service - How To Scale to 15K RPS, Patrice Pelland
Fuenteovejuna
 
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdfDatabase & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
InSync2011
 
Active dataguard
Active dataguardActive dataguard
Active dataguard
Manoj Kumar
 
Compaction and Splitting in Apache Accumulo
Compaction and Splitting in Apache AccumuloCompaction and Splitting in Apache Accumulo
Compaction and Splitting in Apache Accumulo
Hortonworks
 
An Active and Hybrid Storage System for Data-intensive Applications
An Active and Hybrid Storage System for Data-intensive ApplicationsAn Active and Hybrid Storage System for Data-intensive Applications
An Active and Hybrid Storage System for Data-intensive Applications
Xiao Qin
 
Extend starfish to Support the Growing Hadoop Ecosystem
Extend starfish to Support the Growing Hadoop EcosystemExtend starfish to Support the Growing Hadoop Ecosystem
Extend starfish to Support the Growing Hadoop Ecosystem
Fei Dong
 

Was ist angesagt? (20)

Mcitp server administrator
Mcitp server administratorMcitp server administrator
Mcitp server administrator
 
Remote Dba Team Oracle Architecture In Nutshell
Remote Dba Team   Oracle Architecture In NutshellRemote Dba Team   Oracle Architecture In Nutshell
Remote Dba Team Oracle Architecture In Nutshell
 
Shared Personalization Service - How To Scale to 15K RPS, Patrice Pelland
Shared Personalization Service - How To Scale to 15K RPS, Patrice PellandShared Personalization Service - How To Scale to 15K RPS, Patrice Pelland
Shared Personalization Service - How To Scale to 15K RPS, Patrice Pelland
 
Exchange Server 2013 Database and Store Changes
Exchange Server 2013 Database and Store ChangesExchange Server 2013 Database and Store Changes
Exchange Server 2013 Database and Store Changes
 
Presentation day2 oracle12c
Presentation day2 oracle12cPresentation day2 oracle12c
Presentation day2 oracle12c
 
Presentation day4 oracle12c
Presentation day4 oracle12cPresentation day4 oracle12c
Presentation day4 oracle12c
 
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdfDatabase & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
 
Cloudcon East Presentation
Cloudcon East PresentationCloudcon East Presentation
Cloudcon East Presentation
 
Investigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock HolmesInvestigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock Holmes
 
Active dataguard
Active dataguardActive dataguard
Active dataguard
 
Compaction and Splitting in Apache Accumulo
Compaction and Splitting in Apache AccumuloCompaction and Splitting in Apache Accumulo
Compaction and Splitting in Apache Accumulo
 
Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017
 
Weblogic performance tuning1
Weblogic performance tuning1Weblogic performance tuning1
Weblogic performance tuning1
 
An Active and Hybrid Storage System for Data-intensive Applications
An Active and Hybrid Storage System for Data-intensive ApplicationsAn Active and Hybrid Storage System for Data-intensive Applications
An Active and Hybrid Storage System for Data-intensive Applications
 
Lap Around Sql Azure
Lap Around Sql AzureLap Around Sql Azure
Lap Around Sql Azure
 
PostgreSQL and Benchmarks
PostgreSQL and BenchmarksPostgreSQL and Benchmarks
PostgreSQL and Benchmarks
 
Extend starfish to Support the Growing Hadoop Ecosystem
Extend starfish to Support the Growing Hadoop EcosystemExtend starfish to Support the Growing Hadoop Ecosystem
Extend starfish to Support the Growing Hadoop Ecosystem
 
Presentation day5 oracle12c
Presentation day5 oracle12cPresentation day5 oracle12c
Presentation day5 oracle12c
 
Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA
 
How to use postgresql.conf to configure and tune the PostgreSQL server
How to use postgresql.conf to configure and tune the PostgreSQL serverHow to use postgresql.conf to configure and tune the PostgreSQL server
How to use postgresql.conf to configure and tune the PostgreSQL server
 

Andere mochten auch (20)

Les 09 diag
Les 09 diagLes 09 diag
Les 09 diag
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
 
Les 02 config
Les 02 configLes 02 config
Les 02 config
 
Les 19 space_db
Les 19 space_dbLes 19 space_db
Les 19 space_db
 
Les 17 sched
Les 17 schedLes 17 sched
Les 17 sched
 
Oracle data guard broker 12c
Oracle data guard broker 12cOracle data guard broker 12c
Oracle data guard broker 12c
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commands
 
Les 06 rec
Les 06 recLes 06 rec
Les 06 rec
 
Les 13 memory
Les 13 memoryLes 13 memory
Les 13 memory
 
Les 05 create_bu
Les 05 create_buLes 05 create_bu
Les 05 create_bu
 
Les 04 config_bu
Les 04 config_buLes 04 config_bu
Les 04 config_bu
 
Xpp b tspitr
Xpp b tspitrXpp b tspitr
Xpp b tspitr
 
Server control utility reference
Server control utility referenceServer control utility reference
Server control utility reference
 
Les 20 dup_db
Les 20 dup_dbLes 20 dup_db
Les 20 dup_db
 
Les 16 resource
Les 16 resourceLes 16 resource
Les 16 resource
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
 
Les 12 fl_db
Les 12 fl_dbLes 12 fl_db
Les 12 fl_db
 
Les 11 fl2
Les 11 fl2Les 11 fl2
Les 11 fl2
 
Les 18 space
Les 18 spaceLes 18 space
Les 18 space
 
Les 10 fl1
Les 10 fl1Les 10 fl1
Les 10 fl1
 

Ähnlich wie Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation

Less01 architecture
Less01 architectureLess01 architecture
Less01 architecture
Amit Bhalla
 
Jug Lugano - Scale over the limits
Jug Lugano - Scale over the limitsJug Lugano - Scale over the limits
Jug Lugano - Scale over the limits
Davide Carnevali
 
Caching principles-solutions
Caching principles-solutionsCaching principles-solutions
Caching principles-solutions
pmanvi
 
Share point 2013 distributed cache
Share point 2013 distributed cacheShare point 2013 distributed cache
Share point 2013 distributed cache
Michael Nokhamzon
 
Oracle db architecture
Oracle db architectureOracle db architecture
Oracle db architecture
Simon Huang
 
Tips and Tricks for SAP Sybase IQ
Tips and Tricks for SAP  Sybase IQTips and Tricks for SAP  Sybase IQ
Tips and Tricks for SAP Sybase IQ
Don Brizendine
 

Ähnlich wie Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation (20)

Less01 architecture
Less01 architectureLess01 architecture
Less01 architecture
 
Ora01_OraArc.pdf
Ora01_OraArc.pdfOra01_OraArc.pdf
Ora01_OraArc.pdf
 
Jug Lugano - Scale over the limits
Jug Lugano - Scale over the limitsJug Lugano - Scale over the limits
Jug Lugano - Scale over the limits
 
Caching principles-solutions
Caching principles-solutionsCaching principles-solutions
Caching principles-solutions
 
Share point 2013 distributed cache
Share point 2013 distributed cacheShare point 2013 distributed cache
Share point 2013 distributed cache
 
Oracle db architecture
Oracle db architectureOracle db architecture
Oracle db architecture
 
Controlling Memory Footprint at All Layers: Linux Kernel, Applications, Libra...
Controlling Memory Footprint at All Layers: Linux Kernel, Applications, Libra...Controlling Memory Footprint at All Layers: Linux Kernel, Applications, Libra...
Controlling Memory Footprint at All Layers: Linux Kernel, Applications, Libra...
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
Introduction to oracle
Introduction to oracleIntroduction to oracle
Introduction to oracle
 
Oracle 10g Introduction 1
Oracle 10g Introduction 1Oracle 10g Introduction 1
Oracle 10g Introduction 1
 
인메모리 클러스터링 아키텍처
인메모리 클러스터링 아키텍처인메모리 클러스터링 아키텍처
인메모리 클러스터링 아키텍처
 
Oracle Database Introduction
Oracle Database IntroductionOracle Database Introduction
Oracle Database Introduction
 
Oracle Database Architecture
Oracle Database ArchitectureOracle Database Architecture
Oracle Database Architecture
 
515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptx515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptx
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
DBA 101 : Calling all New Database Administrators (WP)
DBA 101 : Calling all New Database Administrators (WP)DBA 101 : Calling all New Database Administrators (WP)
DBA 101 : Calling all New Database Administrators (WP)
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch Processing
 
Tips and Tricks for SAP Sybase IQ
Tips and Tricks for SAP  Sybase IQTips and Tricks for SAP  Sybase IQ
Tips and Tricks for SAP Sybase IQ
 
Building an Oracle Grid with Oracle VM on Dell Blade Servers and EqualLogic i...
Building an Oracle Grid with Oracle VM on Dell Blade Servers and EqualLogic i...Building an Oracle Grid with Oracle VM on Dell Blade Servers and EqualLogic i...
Building an Oracle Grid with Oracle VM on Dell Blade Servers and EqualLogic i...
 
Adavanced Databases and Mangement system
Adavanced Databases and Mangement systemAdavanced Databases and Mangement system
Adavanced Databases and Mangement system
 

Mehr von Remote DBA Services

Mehr von Remote DBA Services (10)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
do's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Jobdo's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Job
 
logical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptxlogical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptx
 
oracle 23c new features for developer and dba
oracle 23c new features for developer and dbaoracle 23c new features for developer and dba
oracle 23c new features for developer and dba
 
Oracle Database Buffer Cache Management.pptx
Oracle Database Buffer Cache Management.pptxOracle Database Buffer Cache Management.pptx
Oracle Database Buffer Cache Management.pptx
 
What is the Oracle Database Buffer Cache
What is the Oracle Database Buffer CacheWhat is the Oracle Database Buffer Cache
What is the Oracle Database Buffer Cache
 
Oracle dba advance-24-7-running databases
Oracle dba advance-24-7-running databasesOracle dba advance-24-7-running databases
Oracle dba advance-24-7-running databases
 
Oracle database 12c new features
Oracle database 12c new featuresOracle database 12c new features
Oracle database 12c new features
 
1Z0-052 Oracle 11g Administration I
1Z0-052 Oracle 11g Administration I1Z0-052 Oracle 11g Administration I
1Z0-052 Oracle 11g Administration I
 

Kürzlich hochgeladen

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Kürzlich hochgeladen (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation

  • 1. DBAMETRIX Solutions Present Oracle SGA in a Nutshell
  • 2. DBA Learn by Presentation series  DBA learning by presentation offered by DBAMETRIX Solutions.  This all presentations have been prepared by Gitesh P Trivedi.  Gitesh Trivedi has work excellent 14 years experience in DBA field and as consultant faculty.  For more details please contact to www.dbametrix.com or gitesh@dbametrix.com or giteshtrivedi@yahoo.com
  • 3. What is SGA  SGA called as Shared Global Area  It populates in Oracle’s memory region  Size of SGA depends on Granule distribution  Sometime it also called as Shared Memory Area  It populates when Oracle database started
  • 4. Sub Components of SGA SGA Buffer Cache Log Buffer Shared Pool Java Pool Stream Pool Large Pool Dictionary Cache Library Cache Control Structure Shared SQL Area Locks Latches Execution Plan Parse Tree Private Area Persistent Area Runtime Area
  • 5. Parameters of SGA  Db_cache_size (Buffer Cache)  Log_buffer (Log Buffer)  Shared_pool_size (Shared Pool)  Java_pool_size (Java Pool)  Large_pool_size (Large Pool)  Stream_pool_size (Stream Pool)
  • 6. What is granules  With dynamic SGA, the unit of allocation is called a granule  Allocation of SGA components, as unit of granule  Granule size is determined by total SGA size  We can check size of granule from v$sgainfo dynamic view
  • 7. Size of Granules  It depends on operating system and kernel bit version.  In Oracle 9i, if SGA is smaller than 128 MB than size of granule is 4MB. If more than 128MB than size of granule is 16MB.  From Oracle 10g, if SGA is smaller than 1GB than size of granule is 4MB and bigger for 16MB.  For 32bit Windows platform if SGA is bigger than 128MB than size of granule is 8MB  Expanding size of component of SGA depends on multiple of Granule size
  • 8. SGA Structure Dict Cache Lib Cache Buffer Cache Log Buffer Con Str Sort Ext Pool Shared Pool Stream Pool Java Pool Large Pool
  • 9. Database Buffer Cache  For fetching data, Oracle first check in Buffer Cache.  If no found data in Buffer Cache then Oracle fetch data from disk and copy in Buffer Cache for avoiding unnecessary disk I/O.  3 types of Buffers available in Buffer Cache.  Those are free buffers, pinned buffers and dirty buffers.  When Oracle don’t find room for pinning new buffers then dirty buffers are flushed and written in to disk.  For managing these all buffers, Oracle utilizes a least recently used algorithm for flushing buffers in Disk.
  • 10. Type of Buffer Cache  Multiple Buffer Cache  DEFAULT Buffer Cache db_cache_size  KEEP Buffer Cache db_keep_cache_size  RECYCLE Buffer Cache db_recycle_cache_size  Non standard Buffer Cache also available with parameter db_nK_cache_size where n is 2,4,8,16,32.  In Oracle 8i and prior version parameter was db_block_buffers
  • 11. How Buffers work All are free Buffers in Buffer Cache
  • 12. How Buffers work Pinned Buffers in Buffer Cache Free Buffers in Buffer Cache
  • 13. How Buffers work Pinned Buffers Free Buffers Dirty Buffers
  • 14. How Buffers work No free Buffers available, all occupied.
  • 15. How Buffers work Now free Buffers available Dirty Buffers flushed to disk
  • 16. Log Buffers  Redo log buffer is circular buffer that hold data of changes in database.  Each redo entries contain data about dml/ddl operations.  It is usable to reconstruct data from redo entries.  Periodically Log Writer process writes data from redo log buffer to disk.
  • 17. How Log buffer works LGWR flushes data from buffer to disk Log Buffer Redo Redo Redo Log Log Log group 1 group 2 group 3
  • 18. Shared Pool  Information of data dictionary views and privileges stores in Dictionary Cache.  Explain plans, Cursors, Bind variables, store procedures store in Library Cache.  Lock and Latches store in Control structure.  Sort Extent Pool contains mapping of sort segment and sorting information.  There is no separate parameter for any sub components.  Parameter of Shared Pool is shared_pool_size.
  • 19. How Shared Pool works Raw Cache Library Cache Control Structure Sort extent Pool Tracking sort segment Stores Contains dictionary cursors, Hold locks & data, privileges, PL/SQL latches system data
  • 20. Managing Shared Pool  Shared pool can be flushed using “alter system flush shared_pool” command.  While flushing shared pool, all objects wipe off and cursors become invalidate. Oracle reparse all cursors after reuse.  If object pinned using dbms_shared_pool.keep, would never flush (after using above command).  Default size of shared pool is 8 MB in 32 bit platform and 64 MB in 64 bit platform.
  • 21. Large Pool  It contains I/O of server process  It contains memory of Backup & Restore operations  It contains memory for shared server process (mts configuration)  It contains parallel server process and buffers  There is no LRU algorithm to manage request in Large Pool  Parameter is large_pool_size
  • 22. Java Pool  It handles Java related memories  It contains Java class, definitions and JVM components  It handles request for session specific java code  In Oracle 8i can be disable, but from Oracle 9i it can't due to dependencies like feature of data warehousing (SYS.DBMS_CDC_PUBLISH), export and import etc  It determines from following query from database  SELECT name, bytes FROM V$SGASTAT WHERE pool = 'java pool';  Parameter is java_pool_size
  • 23. Stream Pool  It uses allocation of memory of stream buffers  If size is greater than 0, then allocates stream in pool. If size is 0 then memory will be allocated in shared pool  Parameter is stream_pool_size
  • 24. SGA_TARGET (Oracle 10g and higher version)  Introduce in 10g as Automatic Shared Memory Management.  If set nonzero value then Oracle automatically determine and adjust SGA size.  Oracle re-distribute memory allocation when found change of workload.  For re-organization of SGA size, responsible background process is called MMAN (Memory Manager).
  • 25. Components of SGA_TARGET  Buffer Cache (default)  Log Buffer  Shared Pool  Stream Pool  Java Pool  Large Pool  Manual allocation of buffer pools (keep & recyle)  Manual allocation of Non-standard Buffer Cache ((controlled by DB_nK_CACHE_SIZE, n = {2, 4, 8, 16, 32})
  • 26. New Automatic Memory Management in Oracle 11g  New parameters memory_target and memory_max_target are introduced.  Whole instance memory automatically managed using these parameters.  It overrides sga_target and pga_target.  If both set then it will be treated as lower bound of memory of same region.  Memory_target is dynamic and memory_max_target is static parameter.  V$memory_target_advice dynamic view for more reference and guidance of same new feture.
  • 27. Oracle SGA in Nutshell Presented by Gitesh P Trivedi DBAMETRIX Solutions www.dbametrix.com