SlideShare a Scribd company logo
Statspack
1.
1. Statspack;
2. Statspack ;
3. Statspack ;
4. Statspack ;
2. Statspack :
1. 8i ;
2. Statspack AWR , , AWR;
3. Statspack is a set of scripts that capture and report on performance data from within
the Oracle database;
4. Statspack :
1. Capture instance data by taking a "snapshot";
2. Store snapshot data in the database in a separate schema;
3. Create reports between two snapshots;
4. Mark snapshots as baseline information;
5. Use the reports as part of a performance tuning method;
5. Statspack :
1. spcreate.sql: Statspack;
2. statspack.snap: ;
3. spauto.sql: , alter system set job_queue_processes = 5 ;
4. spreport.sql/sprepsql.sql: ;
5. statspack.purge/sppurge.sql: ;
6. sptrunc.sql: Statspack ;
7. spdrop.sql: Statspack ;
8. spexp.par: Statspack ;
3. Statspack:
1. , statspack :CREATE TABLESPACE statspack DATAFILE '+DATA' SIZE
500M AUTOEXTEND ON EXTENT MANAGEMENT LOCAL;
2. sysdba :sqlplus / as sysdba;
3. PERFSTAT :define perfstat_password='oracle';
4. PERFSTAT :define default_tablespace='statspack';
5. PERFSTAT :define temporary_tablespace='temp';
6. Statspack:@?/rdbms/admin/spcreate.sql;
7. :host ls *.lis; spdrop.sql ,
;
8. PERFSTAT ,Statspack ;( ,
)
4. Statspack :
1. :execute statspack.snap;
2. :
3. , :
5. :
1. :
1. 0:General Performance;
2. 5:SQL statments;
3. 6:SQL plans and SQL plan usage;
4. 7:Segment-level statistics, v$segment_statistics ,
:SELECT owner, object_name FROM v$segment_statistics WHERE statistic_name =
'buffer busy waits' ORDER BY VALUE DESC;
5. 10:Parent and child latches, ;
2. :SELECT snap_level FROM perfstat.stats$statspack_parameter;
3. :execute statspack.snap(i_snap_level=>6);
4. , :execute statspack.snap(i_snap_level=>10,
i_modify_parameter=>'true');
5. / ( ):execute
statspack.modify_statspack_parameter(i_snap_level=>7);
6. session , session_id=3 :execute
statspack.snap(i_session_id=>3);
6. / Statspack Baselines :
1. ( ,
i_snap_range=false, ture):exec statspack.make_baseline(i_begin_snap=>2,
i_end_snap=>5, i_snap_range=>true);
2. :exec statspack.make_baseline(i_begin_date=>to_date('2012-
05-01 12:00:00', 'YYYY-MM-DD HH24:MI:SS'), i_begin_date=>to_date('2012-05-02
12:00:00', 'YYYY-MM-DD HH24:MI:SS'));
3. , ( , ,
i_snap_range=false):statspack.clear_baseline(i_begin_snap=>2, i_end_snap=>5,
i_snap_range=>true);
4. :exec statspack.clear_baseline(i_begin_date=>to_date('2012-05-
01 12:00:00', 'YYYY-MM-DD HH24:MI:SS'), i_begin_date=>to_date('2012-05-02 12:00:00',
'YYYY-MM-DD HH24:MI:SS'));
5. exec statspack.purge(); ;
6. baseline , purge baseline baseline snap,
clear baseline;
7. Statspack :
1. perfstat :conn perfstat/oracle;
2. , :
1. :define begin_snap=1;
2. :define end_snap=4;
3. :define report_name=spreport;
3. :@?/rdbms/admin/spreport.sql;
4. :host ls spreport.lst;
8. Statspack :
1. STATISICS_LEVEL=TYPICAL;
2. TIMED_STATISTICS=TRUE ;
3. Statspack AWR , AWR;
4. , 1 , , ###### ;
5. PREFSTAT ;
9. Statspack :
1. :
1. Load Profile(useful with baseline);
2. Instance Efficiency(useful with baseline);
3. Top 5 Timed Events;
4. Time Model;
5. Wait Events and Background Wait Events;
6. Wait Event Histogram(only in Statspack);
2. ,:
1. CONT:Block contention;
2. CPU:CPU consumption;
1. Host CPU;
2. Instance CPU;
3. SQL ordered by CPU;
4. SQL ordered by Gets;
3. LC:Library cache;
1. Shared Pool Statistics;
2. SQL ordered by Parse Calls;
4. MEM:Memory consumption;
1. Virtual Memory Paging;
5. ENQ:Enqueue;
6. IO:I/O consumption;
1. SQL ordered by Elapsed;
2. SQL ordered by Reads;
7. LAT:Latch contention;
8. PGAM:PGA memory consumption;
9. RBS:Rollback segment;
10. UNDO:Automatic undo;
11. SP:Shared pool;
------------------- Statspack -------------------
-- 1. , ;
1. ORCL, 10.2.0.1.0;
2. , 1.67 ;
-- 2. , , , baseline ;
1.Redo size: ( ), ;
2.Logical reads: ( block);
3.block changes: block , , 1:4(13.51:57.68),
OLTP ;
4.Physical reads: block , Logica reads , Physical Reads
, Buffer Cache , ;
5.Physical writes: block , , ;
6.User calls: ;
7.Parses: sql ( ), CPU ; 100 /s ,
300 /s ;
8.Hard parses: , (1 - hard prases/parses)*100%, 95% ,
session_cached_cursors ;
9.Sorts: , ;
10.Logons: , , session ;
11.Executes: , , baseline ;
12.Transactions: , ;
13.Blocks changed per Read: 23.42%;
14.Recursive Call: PL/SQL , ; ;
15.Rollback per transaction: , undo , ,
;
-- 3. , , 100%;
1.Buffer Nowait: 99%, ;
2.Buffer Hit: 99%, , , IO ;
3.Library Hit: 95%, sql ( ,
);
4.Soft Parse: 95%, 80% sql , Load Profile ;
5.Latch Hit: 95% ;
6.Execute to Parse: SQL , SQL , ,
session , 0. , session , SQL SQL
;
7.Parse CPU to Parse Elapsd: CPU 100/102.56 ; 100%, CPU
SQL , ; 100%, CPU , ;
8.Non-Parse CPU , round(100*(1-
parse_cpu/tot_cpu),2). parse_cpu , tot_cpu , 100%, ,
, ;
9.Memory Usage: , 75% 90%; , ;
, , SQL ;
10.Sql with executions > 1: 1 SQL ,
;
11.Memory for SQL w/exec>1: SQL , SQL ,
1 SQL , ;
-- 4. 5 , ;
1. CPU time , DB CPU;
2.DB file scatter read: , ;
, , , (
);
3.DB file sequential read: ( , ); ,
;DB_CACHE_SIZE , ;
PGA , , ; ;
4.Buffer busy wait: , , ; 1 ,
;
5.Latch free: , (SGA) , ;
6.Enqueue: , ; , ,
, , ;
7.Logfile Switch: ( ) ;
8.Log buffer space: , ;
9.Log file sync: session ,session , LGWR redo
entry redo log file, redo log file , session, 10.LGRW ; :
, ;
11.Ldle event: ;
-- 5.CPU ( );
1. CPU 88.78%, 4.07%, 5.44;
2. CPU 5.44%*4.98%, CPU 5.44%*4.98%*44.41%;
-- 6. , v$sys_time_model ;
-- 7. / ;
1. :s- ;cs-1/100s;ms-1/1000s;us-1/1000000s;
2. SQL*Net , , ,
;
-- 8: sql ;
1. sql , , SQL , ;
2. SQL SQL , SQL :
1. SQL , SQL , schema user1 select * from
t; schema user2 select * from t; SQL , schema , ;
2. , ;
3. , SQL 10, SQL
50, SQL ;
4. SQL ;
-- 9. , PGA ;
1. , pga_aggregate_target=96 100% ;
2. V$PGA_TARGET_ADVICE ;
-- 10. , , ;
------------------- Statspack -------------------

More Related Content

What's hot

Developing Information Schema Plugins
Developing Information Schema PluginsDeveloping Information Schema Plugins
Developing Information Schema Plugins
Mark Leith
 
Oracle12c Pluggable Database Hands On - TROUG 2014
Oracle12c Pluggable Database Hands On - TROUG 2014Oracle12c Pluggable Database Hands On - TROUG 2014
Oracle12c Pluggable Database Hands On - TROUG 2014
Özgür Umut Vurgun
 
1.1 sql create and drop database statement
1.1 sql create and drop database statement1.1 sql create and drop database statement
1.1 sql create and drop database statement
MLG College of Learning, Inc
 
Startupandshutdown
StartupandshutdownStartupandshutdown
Startupandshutdown
Vinay Thota
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
Mark Leith
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
Mark Leith
 
How To Configure Apache VirtualHost on RHEL 7 on AWS
How To Configure Apache VirtualHost on RHEL 7 on AWSHow To Configure Apache VirtualHost on RHEL 7 on AWS
How To Configure Apache VirtualHost on RHEL 7 on AWS
VCP Muthukrishna
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12c
uzzal basak
 
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
Sandesh Rao
 
Schedulers
SchedulersSchedulers
Schedulers
Kai Liu
 
Performance schema and_ps_helper
Performance schema and_ps_helperPerformance schema and_ps_helper
Performance schema and_ps_helper
Mark Leith
 
12c installation
12c installation12c installation
12c installation
Osama Mustafa
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)
Seungmin Yu
 
Heritrix DecideRules
Heritrix DecideRulesHeritrix DecideRules
Heritrix DecideRules
Roger Coram
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
maclean liu
 
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
Anar Godjaev
 
Extending MySQL Enterprise Monitor
Extending MySQL Enterprise MonitorExtending MySQL Enterprise Monitor
Extending MySQL Enterprise Monitor
Mark Leith
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
Mark Leith
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different host
Osama Mustafa
 
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
VCP Muthukrishna
 

What's hot (20)

Developing Information Schema Plugins
Developing Information Schema PluginsDeveloping Information Schema Plugins
Developing Information Schema Plugins
 
Oracle12c Pluggable Database Hands On - TROUG 2014
Oracle12c Pluggable Database Hands On - TROUG 2014Oracle12c Pluggable Database Hands On - TROUG 2014
Oracle12c Pluggable Database Hands On - TROUG 2014
 
1.1 sql create and drop database statement
1.1 sql create and drop database statement1.1 sql create and drop database statement
1.1 sql create and drop database statement
 
Startupandshutdown
StartupandshutdownStartupandshutdown
Startupandshutdown
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
How To Configure Apache VirtualHost on RHEL 7 on AWS
How To Configure Apache VirtualHost on RHEL 7 on AWSHow To Configure Apache VirtualHost on RHEL 7 on AWS
How To Configure Apache VirtualHost on RHEL 7 on AWS
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12c
 
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019
 
Schedulers
SchedulersSchedulers
Schedulers
 
Performance schema and_ps_helper
Performance schema and_ps_helperPerformance schema and_ps_helper
Performance schema and_ps_helper
 
12c installation
12c installation12c installation
12c installation
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)
 
