SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Tips and Tricks for Optimizing
Performance with SAP Sybase
ASE



           Chris Baker
           Principal System Consultant
           SAP
           c.baker@sap.com
Disclaimer
        In this session we will be giving tips and guidelines for ASE to
        provide novices and experienced DBAs with information they
        may not know
        This is by no means exhaustive. We strongly suggest taking
        advantage of the education course offerings available to
        enhance your in-depth knowledge of ASE




2 – October 25, 2012
Agenda
        • Planning
        • Configuration
        • Running/Monitoring
        • Troubleshooting




3 – October 25, 2012
Planning




4 – October 25, 2012
Planning
        1. Review latest platform Release Bulletins, Installation and
           Configuration Guides
                  http://infocenter.sybase.com/help/topic/com.sybase.infocenter.help.
                   ase.15.7.2/title.htm
        2. Ensure for production servers that memory and CPU map
           1:1 to physical hardware.
                  Avoid swapping at all costs
                  Do not overallocate CPU’s
                        1 physical core = 1 engine (pre 15.7)
                        1 physical core = 1 thread (syb_default_pool)
                  Be aware of SAN and storage configuration




5 – October 25, 2012
Planning
        3. Make sure O/S configuration settings are sufficient
                  RH Linux
                          ulimits - /etc/security/limits.conf
                          shared memory - /etc/sysctl.conf
                          /proc/sys/fs/aio_max_nr – might need increasing
                          noop scheduler
                  etc.
        4. O/S patches and drivers are up-to-date
                  Might require firmware updates




6 – October 25, 2012
Planning
        5. Separate Log, Tempdb and Data devices
                      Spreads the I/O load
                      Separate Log ensures proper database recovery from database and
                       transaction log dumps
        6. Target R/W speeds should be 5ms per I/O or better
        7. Use Concurrent/Direct I/O for file systems
                  Turn off journaling
                  Buffered I/O OK for tempdbs




7 – October 25, 2012
Configuration




8 – October 25, 2012
Configuration
        1. Use the Threaded Kernel
                  sp_configure ‘kernel mode’, ‘threaded’
        2. Use 4K server page sizes or better
                      Performance with modern storage systems
        3. Use UTF-8 character set
        4. Separate Data, Log and Tempdb Caches
                      Log caches should always have cache partitions = 1
        5. Create Multiple Tempdbs
                      Dedicate a tempdb to ‘sa’
        6. Enable Statement Cache and literal autoparam
                  sp_configure ‘statement cache size’
                  sp_configure ‘number of open objects’
9 – October 25, 2012
Configuration
       7. Number of worker processes
                  Provide a pool for parallel index operations, partitions and ‘dbcc
                   checkstorage’
       8. Configure Job Scheduler for maintenance jobs
                       Update Index Statistics
       9. Create Index Performance
                  number of sort buffers = 5000
       10. Set max possible CPU utilization
                  max online engines = <number of cores>




10 – October 25, 2012
Configuration
       11. Network
                  max network packet size = 16384
                  additional network memory = 10485760
       12. Reduce Tempdb I/O
                  direct i/o off, dsync off (filesystem)
                  max buffers per lava operator = 20480
                  session tempdb log cache size = 32768
       13. Add an ‘sa’-only listener
                 Additional ‘master’ entry in server interfaces file




11 – October 25, 2012
Running/Monitoring




12 – October 25, 2012
Running/Monitoring
       1. Use Optimization Goals and Login Triggers
                  set plan optgoal allrows_mix | allrows_oltp | allrows_dss
       2. Set optimizer level = ase_current
                       Otherwise no benefit from patches
       3. Run ‘Update Index Statistics’ regularly
                  Leave steps at 20-40
                  Histogram tuning factor = 20
                  Job Scheduler (datachange)
       4. Change ‘enable housekeeper GC’ from default
                  4 - for batches
                  5 - for OLTP



13 – October 25, 2012
Running/Monitoring
       5. Check statistics regularly
                       systabstats/sysstatistics
                       sp_statistics
                       capture missing statistics
       6. Manage ASE lock granularity
                       Don’t overuse DRL
       7. Monitoring
                  Turn on MDA monitoring
                  Configure and use Sybase Control Center




