SlideShare ist ein Scribd-Unternehmen logo
1 von 29
SQL Tuning
Introduce the SQL tuning tool, SQLBooster, and SQL tuning technology
Why choose SQLBooster
 No deep DBA knowledge required
 Developer can do most tuning jobs without DBA assistant
 Visualized performance data
 Quick identify performance bottleneck
 Break complex queries to simple ones to be tuned
 Analysing result can be exported for DBA to do further review
Preparation
Download
 Download the latest version SQLBooster from http://www.sqlfast.com
 Download Oracle Instant Client from
http://www.oracle.com/technetwork/database/features/instant-client/index.
html
Install & configure Oracle Instant Client
 Set environment parameter ORACLE_HOME as Oracle Instant Client folder
e.g. ORACLE_HOME=C:oracleinstantclient_12_x64
 Create tnsfile NetworkAdmintnsnames.ora under ORACLE_HOME
Tips: please send a request to dba team to get the latest tnsnames file.
Install SQLBooster
 Run setup.exe to install the software
 Get a trial license when first run it (We will get the full license later)
Click “Get Trial Lic” Save a private key file Submit registration info & get license key in your email box
Note: Ensure you ticked “Trial Key” to get a free key
Check your spam folder if you did not see the key
Input the license key to register the software
Configure SQLBooster
 “File”=>”Preference”
 Recommended Settings
 Exceed Analysing Time 60 seconds (Ticked)
 Exceptions: ORA-00600,ORA-07445,ORA-01003
 Retries After Aborted: 0
 Untick “Quick Analyze”
 OCI Lib Path: <Your Oracle Instant Client Path>
 Session Pre-Execute SQL: Recommended for VPD only
 Associated Extensions: tick *.stw, *.anz
VPD Setting
 Create a SQL file, input the portal context command
Example:
Begin vpd.set_context(portal_id => 123); end;
/
 Go to File => Preference, set this file in “Session Pre-Execute SQL”
Tips: Your can create multiple files for different portals, change the file path before
you login the target portal
Authorization
 The software requires two user accounts when login
 App user: For running the SQL to be tuned. You can also use to do the necessary
queries
 DBA User: For running the background command. You cannot use it directly.
 Authorization Control: Sent below form to DBA team to get the authorization
Product Name: e.g. Payroll
Environment: e.g. Integration QA
App User Name: e.g. payrollappuser
Attach the existing authorization file:
C:Users<UserName>AppDataLocalSQLBoosterSQLBoosterA.dat
You will receive a same name file from DBA team to replace your existing file
Login
 Click “New” button, or Click “File” => “New”
 Choose the connection from the list
 Do not change anything
 Make sure PVD script is selected correctly if you login a PVD environment
SQL Tuning
Run Your SQL
 Input your SQL in the SQL Editor, Click “Run” button (or F3)
 A popup window for inputting default value for the missed bind variables
 Input a default value for all bind variables, or
 Click “Cancel”, input different values for the variables
Review the Performance Data
 Performance Statistics Data of last SQL running will be shown at the bottom
Review Execution Plan
 Execution plan will be shown on the right side after SQL finished
 The high-cost operations will be highlighted
 For large plan, you can click “Spot” button the locate the high-cost
operations quickly
Tuning Tips
 At this stage, you will able to do initial tuning based on these informations
 Check your SQL part that is related to the high-cost operations
For example, if the high-cost operation is a Full Table Scan, and there is a Filter
Predicate on it, you may consider to create an index on these filter columns.
Tips: Move the mouse to the operation, it will show the predicates if there is a *
or/and # shown in this operation. This will help your to locate your code
 The performance statistics data is important metric to determine if your changes
helped to improve the performance.
Tips: Some important statistics data: consistent gets, physical reads, sorts (memory)
Further Analyse Your SQL
 Analysing SQL will analyse the SQL structure first, then generate a SQL tree
 It will analyse the SQL from the bottom to the top, analyse each subquery in
your SQL
 For those complex SQLs, further analysing will help you to identify the
bottleneck quickly
 You don’t have to tune a large complex SQL, you only need to tune the