Heritrix DecideRules
Heritrix DecideRulesHeritrix DecideRules
Heritrix DecideRules
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
 
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
 
Extending MySQL Enterprise Monitor
Extending MySQL Enterprise MonitorExtending MySQL Enterprise Monitor
Extending MySQL Enterprise Monitor
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different host
 
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
 

Similar to Performance Tuning Tool01-Statspack

SQL Tuning04-Interpreting Execution Plans
SQL Tuning04-Interpreting Execution PlansSQL Tuning04-Interpreting Execution Plans
SQL Tuning04-Interpreting Execution Plans
Zhaoyang Wang
 
SQL Tuning01-Introduction to SQL Tuning
SQL Tuning01-Introduction to SQL TuningSQL Tuning01-Introduction to SQL Tuning
SQL Tuning01-Introduction to SQL Tuning
Zhaoyang Wang
 
Oracle RDBMS Workshop (Part1)
Oracle RDBMS Workshop (Part1)Oracle RDBMS Workshop (Part1)
Oracle RDBMS Workshop (Part1)
Taras Lyuklyanchuk
 
Using AWR for SQL Analysis
Using AWR for SQL AnalysisUsing AWR for SQL Analysis
Using AWR for SQL Analysis
Texas Memory Systems, and IBM Company
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in Dataguard
Jason Arneil
 
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
Monowar Mukul
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01
Karam Abuataya
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11g
fcamachob
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productions
Osama Mustafa
 
