SlideShare une entreprise Scribd logo
1  sur  3
Anar Godjaev
http://anargodjaev.wordpress.com/
Tuning SGA
-- monitoring SGA system parameters
--- max size of the sga
select name, value, description from v$parameterwhere name='sga_max_size';
-- sum of all values of the following query cannot exceed sga_max_size
select sum(value) from
(
select name, value, description from v$parameter
where name in ('java_pool_size',
'shared_pool_size',
'large_pool_size')
UNION
select name, value, description from v$parameterwhere name like
'db_%cache_size'
UNION
select name, value, description from v$parameterwhere name='log_buffer'
);
-------

lets have a look at something
the value of sga_max_size may not be equal to the sum of its components
the difference between these tow values will give you the approximate
free space

selecttrunc(((t2.sga_max_size - t1.total_sga_params)/1024/1024)) FREE_MB
from
(
select sum(value) total_sga_paramsfrom
(
select name, value, description from v$parameter
where name in ('java_pool_size',
'shared_pool_size',
'large_pool_size')
UNION
select name, value, description from v$parameterwhere name like
'db_%cache_size'
UNION
select name, value, description from v$parameterwhere
name='log_buffer'
)
) t1
,(
select sum(value) sga_max_sizefrom v$parameterwhere
name='sga_max_size'
) t2;
--- other ways of obtaining free sga size
-select* from v$sgastatwhere name='free memory';
selectcurrent_size/1024/1024 MB from v$sga_dynamic_free_memory;
--- changing sga and sgacomponenets values
Anar Godjaev
http://anargodjaev.wordpress.com/
--- recommended: sga_max_size should be phsical_memory/2
alter system set sga_max_size=500M scope=spfile;
-- changes of this parameter will take affect after instance restart
alter system set java_pool_size=150M scope=spfile;
-- changes of this parameter will take affect after instance restart
alter system set shared_pool_size=150M;
alter system set large_pool_size=50M;
alter system set db_cache_size=150M;
-- which system parameter can be changed without an instance restart
-select* from v$parameterwhere issys_modifiable='IMMEDIATE'
--- following parameter needs an instance restart
-select* from v$parameterwhere issys_modifiable!='FALSE'
-- to change these kind of system parameters following steps can be
followed
alter system set <name>=<value> scope=spfile;
-- from now on you should login from sqlplus "/as sysdba"
alter system checkpoint;
shutdown immediate;
startup;
Advices for SGA
--- advices for sga
-select* from V$SHARED_POOL_ADVICE;
select* from V$DB_CACHE_ADVICE;
select* from V$PGA_TARGET_ADVICE;
NOTES:
1- db_cache_advice system parameter should be ON for v$shared_pool_advice
system view can be up-to-date.
2- for all advice views statistics_level system parameter should be at
least in BASIC mode.

-- setting db_cache_advice system parameter
-select
name,
value,
issys_modifiable,
description
from
v$parameter
where
name='db_cache_advice';
alter system set db_cache_advice='ON';
Anar Godjaev
http://anargodjaev.wordpress.com/
select
name,
value,
issys_modifiable,
description
from
v$parameter
where
name='db_cache_advice';
--- modifying statistics_level
-select value from v$parameterwhere name='statistics_level';
alter system set statistics_level='TYPICAL';
-- allowed values are [ALL|TYPICAL|BASIC]

Contenu connexe

Tendances

Trigger and cursor program using sql
Trigger and cursor program using sqlTrigger and cursor program using sql
Trigger and cursor program using sql
Sushil Mishra
 

Tendances (20)

Database Triggers
Database TriggersDatabase Triggers
Database Triggers
 
Oracle - Program with PL/SQL - Lession 16
Oracle - Program with PL/SQL - Lession 16Oracle - Program with PL/SQL - Lession 16
Oracle - Program with PL/SQL - Lession 16
 
Database Triggers
Database TriggersDatabase Triggers
Database Triggers
 
Triggers
TriggersTriggers
Triggers
 
Trigger
TriggerTrigger
Trigger
 
Msql
Msql Msql
Msql
 
trigger dbms
trigger dbmstrigger dbms
trigger dbms
 
Trigger and cursor program using sql
Trigger and cursor program using sqlTrigger and cursor program using sql
Trigger and cursor program using sql
 
Stored procedures
Stored proceduresStored procedures
Stored procedures
 
Oracle - Program with PL/SQL - Lession 11
Oracle - Program with PL/SQL - Lession 11Oracle - Program with PL/SQL - Lession 11
Oracle - Program with PL/SQL - Lession 11
 