spotted small subquery instead
Parse the SQL Structure
 Click “SQL Tree”. Your SQL will be parsed as a SQL tree
 You can view the subqueries by clicking any subquery/sub_query node in
the tree. The constructed subquery will be shown in the SQL editor on the
right side
Analyse SQL
 Click “Analyse” button to analyse the pared SQL
 Every subquery will be analyzed
 Single subquery analysing process will be aborted once analysing time
more than 60 seconds (set in the “Preference”)
 Analyse result will be show on the bottom
 Subqueries with poor performance are highlighted
 Review & Tune the highlighted subqueries from top to bottom
Review & Tune the poor performance
subquery
 Click the highlighted analysed result to show the SQL text in the SQL Editor
 Double click the highlighted result to show the plan and performance data
Tuning with SQL Profile
 Tune SQL quickly, do not require to bounce applications
 Fit for the SQLs not easy to be restructured. E.g. the dynamic SQL
constructed in the Java Applications; the BI SQL constructed by OBIEE.
 Easy and quick to rollback the change(s)
Apply SQL profile generated by a
hinted SQL
 Add SQL hints in the original SQL to tune it. E.g. index, leading, use_nl. Run it
 Click “Plan Outline” tab under the plan tree
 Click “Edit” to pop up the outline data
 Select the SQL ID of the original SQL from the dropdown list
 Click “Apply”
Advanced Usage
Identify a long-running SQL
 Click “Sess” button or F5
 Tick “Running SQL Only”
 Click the column “SQL Running Time” to sort the result by running time
 Select a (your) long running SQL
 Click “Drill in SQL” to review the performance and tune it
Identify a top SQL
 Click “Top SQL” button or F6
 Choose a top type (Waits, CPU, IO, PGA or Temp Space)
 Select a (your) top SQL to check the SQL text
 Click “Drill in SQL” to review the performance and tune it
Identify the blocking&blocked sessions
 Click “Block Tree” button, or F7
 Review the session information
 Click “Refresh” to check if the lock still exists
 Select a session, click “Session History” to review the session activities
 Do not click “Kill Session”, though the privilege has been revoked from the
dba account
SQL Advisor (Not recommend to use)
 Click “Advisor” button
 Input the SQL text to be advised in the editor
 Click “Advise” button to run an advisor task
 Select a task to review the report
Seeking Assistant from DBA Team
 Click “Export” to export your analyse result, or
 Click “File”=>”Save Work” to save everything in a file
 Send the exported or saved file to DBA team, including below information
Product Name: e.g. Payroll
Environment: e.g. Integration QA
App User Name: e.g. payrollappuser
VPD Portal ID (If applicable): e.g. 123456
Customized Reports
 DBA Team has prepared some customized reports. Copy them to
CustomReprots folder under the installation locationg
 Click “…” button
 Choose a report name from the dropdown list
For example, if you want to check the index and indexed columns of a table,
choose “TableIndex” report, input the table name as the value of the
variable, all indexes and their columns will be listed
Q & A

Weitere ähnliche Inhalte

Was ist angesagt?

R12 d49656 gc10-apps dba 19
R12 d49656 gc10-apps dba 19R12 d49656 gc10-apps dba 19
R12 d49656 gc10-apps dba 19zeesniper
 
Oracle DB Performance Tuning Tips
Oracle DB Performance Tuning TipsOracle DB Performance Tuning Tips
Oracle DB Performance Tuning TipsAsanka Dilruk
 
Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development Ahmed Farag
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 
93016175 ax2012-enus-rep-02
93016175 ax2012-enus-rep-0293016175 ax2012-enus-rep-02
93016175 ax2012-enus-rep-02Ahmed Farag
 
SQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database ProjectsSQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database Projectsfloydhilton
 
Less18 Patching oracle dba 11g
Less18 Patching oracle dba 11gLess18 Patching oracle dba 11g
Less18 Patching oracle dba 11gvivaankumar
 
OBIEE11g Multi User Development - MUD
OBIEE11g  Multi User Development - MUDOBIEE11g  Multi User Development - MUD
OBIEE11g Multi User Development - MUDadivasoft
 
patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack David McNish
 