ASH and AWR on DB12c
ASH and AWR on DB12cASH and AWR on DB12c
ASH and AWR on DB12c
Kellyn Pot'Vin-Gorman
 
SafePeak Configuration Guide
SafePeak Configuration GuideSafePeak Configuration Guide
SafePeak Configuration Guide
Vladi Vexler
 
Rmoug ashmaster
Rmoug ashmasterRmoug ashmaster
Rmoug ashmaster
Kyle Hailey
 
Oracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseOracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby database
uzzal basak
 
Publishing a Perl6 Module
Publishing a Perl6 ModulePublishing a Perl6 Module
Publishing a Perl6 Module
ast_j
 
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam
 
Okuyama Summary
Okuyama SummaryOkuyama Summary
Okuyama Summary
skoichi
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
YoungHeon (Roy) Kim
 
Sqladria 2009 SRC
Sqladria 2009 SRCSqladria 2009 SRC
Sqladria 2009 SRC
tepsum
 
07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development
rehaniltifat
 
Migrate database to Exadata using RMAN duplicate
Migrate database to Exadata using RMAN duplicateMigrate database to Exadata using RMAN duplicate
Migrate database to Exadata using RMAN duplicate
Umair Mansoob
 

Similar to Performance Tuning Tool01-Statspack (20)