14 – October 25, 2012
Optimization Goals
       • fastfirstrow
                  optimizes queries so that Adaptive Server returns the first few rows as
                   quickly as possible.
       • allrows_oltp
                  optimizes queries so that Adaptive Server uses a limited number of
                   optimization criteria (described in “Optimization criteria”) to find a good
                   query plan. allrows_oltp is most useful for purely OLTP queries.
       • allrows_mixed
                  optimizes queries so that Adaptive Server uses most available
                   optimization techniques, including merge_join and parallel, to find the
                   best query plan. allrows_mixed, which is the default strategy, is most
                   useful in a mixed-query environment.
       • allrows_dss
                  optimizes queries so that Adaptive Server uses all available optimization
                   techniques to find the best query plan, including hash join, advanced
                   aggregates processing, and bushy tree plan. allrows_dss is most useful in a
                   DSS environment.


15 – October 25, 2012
Housekeeper
       • The housekeeper performs 3 main functions
                  Wash
                         Runs only during idle times
                         Can help reduce buffer washing during transaction processing
                         Managed using ‘housekeeper free write percent’ (default = 1) i.e. only increase disk
                          i/o by 1% above current
                  Chores
                         Only runs at idle times. Performs tasks such as:
                             –   Flushing table statistics
                             –   Flushing account statistics
                             –   Handling timeout of detached transactions
                             –   Checking licence usage

                  Garbage Collection
                         Controlled by ‘enable housekeeper GC’
                         defaults to lazy collection of forwarded and deleted rows (1)
                             – tables will require more maintenance (rebuild/reorg) to recover space for reuse
                         Set to 4 for batch processing
                             – aggressive collection of forwarded rows and deleted space
                         Set to 5 for OLTP processing
                             – aggressive collection of forwared rows and lazy collection of deleted space

16 – October 25, 2012
Sybase Control Center




17 – October 25, 2012
Troubleshooting




18 – October 25, 2012
Troubleshooting
       1. Run sp_sysmon to get a general look at server performance
                  sp_sysmon “00:10:00”
       2. MDA is your friend
                  Narrow down to the query in question
                  Examine waits, device io performance, cache usage, etc.
       3. Isolate and examine the query using set options
       4. Use QP Metrics/QP Tune
                  enable metrics capture
       5. Application Tracing
                  connect to a spid and capture show output




19 – October 25, 2012
A MDA Starter Config
                        Always on:          As needed (dynamically):     Only when truly desperate:

       • Must have’s:                     • enable stmt cache           • Use sysquerymetrics?
         • enable monitoring = 1            monitoring = 1              • …Or enable the text pipe
         • wait event timing = 1          • statement pipe active = 1     • Gets everything - not just
         • process wait events = 1        • statement pipe max              bad queries
         • object lockwait timing = 1       messages = 25000                • sql text pipe active = 1
         • SQL batch capture = 1                                            • sql text pipe max
         • statement statistics active                                        messages = 1000
           =1                                                           • Use app
         • per object statistics active                                   tracing/sp_showplan
           =1                                                             instead? (or plan pipe)
         • max SQL text monitored =                                       • plan text pipe active = 1
           2048                                                           • plan text pipe max
       • Nice to have’s:                                                    messages = 1000
         • errorlog pipe active = 1
         • errorlog pipe max
           messages = 1000
         • deadlock pipe active = 1
         • deadlock pipe max
           messages = 100


20 – October 25, 2012
Some MDA Tables
       Problem                                   MDA Tables
       Currently Running Queries                 monProcessStatement,
                                                 monProcessObject
       Finding Tempdb Hogs                       monProcessObject
       Previously Executed Queries/Proc Issues   monSysStatement
       Proc Cache Optimization Hogs              monSysStatement, monProcessStatement
       What is ASE waiting for?                  monSysWaits
       Find currently open objects               monOpenObjectActivity
       SQL and Plan Text                         monSysSQLText, monSysPlanText