Less13 3 e_loadmodule_3
Less13 3 e_loadmodule_3Less13 3 e_loadmodule_3
Less13 3 e_loadmodule_3Suresh Mishra
 
Less09 2 e_testermodule_8
Less09 2 e_testermodule_8Less09 2 e_testermodule_8
Less09 2 e_testermodule_8Suresh Mishra
 
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1Jade Global
 
Actor Model Import Connector for Microsoft Active Directory
Actor Model Import Connector for Microsoft Active DirectoryActor Model Import Connector for Microsoft Active Directory
Actor Model Import Connector for Microsoft Active Directoryprotect724rkeer
 
Microsoft Dynamics CRM 2013 development server installation
Microsoft Dynamics CRM 2013 development server installationMicrosoft Dynamics CRM 2013 development server installation
Microsoft Dynamics CRM 2013 development server installationJukka Niiranen
 

Was ist angesagt? (20)

R12 d49656 gc10-apps dba 19
R12 d49656 gc10-apps dba 19R12 d49656 gc10-apps dba 19
R12 d49656 gc10-apps dba 19
 
Oracle DB Performance Tuning Tips
Oracle DB Performance Tuning TipsOracle DB Performance Tuning Tips
Oracle DB Performance Tuning Tips
 
6232 b 04
6232 b 046232 b 04
6232 b 04
 
Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
93016175 ax2012-enus-rep-02
93016175 ax2012-enus-rep-0293016175 ax2012-enus-rep-02
93016175 ax2012-enus-rep-02
 
SQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database ProjectsSQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database Projects
 
Less18 Patching oracle dba 11g
Less18 Patching oracle dba 11gLess18 Patching oracle dba 11g
Less18 Patching oracle dba 11g
 
Dba101
Dba101Dba101
Dba101
 
Less11 Security
Less11 SecurityLess11 Security
Less11 Security
 
OBIEE11g Multi User Development - MUD
OBIEE11g  Multi User Development - MUDOBIEE11g  Multi User Development - MUD
OBIEE11g Multi User Development - MUD
 
patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack
 
Sql database audit
Sql database auditSql database audit
Sql database audit
 
Less13 3 e_loadmodule_3
Less13 3 e_loadmodule_3Less13 3 e_loadmodule_3
Less13 3 e_loadmodule_3
 
Less09 2 e_testermodule_8
Less09 2 e_testermodule_8Less09 2 e_testermodule_8
Less09 2 e_testermodule_8
 
SQL server part 1
SQL server  part 1SQL server  part 1
SQL server part 1
 
dbadapters
dbadaptersdbadapters
dbadapters
 
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
 
Actor Model Import Connector for Microsoft Active Directory
Actor Model Import Connector for Microsoft Active DirectoryActor Model Import Connector for Microsoft Active Directory
Actor Model Import Connector for Microsoft Active Directory
 
Microsoft Dynamics CRM 2013 development server installation
Microsoft Dynamics CRM 2013 development server installationMicrosoft Dynamics CRM 2013 development server installation
Microsoft Dynamics CRM 2013 development server installation
 

Ähnlich wie Sql tuning

resource governor
resource governorresource governor
resource governorAaron Shilo
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availabilityPeter Gfader
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statementsSteve Xu
 
SQL Server and System Center Advisor
SQL Server and System Center AdvisorSQL Server and System Center Advisor
SQL Server and System Center AdvisorEduardo Castro
 
Understanding performance bottlenecks using performance dashboard
Understanding performance bottlenecks using performance dashboardUnderstanding performance bottlenecks using performance dashboard
Understanding performance bottlenecks using performance dashboardAmit Banerjee
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005rainynovember12
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...Joel Oleson
 
Remote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan► Supreme Mandal ◄
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 EditionMark Broadbent
 
DBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docxDBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docxseifusisay06
 
Microsoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure WhitepaperMicrosoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure WhitepaperMicrosoft Private Cloud
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBUniFabric
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersTobias Koprowski
 
Modernizing SQL Server the Right Way
Modernizing SQL Server the Right WayModernizing SQL Server the Right Way
Modernizing SQL Server the Right WayJuan Fabian
 

Ähnlich wie Sql tuning (20)

