SlideShare uma empresa Scribd logo
1 de 24
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta Lake
 
Presto on Apache Spark: A Tale of Two Computation Engines
Presto on Apache Spark: A Tale of Two Computation EnginesPresto on Apache Spark: A Tale of Two Computation Engines
Presto on Apache Spark: A Tale of Two Computation Engines
 
Oracle to Postgres Migration - part 1
Oracle to Postgres Migration - part 1Oracle to Postgres Migration - part 1
Oracle to Postgres Migration - part 1
 
Materialized Column: An Efficient Way to Optimize Queries on Nested Columns
Materialized Column: An Efficient Way to Optimize Queries on Nested ColumnsMaterialized Column: An Efficient Way to Optimize Queries on Nested Columns
Materialized Column: An Efficient Way to Optimize Queries on Nested Columns
 
Apache Tez – Present and Future
Apache Tez – Present and FutureApache Tez – Present and Future
Apache Tez – Present and Future
 
Deep Dive into GPU Support in Apache Spark 3.x
Deep Dive into GPU Support in Apache Spark 3.xDeep Dive into GPU Support in Apache Spark 3.x
Deep Dive into GPU Support in Apache Spark 3.x
 
Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive

Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive


 
MongoDB Sharding
MongoDB ShardingMongoDB Sharding
MongoDB Sharding
 
High throughput data replication over RAFT
High throughput data replication over RAFTHigh throughput data replication over RAFT
High throughput data replication over RAFT
 
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark ApplicationsTop 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
 
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta LakeSimplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
 
One PDB to go, please!
One PDB to go, please!One PDB to go, please!
One PDB to go, please!
 
From AWS Data Pipeline to Airflow - managing data pipelines in Nielsen Market...
From AWS Data Pipeline to Airflow - managing data pipelines in Nielsen Market...From AWS Data Pipeline to Airflow - managing data pipelines in Nielsen Market...
From AWS Data Pipeline to Airflow - managing data pipelines in Nielsen Market...
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
 
Smarter Together - Bringing Relational Algebra, Powered by Apache Calcite, in...
Smarter Together - Bringing Relational Algebra, Powered by Apache Calcite, in...Smarter Together - Bringing Relational Algebra, Powered by Apache Calcite, in...
Smarter Together - Bringing Relational Algebra, Powered by Apache Calcite, in...
 
A Thorough Comparison of Delta Lake, Iceberg and Hudi
A Thorough Comparison of Delta Lake, Iceberg and HudiA Thorough Comparison of Delta Lake, Iceberg and Hudi
A Thorough Comparison of Delta Lake, Iceberg and Hudi
 
Migrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMigrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at Facebook
 
DATADOG TIPS #1
DATADOG TIPS #1DATADOG TIPS #1
DATADOG TIPS #1
 
ORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big DataORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big Data
 

Destaque

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
 

Destaque (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
 

Semelhante a Tips and Tricks for SAP Sybase ASE

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
Luis Guirigay
 

Semelhante a 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