21 – October 25, 2012
Set option show….
       •      set option show <normal/brief/long/on/off>
                  Basic syntax common to all
                  Execute this one first prior to any of the below when used together (other wise it will reset the
                   below to the level of detail for show command itself)
       •      … show_lop <…>                                 Shows logical operators used.
       •      … show_managers <…>                            Shows data structure managers used.
       •      … show_log_props <…>                           Shows the logical managers used.
       •      … show_parallel <…>                            Shows parallel query optimization.
       •      … show_histograms <…>                          Shows the histograms processed.
       •      … show_abstract_plan <…>                       Shows the details of an abstract plan.
       •      … show_search_engine <…>                       Shows the details of a search engine.
       •      … show_counters <…>                            Shows the optimization counters.
       •      … show_best_plan <…>                           Shows the details of the best QP plan.
       •      … show_code_gen <…>                            Shows the details of code generation.
       •      … show_pio_costing <…>                         Shows estimates of physical I/O
       •      … show_lio_costing <…>                         Shows estimates of logical input/output.
       •      … show_elimination <…>                         Shows partition elimination.
       •      … show_missing_stats <…>                       Shows columns with missing stats.



22 – October 25, 2012
23 – October 25, 2012
Useful links
       • SAP ASE Developer Center
                  http://scn.sap.com/community/developer-center/oltp-db
       • SAP Sybase Education Curriculum
                  https://training.sap.com/us/en/courses-and-curricula/sybase
       • Sybooks ASE 15.7 Documentation
                  http://infocenter.sybase.com/help/topic/com.sybase.infocenter.help.
                   ase.15.7.2/title.htm
       • SAP Notes specific to running SAP on ASE
                  https://service.sap.com/sap/support/notes/1680803
                  https://service.sap.com/sap/support/notes/1722359
                  https://service.sap.com/sap/support/notes/1539125



24 – October 25, 2012

Contenu connexe

Tendances

The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesDatabricks
 
Oracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodOracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodLudovico Caldara
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterFrederic Descamps
 
HA, Scalability, DR & MAA in Oracle Database 21c - Overview
HA, Scalability, DR & MAA in Oracle Database 21c - OverviewHA, Scalability, DR & MAA in Oracle Database 21c - Overview
HA, Scalability, DR & MAA in Oracle Database 21c - OverviewMarkus Michalewicz
 
Understanding and Improving Code Generation
Understanding and Improving Code GenerationUnderstanding and Improving Code Generation
Understanding and Improving Code GenerationDatabricks
 
Cluster Health Advisor (CHA) Deep Dive by Mark Scardina
Cluster Health Advisor (CHA)  Deep Dive by Mark ScardinaCluster Health Advisor (CHA)  Deep Dive by Mark Scardina
Cluster Health Advisor (CHA) Deep Dive by Mark ScardinaMarkus Michalewicz
 
Apache Ignite vs Alluxio: Memory Speed Big Data Analytics
Apache Ignite vs Alluxio: Memory Speed Big Data AnalyticsApache Ignite vs Alluxio: Memory Speed Big Data Analytics
Apache Ignite vs Alluxio: Memory Speed Big Data AnalyticsDataWorks Summit
 
Open Source Lambda Architecture for deep learning
Open Source Lambda Architecture for deep learningOpen Source Lambda Architecture for deep learning
Open Source Lambda Architecture for deep learningPatrick Nicolas
 
Standard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & HowStandard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & HowMarkus Michalewicz
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
 
Understanding oracle rac internals part 2 - slides
Understanding oracle rac internals   part 2 - slidesUnderstanding oracle rac internals   part 2 - slides
Understanding oracle rac internals part 2 - slidesMohamed Farouk
 
Performance Stability, Tips and Tricks and Underscores
Performance Stability, Tips and Tricks and UnderscoresPerformance Stability, Tips and Tricks and Underscores
Performance Stability, Tips and Tricks and UnderscoresJitendra Singh
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HAharoonm
 
Evaluation of TPC-H on Spark and Spark SQL in ALOJA
Evaluation of TPC-H on Spark and Spark SQL in ALOJAEvaluation of TPC-H on Spark and Spark SQL in ALOJA
Evaluation of TPC-H on Spark and Spark SQL in ALOJADataWorks Summit
 