SQL Tuning04-Interpreting Execution Plans
SQL Tuning04-Interpreting Execution PlansSQL Tuning04-Interpreting Execution Plans
SQL Tuning04-Interpreting Execution Plans
 
SQL Tuning01-Introduction to SQL Tuning
SQL Tuning01-Introduction to SQL TuningSQL Tuning01-Introduction to SQL Tuning
SQL Tuning01-Introduction to SQL Tuning
 
Oracle RDBMS Workshop (Part1)
Oracle RDBMS Workshop (Part1)Oracle RDBMS Workshop (Part1)
Oracle RDBMS Workshop (Part1)
 
Using AWR for SQL Analysis
Using AWR for SQL AnalysisUsing AWR for SQL Analysis
Using AWR for SQL Analysis
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in Dataguard
 
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
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11g
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productions
 
ASH and AWR on DB12c
ASH and AWR on DB12cASH and AWR on DB12c
ASH and AWR on DB12c
 
SafePeak Configuration Guide
SafePeak Configuration GuideSafePeak Configuration Guide
SafePeak Configuration Guide
 
Rmoug ashmaster
Rmoug ashmasterRmoug ashmaster
Rmoug ashmaster
 
Oracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseOracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby database
 
Publishing a Perl6 Module
Publishing a Perl6 ModulePublishing a Perl6 Module
Publishing a Perl6 Module
 
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
 
Okuyama Summary
Okuyama SummaryOkuyama Summary
Okuyama Summary
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Sqladria 2009 SRC
Sqladria 2009 SRCSqladria 2009 SRC
Sqladria 2009 SRC
 