Sql saturday oc 2019
Sql saturday oc 2019Sql saturday oc 2019
Sql saturday oc 2019
 
resource governor
resource governorresource governor
resource governor
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statements
 
SQL Server and System Center Advisor
SQL Server and System Center AdvisorSQL Server and System Center Advisor
SQL Server and System Center Advisor
 
Understanding performance bottlenecks using performance dashboard
Understanding performance bottlenecks using performance dashboardUnderstanding performance bottlenecks using performance dashboard
Understanding performance bottlenecks using performance dashboard
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
 
Remote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts 11g Features
Remote DBA Experts 11g Features
 
Sherlock holmes for dba’s
Sherlock holmes for dba’sSherlock holmes for dba’s
Sherlock holmes for dba’s
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
 
SSDT unleashed
SSDT unleashedSSDT unleashed
SSDT unleashed
 
Intro to Application Express
Intro to Application ExpressIntro to Application Express
Intro to Application Express
 
DBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docxDBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docx
 
Microsoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure WhitepaperMicrosoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DB
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
 
DBAdapters
DBAdaptersDBAdapters
DBAdapters
 
Modernizing SQL Server the Right Way
Modernizing SQL Server the Right WayModernizing SQL Server the Right Way
Modernizing SQL Server the Right Way
 

Kürzlich hochgeladen

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Kürzlich hochgeladen (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Sql tuning

  • 1. SQL Tuning Introduce the SQL tuning tool, SQLBooster, and SQL tuning technology
  • 2. Why choose SQLBooster  No deep DBA knowledge required  Developer can do most tuning jobs without DBA assistant  Visualized performance data  Quick identify performance bottleneck  Break complex queries to simple ones to be tuned  Analysing result can be exported for DBA to do further review
  • 4. Download  Download the latest version SQLBooster from http://www.sqlfast.com  Download Oracle Instant Client from http://www.oracle.com/technetwork/database/features/instant-client/index. html
  • 5. Install & configure Oracle Instant Client  Set environment parameter ORACLE_HOME as Oracle Instant Client folder e.g. ORACLE_HOME=C:oracleinstantclient_12_x64  Create tnsfile NetworkAdmintnsnames.ora under ORACLE_HOME Tips: please send a request to dba team to get the latest tnsnames file.
  • 6. Install SQLBooster  Run setup.exe to install the software  Get a trial license when first run it (We will get the full license later) Click “Get Trial Lic” Save a private key file Submit registration info & get license key in your email box Note: Ensure you ticked “Trial Key” to get a free key Check your spam folder if you did not see the key Input the license key to register the software
  • 7. Configure SQLBooster  “File”=>”Preference”  Recommended Settings  Exceed Analysing Time 60 seconds (Ticked)  Exceptions: ORA-00600,ORA-07445,ORA-01003  Retries After Aborted: 0  Untick “Quick Analyze”  OCI Lib Path: <Your Oracle Instant Client Path>  Session Pre-Execute SQL: Recommended for VPD only  Associated Extensions: tick *.stw, *.anz
  • 8. VPD Setting  Create a SQL file, input the portal context command Example: Begin vpd.set_context(portal_id => 123); end; /  Go to File => Preference, set this file in “Session Pre-Execute SQL” Tips: Your can create multiple files for different portals, change the file path before you login the target portal
  • 9. Authorization  The software requires two user accounts when login  App user: For running the SQL to be tuned. You can also use to do the necessary queries  DBA User: For running the background command. You cannot use it directly.  Authorization Control: Sent below form to DBA team to get the authorization Product Name: e.g. Payroll Environment: e.g. Integration QA App User Name: e.g. payrollappuser Attach the existing authorization file: C:Users<UserName>AppDataLocalSQLBoosterSQLBoosterA.dat You will receive a same name file from DBA team to replace your existing file
  • 10. Login  Click “New” button, or Click “File” => “New”  Choose the connection from the list  Do not change anything  Make sure PVD script is selected correctly if you login a PVD environment
  • 12. Run Your SQL  Input your SQL in the SQL Editor, Click “Run” button (or F3)  A popup window for inputting default value for the missed bind variables  Input a default value for all bind variables, or  Click “Cancel”, input different values for the variables
  • 13. Review the Performance Data  Performance Statistics Data of last SQL running will be shown at the bottom
  • 14. Review Execution Plan  Execution plan will be shown on the right side after SQL finished  The high-cost operations will be highlighted  For large plan, you can click “Spot” button the locate the high-cost operations quickly
  • 15. Tuning Tips  At this stage, you will able to do initial tuning based on these informations  Check your SQL part that is related to the high-cost operations For example, if the high-cost operation is a Full Table Scan, and there is a Filter Predicate on it, you may consider to create an index on these filter columns. Tips: Move the mouse to the operation, it will show the predicates if there is a * or/and # shown in this operation. This will help your to locate your code  The performance statistics data is important metric to determine if your changes helped to improve the performance. Tips: Some important statistics data: consistent gets, physical reads, sorts (memory)
  • 16. Further Analyse Your SQL  Analysing SQL will analyse the SQL structure first, then generate a SQL tree  It will analyse the SQL from the bottom to the top, analyse each subquery in your SQL  For those complex SQLs, further analysing will help you to identify the bottleneck quickly  You don’t have to tune a large complex SQL, you only need to tune the spotted small subquery instead
  • 17. Parse the SQL Structure  Click “SQL Tree”. Your SQL will be parsed as a SQL tree  You can view the subqueries by clicking any subquery/sub_query node in the tree. The constructed subquery will be shown in the SQL editor on the right side
  • 18. Analyse SQL  Click “Analyse” button to analyse the pared SQL  Every subquery will be analyzed  Single subquery analysing process will be aborted once analysing time more than 60 seconds (set in the “Preference”)  Analyse result will be show on the bottom  Subqueries with poor performance are highlighted  Review & Tune the highlighted subqueries from top to bottom
  • 19. Review & Tune the poor performance subquery  Click the highlighted analysed result to show the SQL text in the SQL Editor  Double click the highlighted result to show the plan and performance data
  • 20. Tuning with SQL Profile  Tune SQL quickly, do not require to bounce applications  Fit for the SQLs not easy to be restructured. E.g. the dynamic SQL constructed in the Java Applications; the BI SQL constructed by OBIEE.  Easy and quick to rollback the change(s)
  • 21. Apply SQL profile generated by a hinted SQL  Add SQL hints in the original SQL to tune it. E.g. index, leading, use_nl. Run it  Click “Plan Outline” tab under the plan tree  Click “Edit” to pop up the outline data  Select the SQL ID of the original SQL from the dropdown list  Click “Apply”
  • 23. Identify a long-running SQL  Click “Sess” button or F5  Tick “Running SQL Only”  Click the column “SQL Running Time” to sort the result by running time  Select a (your) long running SQL  Click “Drill in SQL” to review the performance and tune it
  • 24. Identify a top SQL  Click “Top SQL” button or F6  Choose a top type (Waits, CPU, IO, PGA or Temp Space)  Select a (your) top SQL to check the SQL text  Click “Drill in SQL” to review the performance and tune it
  • 25. Identify the blocking&blocked sessions  Click “Block Tree” button, or F7  Review the session information  Click “Refresh” to check if the lock still exists  Select a session, click “Session History” to review the session activities  Do not click “Kill Session”, though the privilege has been revoked from the dba account
  • 26. SQL Advisor (Not recommend to use)  Click “Advisor” button  Input the SQL text to be advised in the editor  Click “Advise” button to run an advisor task  Select a task to review the report
  • 27. Seeking Assistant from DBA Team  Click “Export” to export your analyse result, or  Click “File”=>”Save Work” to save everything in a file  Send the exported or saved file to DBA team, including below information Product Name: e.g. Payroll Environment: e.g. Integration QA App User Name: e.g. payrollappuser VPD Portal ID (If applicable): e.g. 123456
  • 28. Customized Reports  DBA Team has prepared some customized reports. Copy them to CustomReprots folder under the installation locationg  Click “…” button  Choose a report name from the dropdown list For example, if you want to check the index and indexed columns of a table, choose “TableIndex” report, input the table name as the value of the variable, all indexes and their columns will be listed
  • 29. Q & A