How to use histograms to get better performance
How to use histograms to get better performanceHow to use histograms to get better performance
How to use histograms to get better performanceMariaDB plc
 
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACThe Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACMarkus Michalewicz
 
PySpark Best Practices
PySpark Best PracticesPySpark Best Practices
PySpark Best PracticesCloudera, Inc.
 
Apache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the CoversApache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the CoversScyllaDB
 
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 IQDon Brizendine
 

Tendances (20)

The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
 
Oracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodOracle Client Failover - Under The Hood
Oracle Client Failover - Under The Hood
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
HA, Scalability, DR & MAA in Oracle Database 21c - Overview
HA, Scalability, DR & MAA in Oracle Database 21c - OverviewHA, Scalability, DR & MAA in Oracle Database 21c - Overview
HA, Scalability, DR & MAA in Oracle Database 21c - Overview
 
Understanding and Improving Code Generation
Understanding and Improving Code GenerationUnderstanding and Improving Code Generation
Understanding and Improving Code Generation
 
Cluster Health Advisor (CHA) Deep Dive by Mark Scardina
Cluster Health Advisor (CHA)  Deep Dive by Mark ScardinaCluster Health Advisor (CHA)  Deep Dive by Mark Scardina
Cluster Health Advisor (CHA) Deep Dive by Mark Scardina
 
Apache Ignite vs Alluxio: Memory Speed Big Data Analytics
Apache Ignite vs Alluxio: Memory Speed Big Data AnalyticsApache Ignite vs Alluxio: Memory Speed Big Data Analytics
Apache Ignite vs Alluxio: Memory Speed Big Data Analytics
 
Open Source Lambda Architecture for deep learning
Open Source Lambda Architecture for deep learningOpen Source Lambda Architecture for deep learning
Open Source Lambda Architecture for deep learning
 
Standard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & HowStandard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & How
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
 
Understanding oracle rac internals part 2 - slides
Understanding oracle rac internals   part 2 - slidesUnderstanding oracle rac internals   part 2 - slides
Understanding oracle rac internals part 2 - slides
 
Performance Stability, Tips and Tricks and Underscores
Performance Stability, Tips and Tricks and UnderscoresPerformance Stability, Tips and Tricks and Underscores
Performance Stability, Tips and Tricks and Underscores
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 
Evaluation of TPC-H on Spark and Spark SQL in ALOJA
Evaluation of TPC-H on Spark and Spark SQL in ALOJAEvaluation of TPC-H on Spark and Spark SQL in ALOJA
Evaluation of TPC-H on Spark and Spark SQL in ALOJA
 
How to use histograms to get better performance
How to use histograms to get better performanceHow to use histograms to get better performance
How to use histograms to get better performance
 
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACThe Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
 
PySpark Best Practices
PySpark Best PracticesPySpark Best Practices
PySpark Best Practices
 
Data Guard Architecture & Setup
Data Guard Architecture & SetupData Guard Architecture & Setup
Data Guard Architecture & Setup
 
Apache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the CoversApache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the Covers
 
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
 

En vedette

ASE Semantic Partitions- A Case Study
ASE Semantic Partitions- A Case Study ASE Semantic Partitions- A Case Study
ASE Semantic Partitions- A Case Study SAP Technology
 
Choosing Indexes For Performance
Choosing Indexes For PerformanceChoosing Indexes For Performance
Choosing Indexes For PerformanceSAP Technology
 
Leveraging SAP ASE Workload Analyzer to optimize your database environment
Leveraging SAP ASE Workload Analyzer to optimize your database environmentLeveraging SAP ASE Workload Analyzer to optimize your database environment
Leveraging SAP ASE Workload Analyzer to optimize your database environmentSAP Technology
 
Git migration - Lessons learned
Git migration - Lessons learnedGit migration - Lessons learned
Git migration - Lessons learnedTomasz Zarna
 
Configuring and using SIDB for ASE CE SP130
Configuring and using SIDB for ASE CE SP130Configuring and using SIDB for ASE CE SP130
Configuring and using SIDB for ASE CE SP130SAP Technology
 