07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development
 
Migrate database to Exadata using RMAN duplicate
Migrate database to Exadata using RMAN duplicateMigrate database to Exadata using RMAN duplicate
Migrate database to Exadata using RMAN duplicate
 

More from Zhaoyang Wang

海通证券金融云思考与实践(数据技术嘉年华2017)
海通证券金融云思考与实践(数据技术嘉年华2017)海通证券金融云思考与实践(数据技术嘉年华2017)
海通证券金融云思考与实践(数据技术嘉年华2017)
Zhaoyang Wang
 
云管理平台助力海通金融云建设
云管理平台助力海通金融云建设云管理平台助力海通金融云建设
云管理平台助力海通金融云建设
Zhaoyang Wang
 
海通证券数据库备份恢复云平台实践(OTN Tour Shanghai 2017)
海通证券数据库备份恢复云平台实践(OTN Tour Shanghai 2017)海通证券数据库备份恢复云平台实践(OTN Tour Shanghai 2017)
海通证券数据库备份恢复云平台实践(OTN Tour Shanghai 2017)
Zhaoyang Wang
 
Oracle Compute Cloud Service快速实践
Oracle Compute Cloud Service快速实践Oracle Compute Cloud Service快速实践
Oracle Compute Cloud Service快速实践
Zhaoyang Wang
 
Oracle Compute Cloud Service介绍
Oracle Compute Cloud Service介绍Oracle Compute Cloud Service介绍
Oracle Compute Cloud Service介绍
Zhaoyang Wang
 
Oracle cloud 使用云市场快速搭建小型电商网站
Oracle cloud 使用云市场快速搭建小型电商网站Oracle cloud 使用云市场快速搭建小型电商网站
Oracle cloud 使用云市场快速搭建小型电商网站
Zhaoyang Wang
 
Oracle cloud ravello介绍及测试账户申请
Oracle cloud ravello介绍及测试账户申请Oracle cloud ravello介绍及测试账户申请
Oracle cloud ravello介绍及测试账户申请
Zhaoyang Wang
 
Oracle cloud 云介绍及测试账户申请
Oracle cloud 云介绍及测试账户申请Oracle cloud 云介绍及测试账户申请
Oracle cloud 云介绍及测试账户申请
Zhaoyang Wang
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
Zhaoyang Wang
 
SQL Tuning02-Intorduction to the CBO Optimizer
SQL Tuning02-Intorduction to the CBO OptimizerSQL Tuning02-Intorduction to the CBO Optimizer
SQL Tuning02-Intorduction to the CBO Optimizer
Zhaoyang Wang
 
MySQL Fulltext Search Tutorial
MySQL Fulltext Search TutorialMySQL Fulltext Search Tutorial
MySQL Fulltext Search Tutorial
Zhaoyang Wang
 
Data Organization in InnoDB
Data Organization in InnoDBData Organization in InnoDB
Data Organization in InnoDB
Zhaoyang Wang
 
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
Zhaoyang Wang
 
Oracle enterprise manager cloud control 12c r5 agent installation
Oracle enterprise manager cloud control 12c r5 agent installationOracle enterprise manager cloud control 12c r5 agent installation
Oracle enterprise manager cloud control 12c r5 agent installation
Zhaoyang Wang
 
MYSQLCLONE Introduction
MYSQLCLONE IntroductionMYSQLCLONE Introduction
MYSQLCLONE Introduction
Zhaoyang Wang
 
Oracle security 08-oracle network security
Oracle security 08-oracle network securityOracle security 08-oracle network security
Oracle security 08-oracle network security
Zhaoyang Wang
 
Oracle security 02-administering user security
Oracle security 02-administering user securityOracle security 02-administering user security
Oracle security 02-administering user security
Zhaoyang Wang
 
Interpreting execution plans
Interpreting execution plansInterpreting execution plans
Interpreting execution plans
Zhaoyang Wang
 