Trigger in DBMS
Trigger in DBMSTrigger in DBMS
Trigger in DBMS
 
Introduction to triggers
Introduction to triggersIntroduction to triggers
Introduction to triggers
 
Oracle PL/SQL Bulk binds
Oracle PL/SQL Bulk bindsOracle PL/SQL Bulk binds
Oracle PL/SQL Bulk binds
 
Sql procedures
Sql proceduresSql procedures
Sql procedures
 
Sql storeprocedure
Sql storeprocedureSql storeprocedure
Sql storeprocedure
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
Procedures/functions of rdbms
Procedures/functions of rdbmsProcedures/functions of rdbms
Procedures/functions of rdbms
 
10 Creating Triggers
10 Creating Triggers10 Creating Triggers
10 Creating Triggers
 
Oracle - Program with PL/SQL - Lession 17
Oracle - Program with PL/SQL - Lession 17Oracle - Program with PL/SQL - Lession 17
Oracle - Program with PL/SQL - Lession 17
 
Test Dml With Nologging
Test Dml With NologgingTest Dml With Nologging
Test Dml With Nologging
 

En vedette (12)

Table Partitions
Table PartitionsTable Partitions
Table Partitions
 
Conditional Control
Conditional ControlConditional Control
Conditional Control
 
Oracle GoldenGate
Oracle GoldenGateOracle GoldenGate
Oracle GoldenGate
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from
 
How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...
 
Wait Interface
Wait InterfaceWait Interface
Wait Interface
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
 
Database Vault / Verinin Güvenliği
Database Vault /  Verinin GüvenliğiDatabase Vault /  Verinin Güvenliği
Database Vault / Verinin Güvenliği
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasi
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vault
 

Similaire à Tuning SGA

Memcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My SqlMemcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My Sql
MySQLConference
 
SAS Macros part 2
SAS Macros part 2SAS Macros part 2
SAS Macros part 2
venkatam
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition Presentation
N/A
 
Hello click click boom
Hello click click boomHello click click boom
Hello click click boom
symbian_mgl
 
Advanced tips of dbms statas
Advanced tips of dbms statasAdvanced tips of dbms statas
Advanced tips of dbms statas
Louis liu
 

Similaire à Tuning SGA (20)

Memory Management
Memory ManagementMemory Management
Memory Management
 
Memcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My SqlMemcached Functions For My Sql Seemless Caching In My Sql
Memcached Functions For My Sql Seemless Caching In My Sql
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
Oracle sql tuning
Oracle sql tuningOracle sql tuning
Oracle sql tuning
 
Undo Management
Undo ManagementUndo Management
Undo Management
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 
12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage
 
SAS Macros part 2
SAS Macros part 2SAS Macros part 2
SAS Macros part 2
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition Presentation
 
Hello click click boom
Hello click click boomHello click click boom
Hello click click boom
 
Tutorial - Learn SQL with Live Online Database
Tutorial - Learn SQL with Live Online DatabaseTutorial - Learn SQL with Live Online Database
Tutorial - Learn SQL with Live Online Database
 
10 useful WordPress functions (and maybe more)
10 useful WordPress functions (and maybe more)10 useful WordPress functions (and maybe more)
10 useful WordPress functions (and maybe more)
 
Maria db audit plugin introduction v1.3
Maria db audit plugin introduction v1.3Maria db audit plugin introduction v1.3
Maria db audit plugin introduction v1.3
 
Views and functions
Views and functionsViews and functions
Views and functions
 
Oracle training in hyderabad
Oracle training in hyderabadOracle training in hyderabad
Oracle training in hyderabad
 
Advanced tips of dbms statas
Advanced tips of dbms statasAdvanced tips of dbms statas
Advanced tips of dbms statas
 
Oracle
OracleOracle
Oracle
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
 

Plus de Anar Godjaev

Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server Kurulum
Anar Godjaev
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon Export
Anar Godjaev
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇
Anar Godjaev
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇
Anar Godjaev
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını Inceleme
Anar Godjaev
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed Files
Anar Godjaev
 
Recovery Manager (RMAN)
Recovery Manager (RMAN)Recovery Manager (RMAN)
Recovery Manager (RMAN)
Anar Godjaev
 
Oracle Enterprise Linux 5
Oracle Enterprise Linux 5Oracle Enterprise Linux 5
Oracle Enterprise Linux 5
Anar Godjaev
 
Oracle Database 11g R2 Installation
Oracle Database 11g R2 InstallationOracle Database 11g R2 Installation
Oracle Database 11g R2 Installation
Anar Godjaev
 