Sybase ASE 15.7- Two Case Studies of Successful Migration
Sybase ASE 15.7- Two Case Studies of Successful Migration Sybase ASE 15.7- Two Case Studies of Successful Migration
Sybase ASE 15.7- Two Case Studies of Successful Migration SAP Technology
 
What's New in SAP Replication Server 15.7.1 SP100
What's New in SAP Replication Server 15.7.1 SP100What's New in SAP Replication Server 15.7.1 SP100
What's New in SAP Replication Server 15.7.1 SP100Dobler Consulting
 
Tabular Data Stream: The Binding Between Client and SAP ASE
Tabular Data Stream: The Binding Between Client and SAP ASETabular Data Stream: The Binding Between Client and SAP ASE
Tabular Data Stream: The Binding Between Client and SAP ASESAP Technology
 
Storage Optimization and Operational Simplicity in SAP Adaptive Server Enter...
Storage Optimization and Operational Simplicity in SAP  Adaptive Server Enter...Storage Optimization and Operational Simplicity in SAP  Adaptive Server Enter...
Storage Optimization and Operational Simplicity in SAP Adaptive Server Enter...SAP Technology
 
Hadoop MapReduce Fundamentals
Hadoop MapReduce FundamentalsHadoop MapReduce Fundamentals
Hadoop MapReduce FundamentalsLynn Langit
 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were PossibleLukas Eder
 
DB 3 Sybase ASE 15 & MS SQL Server
DB 3 Sybase ASE 15 & MS SQL Server DB 3 Sybase ASE 15 & MS SQL Server
DB 3 Sybase ASE 15 & MS SQL Server Sunny U Okoro
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great InfographicsSlideShare
 
Masters of SlideShare
Masters of SlideShareMasters of SlideShare
Masters of SlideShareKapost
 
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareSTOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareEmpowered Presentations
 

En vedette (17)

ASE Semantic Partitions- A Case Study
ASE Semantic Partitions- A Case Study ASE Semantic Partitions- A Case Study
ASE Semantic Partitions- A Case Study
 
Choosing Indexes For Performance
Choosing Indexes For PerformanceChoosing Indexes For Performance
Choosing Indexes For Performance
 
Leveraging SAP ASE Workload Analyzer to optimize your database environment
Leveraging SAP ASE Workload Analyzer to optimize your database environmentLeveraging SAP ASE Workload Analyzer to optimize your database environment
Leveraging SAP ASE Workload Analyzer to optimize your database environment
 
Git migration - Lessons learned
Git migration - Lessons learnedGit migration - Lessons learned
Git migration - Lessons learned
 
How To Be a Great DBA
How To Be a Great DBAHow To Be a Great DBA
How To Be a Great DBA
 
Configuring and using SIDB for ASE CE SP130
Configuring and using SIDB for ASE CE SP130Configuring and using SIDB for ASE CE SP130
Configuring and using SIDB for ASE CE SP130
 
Sap replication server
Sap replication serverSap replication server
Sap replication server
 
Sybase ASE 15.7- Two Case Studies of Successful Migration
Sybase ASE 15.7- Two Case Studies of Successful Migration Sybase ASE 15.7- Two Case Studies of Successful Migration
Sybase ASE 15.7- Two Case Studies of Successful Migration
 
What's New in SAP Replication Server 15.7.1 SP100
What's New in SAP Replication Server 15.7.1 SP100What's New in SAP Replication Server 15.7.1 SP100
What's New in SAP Replication Server 15.7.1 SP100
 
Tabular Data Stream: The Binding Between Client and SAP ASE
Tabular Data Stream: The Binding Between Client and SAP ASETabular Data Stream: The Binding Between Client and SAP ASE
Tabular Data Stream: The Binding Between Client and SAP ASE
 
Storage Optimization and Operational Simplicity in SAP Adaptive Server Enter...
Storage Optimization and Operational Simplicity in SAP  Adaptive Server Enter...Storage Optimization and Operational Simplicity in SAP  Adaptive Server Enter...
Storage Optimization and Operational Simplicity in SAP Adaptive Server Enter...
 