Intorduction to the cbo optimizer
Intorduction to the cbo optimizerIntorduction to the cbo optimizer
Intorduction to the cbo optimizer
Zhaoyang Wang
 

More from Zhaoyang Wang (20)

海通证券金融云思考与实践(数据技术嘉年华2017)
海通证券金融云思考与实践(数据技术嘉年华2017)海通证券金融云思考与实践(数据技术嘉年华2017)
海通证券金融云思考与实践(数据技术嘉年华2017)
 
云管理平台助力海通金融云建设
云管理平台助力海通金融云建设云管理平台助力海通金融云建设
云管理平台助力海通金融云建设
 
海通证券数据库备份恢复云平台实践(OTN Tour Shanghai 2017)
海通证券数据库备份恢复云平台实践(OTN Tour Shanghai 2017)海通证券数据库备份恢复云平台实践(OTN Tour Shanghai 2017)
海通证券数据库备份恢复云平台实践(OTN Tour Shanghai 2017)
 
Oracle Compute Cloud Service快速实践
Oracle Compute Cloud Service快速实践Oracle Compute Cloud Service快速实践
Oracle Compute Cloud Service快速实践
 
Oracle Compute Cloud Service介绍
Oracle Compute Cloud Service介绍Oracle Compute Cloud Service介绍
Oracle Compute Cloud Service介绍
 
Oracle cloud 使用云市场快速搭建小型电商网站
Oracle cloud 使用云市场快速搭建小型电商网站Oracle cloud 使用云市场快速搭建小型电商网站
Oracle cloud 使用云市场快速搭建小型电商网站
 
Oracle cloud ravello介绍及测试账户申请
Oracle cloud ravello介绍及测试账户申请Oracle cloud ravello介绍及测试账户申请
Oracle cloud ravello介绍及测试账户申请
 
Oracle cloud 云介绍及测试账户申请
Oracle cloud 云介绍及测试账户申请Oracle cloud 云介绍及测试账户申请
Oracle cloud 云介绍及测试账户申请
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
 
SQL Tuning02-Intorduction to the CBO Optimizer
SQL Tuning02-Intorduction to the CBO OptimizerSQL Tuning02-Intorduction to the CBO Optimizer
SQL Tuning02-Intorduction to the CBO Optimizer
 
MySQL Fulltext Search Tutorial
MySQL Fulltext Search TutorialMySQL Fulltext Search Tutorial
MySQL Fulltext Search Tutorial
 
Data Organization in InnoDB
Data Organization in InnoDBData Organization in InnoDB
Data Organization in InnoDB
 
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
 
Oracle enterprise manager cloud control 12c r5 agent installation
Oracle enterprise manager cloud control 12c r5 agent installationOracle enterprise manager cloud control 12c r5 agent installation
Oracle enterprise manager cloud control 12c r5 agent installation
 
Why use MySQL
Why use MySQLWhy use MySQL
Why use MySQL
 
MYSQLCLONE Introduction
MYSQLCLONE IntroductionMYSQLCLONE Introduction
MYSQLCLONE Introduction
 
Oracle security 08-oracle network security
Oracle security 08-oracle network securityOracle security 08-oracle network security
Oracle security 08-oracle network security
 
Oracle security 02-administering user security
Oracle security 02-administering user securityOracle security 02-administering user security
Oracle security 02-administering user security
 
Interpreting execution plans
Interpreting execution plansInterpreting execution plans
Interpreting execution plans
 
Intorduction to the cbo optimizer
Intorduction to the cbo optimizerIntorduction to the cbo optimizer
Intorduction to the cbo optimizer
 

Recently uploaded

9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 

Recently uploaded (20)

9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 