Oracle Tablespace Yonetimi
Oracle Tablespace YonetimiOracle Tablespace Yonetimi
Oracle Tablespace Yonetimi
Anar Godjaev
 

Plus de Anar Godjaev (17)

Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server Kurulum
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon Export
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇
 
Contraints
ContraintsContraints
Contraints
 
Oracle SQL
Oracle SQLOracle SQL
Oracle SQL
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını Inceleme
 
PL/SQL Blocks
PL/SQL BlocksPL/SQL Blocks
PL/SQL Blocks
 
Parallel Server
Parallel ServerParallel Server
Parallel Server
 
LogMiner
LogMinerLogMiner
LogMiner
 
ASM
ASMASM
ASM
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed Files
 
Recovery Manager (RMAN)
Recovery Manager (RMAN)Recovery Manager (RMAN)
Recovery Manager (RMAN)
 
Oracle Enterprise Linux 5
Oracle Enterprise Linux 5Oracle Enterprise Linux 5
Oracle Enterprise Linux 5
 
Oracle Database 11g R2 Installation
Oracle Database 11g R2 InstallationOracle Database 11g R2 Installation
Oracle Database 11g R2 Installation
 
Change DB Name
Change DB NameChange DB Name
Change DB Name
 
Oracle Tablespace Yonetimi
Oracle Tablespace YonetimiOracle Tablespace Yonetimi
Oracle Tablespace Yonetimi
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Tuning SGA

  • 1. Anar Godjaev http://anargodjaev.wordpress.com/ Tuning SGA -- monitoring SGA system parameters --- max size of the sga select name, value, description from v$parameterwhere name='sga_max_size'; -- sum of all values of the following query cannot exceed sga_max_size select sum(value) from ( select name, value, description from v$parameter where name in ('java_pool_size', 'shared_pool_size', 'large_pool_size') UNION select name, value, description from v$parameterwhere name like 'db_%cache_size' UNION select name, value, description from v$parameterwhere name='log_buffer' ); ------- lets have a look at something the value of sga_max_size may not be equal to the sum of its components the difference between these tow values will give you the approximate free space selecttrunc(((t2.sga_max_size - t1.total_sga_params)/1024/1024)) FREE_MB from ( select sum(value) total_sga_paramsfrom ( select name, value, description from v$parameter where name in ('java_pool_size', 'shared_pool_size', 'large_pool_size') UNION select name, value, description from v$parameterwhere name like 'db_%cache_size' UNION select name, value, description from v$parameterwhere name='log_buffer' ) ) t1 ,( select sum(value) sga_max_sizefrom v$parameterwhere name='sga_max_size' ) t2; --- other ways of obtaining free sga size -select* from v$sgastatwhere name='free memory'; selectcurrent_size/1024/1024 MB from v$sga_dynamic_free_memory; --- changing sga and sgacomponenets values
  • 2. Anar Godjaev http://anargodjaev.wordpress.com/ --- recommended: sga_max_size should be phsical_memory/2 alter system set sga_max_size=500M scope=spfile; -- changes of this parameter will take affect after instance restart alter system set java_pool_size=150M scope=spfile; -- changes of this parameter will take affect after instance restart alter system set shared_pool_size=150M; alter system set large_pool_size=50M; alter system set db_cache_size=150M; -- which system parameter can be changed without an instance restart -select* from v$parameterwhere issys_modifiable='IMMEDIATE' --- following parameter needs an instance restart -select* from v$parameterwhere issys_modifiable!='FALSE' -- to change these kind of system parameters following steps can be followed alter system set <name>=<value> scope=spfile; -- from now on you should login from sqlplus "/as sysdba" alter system checkpoint; shutdown immediate; startup; Advices for SGA --- advices for sga -select* from V$SHARED_POOL_ADVICE; select* from V$DB_CACHE_ADVICE; select* from V$PGA_TARGET_ADVICE; NOTES: 1- db_cache_advice system parameter should be ON for v$shared_pool_advice system view can be up-to-date. 2- for all advice views statistics_level system parameter should be at least in BASIC mode. -- setting db_cache_advice system parameter -select name, value, issys_modifiable, description from v$parameter where name='db_cache_advice'; alter system set db_cache_advice='ON';
  • 3. Anar Godjaev http://anargodjaev.wordpress.com/ select name, value, issys_modifiable, description from v$parameter where name='db_cache_advice'; --- modifying statistics_level -select value from v$parameterwhere name='statistics_level'; alter system set statistics_level='TYPICAL'; -- allowed values are [ALL|TYPICAL|BASIC]