Hadoop MapReduce Fundamentals
Hadoop MapReduce FundamentalsHadoop MapReduce Fundamentals
Hadoop MapReduce Fundamentals
 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible
 
DB 3 Sybase ASE 15 & MS SQL Server
DB 3 Sybase ASE 15 & MS SQL Server DB 3 Sybase ASE 15 & MS SQL Server
DB 3 Sybase ASE 15 & MS SQL Server
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great Infographics
 
Masters of SlideShare
Masters of SlideShareMasters of SlideShare
Masters of SlideShare
 
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareSTOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
 

Similaire à Tips and Tricks for SAP Sybase ASE

MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014Ryusuke Kajiyama
 
MySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMark Swarbrick
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance TuningMark Swarbrick
 
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RACAUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RACSandesh Rao
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionSplunk
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 Geir Høydalsvik
 
9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdfsreedb2
 
Got Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckGot Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckLuis Guirigay
 
MySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksMySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksDave Stokes
 
Data Guard Deep Dive UKOUG 2012
Data Guard Deep Dive UKOUG 2012Data Guard Deep Dive UKOUG 2012
Data Guard Deep Dive UKOUG 2012Emre Baransel
 
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptxCON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptxSergioBruno21
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMorgan Tocker
 
Postgresql in Education
Postgresql in EducationPostgresql in Education
Postgresql in Educationdostatni
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the fieldJoAnna Cheshire
 
Understanding Elastic Block Store Availability and Performance
Understanding Elastic Block Store Availability and PerformanceUnderstanding Elastic Block Store Availability and Performance
Understanding Elastic Block Store Availability and PerformanceAmazon Web Services
 
Tips, Tricks & Best Practices for large scale HDInsight Deployments
Tips, Tricks & Best Practices for large scale HDInsight DeploymentsTips, Tricks & Best Practices for large scale HDInsight Deployments
Tips, Tricks & Best Practices for large scale HDInsight DeploymentsAshish Thapliyal
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightRed_Hat_Storage
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightColleen Corrice
 

Similaire à Tips and Tricks for SAP Sybase ASE (20)

MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
MySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & Tune
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance Tuning
 
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RACAUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout Session
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
 
9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf
 
Got Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckGot Problems? Let's Do a Health Check
Got Problems? Let's Do a Health Check
 
MySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksMySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disks
 
Data Guard Deep Dive UKOUG 2012
Data Guard Deep Dive UKOUG 2012Data Guard Deep Dive UKOUG 2012
Data Guard Deep Dive UKOUG 2012
 
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptxCON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
CON5451_Brydon-OOW2014_Brydon_CON5451 (1).pptx
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
Apouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12cApouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12c
 
Postgresql in Education
Postgresql in EducationPostgresql in Education
Postgresql in Education
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the field
 
Understanding Elastic Block Store Availability and Performance
Understanding Elastic Block Store Availability and PerformanceUnderstanding Elastic Block Store Availability and Performance
Understanding Elastic Block Store Availability and Performance
 
Tips, Tricks & Best Practices for large scale HDInsight Deployments
Tips, Tricks & Best Practices for large scale HDInsight DeploymentsTips, Tricks & Best Practices for large scale HDInsight Deployments
Tips, Tricks & Best Practices for large scale HDInsight Deployments
 
Sql Server
Sql ServerSql Server
Sql Server
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer Spotlight
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer Spotlight
 