Performance Tuning Tool01-Statspack

  • 1. Statspack 1. 1. Statspack; 2. Statspack ; 3. Statspack ; 4. Statspack ; 2. Statspack : 1. 8i ; 2. Statspack AWR , , AWR; 3. Statspack is a set of scripts that capture and report on performance data from within the Oracle database; 4. Statspack : 1. Capture instance data by taking a "snapshot"; 2. Store snapshot data in the database in a separate schema; 3. Create reports between two snapshots; 4. Mark snapshots as baseline information; 5. Use the reports as part of a performance tuning method; 5. Statspack : 1. spcreate.sql: Statspack; 2. statspack.snap: ; 3. spauto.sql: , alter system set job_queue_processes = 5 ; 4. spreport.sql/sprepsql.sql: ; 5. statspack.purge/sppurge.sql: ; 6. sptrunc.sql: Statspack ; 7. spdrop.sql: Statspack ; 8. spexp.par: Statspack ; 3. Statspack: 1. , statspack :CREATE TABLESPACE statspack DATAFILE '+DATA' SIZE 500M AUTOEXTEND ON EXTENT MANAGEMENT LOCAL; 2. sysdba :sqlplus / as sysdba; 3. PERFSTAT :define perfstat_password='oracle'; 4. PERFSTAT :define default_tablespace='statspack'; 5. PERFSTAT :define temporary_tablespace='temp'; 6. Statspack:@?/rdbms/admin/spcreate.sql; 7. :host ls *.lis; spdrop.sql , ; 8. PERFSTAT ,Statspack ;( , ) 4. Statspack : 1. :execute statspack.snap; 2. : 3. , : 5. : 1. : 1. 0:General Performance; 2. 5:SQL statments; 3. 6:SQL plans and SQL plan usage; 4. 7:Segment-level statistics, v$segment_statistics , :SELECT owner, object_name FROM v$segment_statistics WHERE statistic_name = 'buffer busy waits' ORDER BY VALUE DESC; 5. 10:Parent and child latches, ; 2. :SELECT snap_level FROM perfstat.stats$statspack_parameter; 3. :execute statspack.snap(i_snap_level=>6); 4. , :execute statspack.snap(i_snap_level=>10, i_modify_parameter=>'true'); 5. / ( ):execute statspack.modify_statspack_parameter(i_snap_level=>7); 6. session , session_id=3 :execute statspack.snap(i_session_id=>3); 6. / Statspack Baselines : 1. ( , i_snap_range=false, ture):exec statspack.make_baseline(i_begin_snap=>2, i_end_snap=>5, i_snap_range=>true); 2. :exec statspack.make_baseline(i_begin_date=>to_date('2012- 05-01 12:00:00', 'YYYY-MM-DD HH24:MI:SS'), i_begin_date=>to_date('2012-05-02 12:00:00', 'YYYY-MM-DD HH24:MI:SS')); 3. , ( , , i_snap_range=false):statspack.clear_baseline(i_begin_snap=>2, i_end_snap=>5, i_snap_range=>true); 4. :exec statspack.clear_baseline(i_begin_date=>to_date('2012-05- 01 12:00:00', 'YYYY-MM-DD HH24:MI:SS'), i_begin_date=>to_date('2012-05-02 12:00:00', 'YYYY-MM-DD HH24:MI:SS')); 5. exec statspack.purge(); ; 6. baseline , purge baseline baseline snap, clear baseline; 7. Statspack : 1. perfstat :conn perfstat/oracle; 2. , : 1. :define begin_snap=1; 2. :define end_snap=4; 3. :define report_name=spreport; 3. :@?/rdbms/admin/spreport.sql; 4. :host ls spreport.lst; 8. Statspack : 1. STATISICS_LEVEL=TYPICAL; 2. TIMED_STATISTICS=TRUE ; 3. Statspack AWR , AWR; 4. , 1 , , ###### ; 5. PREFSTAT ; 9. Statspack : 1. : 1. Load Profile(useful with baseline); 2. Instance Efficiency(useful with baseline); 3. Top 5 Timed Events; 4. Time Model; 5. Wait Events and Background Wait Events; 6. Wait Event Histogram(only in Statspack); 2. ,: 1. CONT:Block contention; 2. CPU:CPU consumption; 1. Host CPU; 2. Instance CPU; 3. SQL ordered by CPU; 4. SQL ordered by Gets; 3. LC:Library cache; 1. Shared Pool Statistics; 2. SQL ordered by Parse Calls; 4. MEM:Memory consumption; 1. Virtual Memory Paging; 5. ENQ:Enqueue; 6. IO:I/O consumption; 1. SQL ordered by Elapsed; 2. SQL ordered by Reads; 7. LAT:Latch contention; 8. PGAM:PGA memory consumption; 9. RBS:Rollback segment; 10. UNDO:Automatic undo; 11. SP:Shared pool; ------------------- Statspack ------------------- -- 1. , ; 1. ORCL, 10.2.0.1.0; 2. , 1.67 ; -- 2. , , , baseline ; 1.Redo size: ( ), ; 2.Logical reads: ( block); 3.block changes: block , , 1:4(13.51:57.68), OLTP ; 4.Physical reads: block , Logica reads , Physical Reads , Buffer Cache , ; 5.Physical writes: block , , ; 6.User calls: ; 7.Parses: sql ( ), CPU ; 100 /s , 300 /s ; 8.Hard parses: , (1 - hard prases/parses)*100%, 95% , session_cached_cursors ; 9.Sorts: , ; 10.Logons: , , session ; 11.Executes: , , baseline ; 12.Transactions: , ; 13.Blocks changed per Read: 23.42%; 14.Recursive Call: PL/SQL , ; ; 15.Rollback per transaction: , undo , , ; -- 3. , , 100%; 1.Buffer Nowait: 99%, ; 2.Buffer Hit: 99%, , , IO ; 3.Library Hit: 95%, sql ( , ); 4.Soft Parse: 95%, 80% sql , Load Profile ; 5.Latch Hit: 95% ; 6.Execute to Parse: SQL , SQL , , session , 0. , session , SQL SQL ; 7.Parse CPU to Parse Elapsd: CPU 100/102.56 ; 100%, CPU SQL , ; 100%, CPU , ; 8.Non-Parse CPU , round(100*(1- parse_cpu/tot_cpu),2). parse_cpu , tot_cpu , 100%, , , ; 9.Memory Usage: , 75% 90%; , ; , , SQL ; 10.Sql with executions > 1: 1 SQL , ; 11.Memory for SQL w/exec>1: SQL , SQL , 1 SQL , ; -- 4. 5 , ; 1. CPU time , DB CPU; 2.DB file scatter read: , ; , , , ( ); 3.DB file sequential read: ( , ); , ;DB_CACHE_SIZE , ; PGA , , ; ; 4.Buffer busy wait: , , ; 1 , ; 5.Latch free: , (SGA) , ; 6.Enqueue: , ; , , , , ; 7.Logfile Switch: ( ) ; 8.Log buffer space: , ; 9.Log file sync: session ,session , LGWR redo entry redo log file, redo log file , session, 10.LGRW ; : , ; 11.Ldle event: ; -- 5.CPU ( ); 1. CPU 88.78%, 4.07%, 5.44; 2. CPU 5.44%*4.98%, CPU 5.44%*4.98%*44.41%; -- 6. , v$sys_time_model ; -- 7. / ; 1. :s- ;cs-1/100s;ms-1/1000s;us-1/1000000s; 2. SQL*Net , , , ; -- 8: sql ; 1. sql , , SQL , ; 2. SQL SQL , SQL : 1. SQL , SQL , schema user1 select * from t; schema user2 select * from t; SQL , schema , ; 2. , ; 3. , SQL 10, SQL 50, SQL ; 4. SQL ; -- 9. , PGA ; 1. , pga_aggregate_target=96 100% ; 2. V$PGA_TARGET_ADVICE ; -- 10. , , ; ------------------- Statspack -------------------