Tips and Tricks for SAP Sybase ASE

  • 1. Tips and Tricks for Optimizing Performance with SAP Sybase ASE Chris Baker Principal System Consultant SAP c.baker@sap.com
  • 2. Disclaimer In this session we will be giving tips and guidelines for ASE to provide novices and experienced DBAs with information they may not know This is by no means exhaustive. We strongly suggest taking advantage of the education course offerings available to enhance your in-depth knowledge of ASE 2 – October 25, 2012
  • 3. Agenda • Planning • Configuration • Running/Monitoring • Troubleshooting 3 – October 25, 2012
  • 5. Planning 1. Review latest platform Release Bulletins, Installation and Configuration Guides  http://infocenter.sybase.com/help/topic/com.sybase.infocenter.help. ase.15.7.2/title.htm 2. Ensure for production servers that memory and CPU map 1:1 to physical hardware.  Avoid swapping at all costs  Do not overallocate CPU’s  1 physical core = 1 engine (pre 15.7)  1 physical core = 1 thread (syb_default_pool)  Be aware of SAN and storage configuration 5 – October 25, 2012
  • 6. Planning 3. Make sure O/S configuration settings are sufficient  RH Linux  ulimits - /etc/security/limits.conf  shared memory - /etc/sysctl.conf  /proc/sys/fs/aio_max_nr – might need increasing  noop scheduler  etc. 4. O/S patches and drivers are up-to-date  Might require firmware updates 6 – October 25, 2012
  • 7. Planning 5. Separate Log, Tempdb and Data devices  Spreads the I/O load  Separate Log ensures proper database recovery from database and transaction log dumps 6. Target R/W speeds should be 5ms per I/O or better 7. Use Concurrent/Direct I/O for file systems  Turn off journaling  Buffered I/O OK for tempdbs 7 – October 25, 2012
  • 9. Configuration 1. Use the Threaded Kernel  sp_configure ‘kernel mode’, ‘threaded’ 2. Use 4K server page sizes or better  Performance with modern storage systems 3. Use UTF-8 character set 4. Separate Data, Log and Tempdb Caches  Log caches should always have cache partitions = 1 5. Create Multiple Tempdbs  Dedicate a tempdb to ‘sa’ 6. Enable Statement Cache and literal autoparam  sp_configure ‘statement cache size’  sp_configure ‘number of open objects’ 9 – October 25, 2012
  • 10. Configuration 7. Number of worker processes  Provide a pool for parallel index operations, partitions and ‘dbcc checkstorage’ 8. Configure Job Scheduler for maintenance jobs  Update Index Statistics 9. Create Index Performance  number of sort buffers = 5000 10. Set max possible CPU utilization  max online engines = <number of cores> 10 – October 25, 2012
  • 11. Configuration 11. Network  max network packet size = 16384  additional network memory = 10485760 12. Reduce Tempdb I/O  direct i/o off, dsync off (filesystem)  max buffers per lava operator = 20480  session tempdb log cache size = 32768 13. Add an ‘sa’-only listener  Additional ‘master’ entry in server interfaces file 11 – October 25, 2012
  • 13. Running/Monitoring 1. Use Optimization Goals and Login Triggers  set plan optgoal allrows_mix | allrows_oltp | allrows_dss 2. Set optimizer level = ase_current  Otherwise no benefit from patches 3. Run ‘Update Index Statistics’ regularly  Leave steps at 20-40  Histogram tuning factor = 20  Job Scheduler (datachange) 4. Change ‘enable housekeeper GC’ from default  4 - for batches  5 - for OLTP 13 – October 25, 2012
  • 14. Running/Monitoring 5. Check statistics regularly  systabstats/sysstatistics  sp_statistics  capture missing statistics 6. Manage ASE lock granularity  Don’t overuse DRL 7. Monitoring  Turn on MDA monitoring  Configure and use Sybase Control Center 14 – October 25, 2012
  • 15. Optimization Goals • fastfirstrow  optimizes queries so that Adaptive Server returns the first few rows as quickly as possible. • allrows_oltp  optimizes queries so that Adaptive Server uses a limited number of optimization criteria (described in “Optimization criteria”) to find a good query plan. allrows_oltp is most useful for purely OLTP queries. • allrows_mixed  optimizes queries so that Adaptive Server uses most available optimization techniques, including merge_join and parallel, to find the best query plan. allrows_mixed, which is the default strategy, is most useful in a mixed-query environment. • allrows_dss  optimizes queries so that Adaptive Server uses all available optimization techniques to find the best query plan, including hash join, advanced aggregates processing, and bushy tree plan. allrows_dss is most useful in a DSS environment. 15 – October 25, 2012
  • 16. Housekeeper • The housekeeper performs 3 main functions  Wash  Runs only during idle times  Can help reduce buffer washing during transaction processing  Managed using ‘housekeeper free write percent’ (default = 1) i.e. only increase disk i/o by 1% above current  Chores  Only runs at idle times. Performs tasks such as: – Flushing table statistics – Flushing account statistics – Handling timeout of detached transactions – Checking licence usage  Garbage Collection  Controlled by ‘enable housekeeper GC’  defaults to lazy collection of forwarded and deleted rows (1) – tables will require more maintenance (rebuild/reorg) to recover space for reuse  Set to 4 for batch processing – aggressive collection of forwarded rows and deleted space  Set to 5 for OLTP processing – aggressive collection of forwared rows and lazy collection of deleted space 16 – October 25, 2012
  • 17. Sybase Control Center 17 – October 25, 2012
  • 19. Troubleshooting 1. Run sp_sysmon to get a general look at server performance  sp_sysmon “00:10:00” 2. MDA is your friend  Narrow down to the query in question  Examine waits, device io performance, cache usage, etc. 3. Isolate and examine the query using set options 4. Use QP Metrics/QP Tune  enable metrics capture 5. Application Tracing  connect to a spid and capture show output 19 – October 25, 2012
  • 20. A MDA Starter Config Always on: As needed (dynamically): Only when truly desperate: • Must have’s: • enable stmt cache • Use sysquerymetrics? • enable monitoring = 1 monitoring = 1 • …Or enable the text pipe • wait event timing = 1 • statement pipe active = 1 • Gets everything - not just • process wait events = 1 • statement pipe max bad queries • object lockwait timing = 1 messages = 25000 • sql text pipe active = 1 • SQL batch capture = 1 • sql text pipe max • statement statistics active messages = 1000 =1 • Use app • per object statistics active tracing/sp_showplan =1 instead? (or plan pipe) • max SQL text monitored = • plan text pipe active = 1 2048 • plan text pipe max • Nice to have’s: messages = 1000 • errorlog pipe active = 1 • errorlog pipe max messages = 1000 • deadlock pipe active = 1 • deadlock pipe max messages = 100 20 – October 25, 2012
  • 21. Some MDA Tables Problem MDA Tables Currently Running Queries monProcessStatement, monProcessObject Finding Tempdb Hogs monProcessObject Previously Executed Queries/Proc Issues monSysStatement Proc Cache Optimization Hogs monSysStatement, monProcessStatement What is ASE waiting for? monSysWaits Find currently open objects monOpenObjectActivity SQL and Plan Text monSysSQLText, monSysPlanText 21 – October 25, 2012
  • 22. Set option show…. • set option show <normal/brief/long/on/off>  Basic syntax common to all  Execute this one first prior to any of the below when used together (other wise it will reset the below to the level of detail for show command itself) • … show_lop <…> Shows logical operators used. • … show_managers <…> Shows data structure managers used. • … show_log_props <…> Shows the logical managers used. • … show_parallel <…> Shows parallel query optimization. • … show_histograms <…> Shows the histograms processed. • … show_abstract_plan <…> Shows the details of an abstract plan. • … show_search_engine <…> Shows the details of a search engine. • … show_counters <…> Shows the optimization counters. • … show_best_plan <…> Shows the details of the best QP plan. • … show_code_gen <…> Shows the details of code generation. • … show_pio_costing <…> Shows estimates of physical I/O • … show_lio_costing <…> Shows estimates of logical input/output. • … show_elimination <…> Shows partition elimination. • … show_missing_stats <…> Shows columns with missing stats. 22 – October 25, 2012
  • 23. 23 – October 25, 2012
  • 24. Useful links • SAP ASE Developer Center  http://scn.sap.com/community/developer-center/oltp-db • SAP Sybase Education Curriculum  https://training.sap.com/us/en/courses-and-curricula/sybase • Sybooks ASE 15.7 Documentation  http://infocenter.sybase.com/help/topic/com.sybase.infocenter.help. ase.15.7.2/title.htm • SAP Notes specific to running SAP on ASE  https://service.sap.com/sap/support/notes/1680803  https://service.sap.com/sap/support/notes/1722359  https://service.sap.com/sap/support/notes/1539125 24 – October 25, 2012