SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
SAA(Sql Access Advisor)
1. :
1. SAA ;
2. EM SAA ;
3. DMBS_ADVISOR ;
2. SAA :
1. , ;
2. Bitmap , B-Tree ;
3. , ;
3. SAA :
1. SQL :
1. SQL Cache: v$sql sql ;
2. User-defined: , sql sql , SAA;
3. STS: Sql Tuning Set, ;
2.
1. Simultaneously considers index solutions, materialized view solutions, or
combinations of both;
2. Considers storage for creation and maintenance costs;
3. Does not generate drop recommendations for partial workloads;
4. Optimizes materialized views for maximum query rewrite usage and fast refresh;
5. Recommends materialized view logs for fast refresh;
6. Combines similar indexes into a single index;
7. Generates recommendations that support multiple workload queries;
3. ;
4. :Comprehensive Limited;
1. Add new index on table or materialized view;
2. Drop an unused index;
3. Modify an existing index by changing the index type;
4. Modify an existing index by adding columns at the end;
5. Add a new materialized view;
6. Drop an unused materialized view;
7. Add a new materialized view log;
8. Modify an existing materialized view log to add new columns or clauses;
9. Comprehensive 1-8 ;
10. Limited 1,4,5,7,8 ;
4. SAA :
1. ADVISOR ;
2. SELECT , ;
5. SAA :
1. ;
2. EM ;
3. DMBS_ADVISOR ;
6. DMBS_ADVISOR :
1. :
1. , ;
2. ;
3. ;
4. ;
2. SAA ;
3. :DBMS_ADVISOR.CREATE_TASK(DBMS_ADVISOR.SQLACCESS_ADVISOR, :task_id,
:task_name);
4. SAA :
1. :DBMS_ADVISOR.SET_TASK_PARAMETER(:task_name, parameter, value);
2. :DBMS_ADVISOR.SET_SQLWKLD_PARAMETER(:workload_name, parameter,
value);
5. :DBMS_ADVISOR.CREATE_TASK(DBMS_ADVISOR.SQLACCESS_ADVISOR, :task_id,
:task_name, template=>:template_name, is_template=>'TRUE');
6. :DBMS_ADVISOR.CREATE_SQLWKLD(:workload_name);
1. SQL Tuning Sets:DBMS_ADVISOR.IMPORT_SQLWKLD_STS();
2. :DBMS_ADVISOR.IMPORT_SQLWKLD_USER();
3. SQL Cache:DBMS_ADVISOR.IMPORT_SQLWKLD_SQLCACHE();
4. SQL :DBMS_ADVISOR.ADD_SQLWKLD_STATEMENT();
5. SQL :DBMS_ADVISOR.IMPORT_SQLWKLD_SCHEMA();
7. :DBMS_ADVISOR.DELETE_SQLWKLD(:workload_name);
8. :DBMS_ADVISOR.ADD_SQLWKLD_REF(:task_name, :workload_name);
9. SAA :DBMS_ADVISOR.EXECUTE_TASK(:task_name);
1. :dba/user_advisor_recommendations;
2. dbms_advisor.get_task_script ;
10. SAA :
1. / ;
2. / ;
3. / ;
4. ;
11. SQL :
1. DIRECTORY;
2. ;
3. ;
7. SQL , , DBMS_ADVISOR.QUICK_TUNE() ;
8. :
1. DBMS_MVIEW.EXPLAIN_MVIEW: / ;
2. DBMS_MVIEW.EXPLAIN_REWRITE: , , ;
3. DBMS_ADVISOR.TUNE_MVIEW: ;
-------------------------------- SAA --------------------------------
-- 1. ;
CONNECT / AS SYSDBA;
ALTER USER sh IDENTIFIED BY oracle ACCOUNT UNLOCK;
GRANT DBA TO sh;
ALTER SYSTEM FLUSH shared_pool;
ALTER SYSTEM FLUSH buffer_cache;
CONNECT sh/oracle;
SET autotrace traceonly stat;
SELECT c.cust_last_name, SUM(s.amount_sold) AS dollars, SUM(s.quantity_sold) AS quantity
FROM sales s, customers c, products p
WHERE c.cust_id = s.cust_id AND
s.prod_id = p.prod_id AND
c.cust_state_province IN ('Dublin', 'Galway')
GROUP BY c.cust_last_name;
SELECT c.cust_id, SUM(amount_sold) AS dollar_sales
FROM sales s, customers c
WHERE s.cust_id = c.cust_id
GROUP BY c.cust_id;
SELECT SUM(unit_cost) FROM costs GROUP BY prod_id;
SELECT * FROM customers WHERE cust_postal_code = '83786';
-- 2. EM SAA ;
1.Databaes Instance->Advisor Central->SQL Access Advisor;
2. SQL : SQL ;
3. : , ;
4. , ;
5. ;
6. ;
-- 3. DBMS_ADVISOR ;
1. ;
VARIABLE v_task_id NUMBER;
VARIABLE v_task_name VARCHAR2(255);
VARIABLE v_wkld_name VARCHAR2(255);
2. ;
EXECUTE :v_task_name := 'my_task';
EXECUTE :v_wkld_name := 'my_sql_wkld';
3. ;
BEGIN
dbms_advisor.delete_sqlwkld_ref(:v_task_name, :v_wkld_name);
dbms_advisor.delete_sqlwkld(:v_wkld_name);
dbms_advisor.delete_task(:v_task_name);
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
/
4. ;
EXECUTE DBMS_ADVISOR.CREATE_TASK(DBMS_ADVISOR.SQLACCESS_ADVISOR, :v_task_id, :v_task_name);
5. ;
SELECT * FROM user_advisor_tasks;
6. , , ;
EXECUTE dbms_advisor.set_task_parameter(:v_task_name, 'EXECUTION_TYPE', 'FULL');
EXECUTE dbms_advisor.set_task_parameter(:v_task_name, 'MODE', 'COMPREHENSIVE');
7. ;
EXECUTE dbms_advisor.create_sqlwkld(:v_wkld_name);
8. ;
EXECUTE dbms_advisor.add_sqlwkld_ref(:v_task_name, :v_wkld_name);
9. ;
SELECT * FROM user_advisor_sqla_wk_map;
10. , SQL Cache ;
VARIABLE v_saved_stmts NUMBER;
VARIABLE v_failed_stmts NUMBER;
EXECUTE DBMS_ADVISOR.IMPORT_SQLWKLD_SQLCACHE(:v_wkld_name, 'APPEND', 2, :v_saved_stmts,
:v_failed_stmts);
11. SQL ;
SELECT * FROM user_advisor_sqlw_stmts;
12. , ;
EXECUTE DBMS_ADVISOR.EXECUTE_TASK(:v_task_name);
13. ;
SELECT * FROM user_advisor_recommendations;
14. ;
:SELECT DBMS_ADVISOR.GET_TASK_SCRIPT(:v_task_name) FROM dual;
, ;
CONNECT / AS SYSDBA;
DROP DIRECTORY ADVISOR_RESULTS;
CREATE OR REPLACE DIRECTORY ADVISOR_RESULTS AS '/home/oracle';
GRANT READ, WRITE ON DIRECTORY ADVISOR_RESULTS TO sh;
CONNECT SH/ORACLE
EXECUTE DBMS_ADVISOR.CREATE_FILE(DBMS_ADVISOR.GET_TASK_SCRIPT(:v_task_name), 'ADVISOR_RESULTS',
'advscript.sql');
-------------------------------- SAA --------------------------------
-------------------------------- SAA --------------------------------
1. ;
CONNECT sh/oracle;
VARIABLE v_task_name VARCHAR2(30);
EXECUTE :v_task_name := 'quick_task';
2. , SQL , ;
EXECUTE dbms_advisor.quick_tune(dbms_advisor.sqlaccess_advisor, :v_task_name, 'SELECT
AVG(amount_sold) FROM sh.sales WHERE promo_id=10');
3. ;
SELECT DBMS_ADVISOR.GET_TASK_SCRIPT(:v_task_name) FROM dual;
-------------------------------- SAA --------------------------------

Contenu connexe

Plus de Zhaoyang Wang

Oracle Compute Cloud Service介绍
Oracle Compute Cloud Service介绍Oracle Compute Cloud Service介绍
Oracle Compute Cloud Service介绍Zhaoyang Wang
 
Oracle cloud 使用云市场快速搭建小型电商网站
Oracle cloud 使用云市场快速搭建小型电商网站Oracle cloud 使用云市场快速搭建小型电商网站
Oracle cloud 使用云市场快速搭建小型电商网站Zhaoyang Wang
 
Oracle cloud ravello介绍及测试账户申请
Oracle cloud ravello介绍及测试账户申请Oracle cloud ravello介绍及测试账户申请
Oracle cloud ravello介绍及测试账户申请Zhaoyang Wang
 
Oracle cloud 云介绍及测试账户申请
Oracle cloud 云介绍及测试账户申请Oracle cloud 云介绍及测试账户申请
Oracle cloud 云介绍及测试账户申请Zhaoyang Wang
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7Zhaoyang Wang
 
MySQL Fulltext Search Tutorial
MySQL Fulltext Search TutorialMySQL Fulltext Search Tutorial
MySQL Fulltext Search TutorialZhaoyang Wang
 
Data Organization in InnoDB
Data Organization in InnoDBData Organization in InnoDB
Data Organization in InnoDBZhaoyang Wang
 
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...Zhaoyang Wang
 
Oracle enterprise manager cloud control 12c r5 agent installation
Oracle enterprise manager cloud control 12c r5 agent installationOracle enterprise manager cloud control 12c r5 agent installation
Oracle enterprise manager cloud control 12c r5 agent installationZhaoyang Wang
 
MYSQLCLONE Introduction
MYSQLCLONE IntroductionMYSQLCLONE Introduction
MYSQLCLONE IntroductionZhaoyang Wang
 
Oracle security 08-oracle network security
Oracle security 08-oracle network securityOracle security 08-oracle network security
Oracle security 08-oracle network securityZhaoyang Wang
 
Oracle security 02-administering user security
Oracle security 02-administering user securityOracle security 02-administering user security
Oracle security 02-administering user securityZhaoyang Wang
 
Interpreting execution plans
Interpreting execution plansInterpreting execution plans
Interpreting execution plansZhaoyang Wang
 
Intorduction to the cbo optimizer
Intorduction to the cbo optimizerIntorduction to the cbo optimizer
Intorduction to the cbo optimizerZhaoyang Wang
 
Installation and configuration 11g r2 asm using job role separation(grid & or...
Installation and configuration 11g r2 asm using job role separation(grid & or...Installation and configuration 11g r2 asm using job role separation(grid & or...
Installation and configuration 11g r2 asm using job role separation(grid & or...Zhaoyang Wang
 
Installation and configuration 11g r2
Installation and configuration 11g r2Installation and configuration 11g r2
Installation and configuration 11g r2Zhaoyang Wang
 

Plus de Zhaoyang Wang (19)

Oracle Compute Cloud Service介绍
Oracle Compute Cloud Service介绍Oracle Compute Cloud Service介绍
Oracle Compute Cloud Service介绍
 
Oracle cloud 使用云市场快速搭建小型电商网站
Oracle cloud 使用云市场快速搭建小型电商网站Oracle cloud 使用云市场快速搭建小型电商网站
Oracle cloud 使用云市场快速搭建小型电商网站
 
Oracle cloud ravello介绍及测试账户申请
Oracle cloud ravello介绍及测试账户申请Oracle cloud ravello介绍及测试账户申请
Oracle cloud ravello介绍及测试账户申请
 
Oracle cloud 云介绍及测试账户申请
Oracle cloud 云介绍及测试账户申请Oracle cloud 云介绍及测试账户申请
Oracle cloud 云介绍及测试账户申请
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
 
MySQL Fulltext Search Tutorial
MySQL Fulltext Search TutorialMySQL Fulltext Search Tutorial
MySQL Fulltext Search Tutorial
 
Data Organization in InnoDB
Data Organization in InnoDBData Organization in InnoDB
Data Organization in InnoDB
 
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
Oracle enterprise manager cloud control 12c release 5 installation on oracle ...
 
Oracle enterprise manager cloud control 12c r5 agent installation
Oracle enterprise manager cloud control 12c r5 agent installationOracle enterprise manager cloud control 12c r5 agent installation
Oracle enterprise manager cloud control 12c r5 agent installation
 
Why use MySQL
Why use MySQLWhy use MySQL
Why use MySQL
 
MYSQLCLONE Introduction
MYSQLCLONE IntroductionMYSQLCLONE Introduction
MYSQLCLONE Introduction
 
Oracle security 08-oracle network security
Oracle security 08-oracle network securityOracle security 08-oracle network security
Oracle security 08-oracle network security
 
Oracle security 02-administering user security
Oracle security 02-administering user securityOracle security 02-administering user security
Oracle security 02-administering user security
 
Interpreting execution plans
Interpreting execution plansInterpreting execution plans
Interpreting execution plans
 
Intorduction to the cbo optimizer
Intorduction to the cbo optimizerIntorduction to the cbo optimizer
Intorduction to the cbo optimizer
 
Optimizer operators
Optimizer operatorsOptimizer operators
Optimizer operators
 
Installation and configuration 11g r2 asm using job role separation(grid & or...
Installation and configuration 11g r2 asm using job role separation(grid & or...Installation and configuration 11g r2 asm using job role separation(grid & or...
Installation and configuration 11g r2 asm using job role separation(grid & or...
 
Installation and configuration 11g r2
Installation and configuration 11g r2Installation and configuration 11g r2
Installation and configuration 11g r2
 
个人介绍
个人介绍个人介绍
个人介绍
 

Dernier

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Performance Tuning Tool04-Sql Access Advisor

  • 1. SAA(Sql Access Advisor) 1. : 1. SAA ; 2. EM SAA ; 3. DMBS_ADVISOR ; 2. SAA : 1. , ; 2. Bitmap , B-Tree ; 3. , ; 3. SAA : 1. SQL : 1. SQL Cache: v$sql sql ; 2. User-defined: , sql sql , SAA; 3. STS: Sql Tuning Set, ; 2. 1. Simultaneously considers index solutions, materialized view solutions, or combinations of both; 2. Considers storage for creation and maintenance costs; 3. Does not generate drop recommendations for partial workloads; 4. Optimizes materialized views for maximum query rewrite usage and fast refresh; 5. Recommends materialized view logs for fast refresh; 6. Combines similar indexes into a single index; 7. Generates recommendations that support multiple workload queries; 3. ; 4. :Comprehensive Limited; 1. Add new index on table or materialized view; 2. Drop an unused index; 3. Modify an existing index by changing the index type; 4. Modify an existing index by adding columns at the end; 5. Add a new materialized view; 6. Drop an unused materialized view; 7. Add a new materialized view log; 8. Modify an existing materialized view log to add new columns or clauses; 9. Comprehensive 1-8 ; 10. Limited 1,4,5,7,8 ; 4. SAA : 1. ADVISOR ; 2. SELECT , ; 5. SAA : 1. ; 2. EM ; 3. DMBS_ADVISOR ; 6. DMBS_ADVISOR : 1. : 1. , ; 2. ; 3. ; 4. ; 2. SAA ; 3. :DBMS_ADVISOR.CREATE_TASK(DBMS_ADVISOR.SQLACCESS_ADVISOR, :task_id, :task_name); 4. SAA : 1. :DBMS_ADVISOR.SET_TASK_PARAMETER(:task_name, parameter, value); 2. :DBMS_ADVISOR.SET_SQLWKLD_PARAMETER(:workload_name, parameter, value); 5. :DBMS_ADVISOR.CREATE_TASK(DBMS_ADVISOR.SQLACCESS_ADVISOR, :task_id, :task_name, template=>:template_name, is_template=>'TRUE'); 6. :DBMS_ADVISOR.CREATE_SQLWKLD(:workload_name); 1. SQL Tuning Sets:DBMS_ADVISOR.IMPORT_SQLWKLD_STS(); 2. :DBMS_ADVISOR.IMPORT_SQLWKLD_USER(); 3. SQL Cache:DBMS_ADVISOR.IMPORT_SQLWKLD_SQLCACHE(); 4. SQL :DBMS_ADVISOR.ADD_SQLWKLD_STATEMENT(); 5. SQL :DBMS_ADVISOR.IMPORT_SQLWKLD_SCHEMA(); 7. :DBMS_ADVISOR.DELETE_SQLWKLD(:workload_name); 8. :DBMS_ADVISOR.ADD_SQLWKLD_REF(:task_name, :workload_name); 9. SAA :DBMS_ADVISOR.EXECUTE_TASK(:task_name); 1. :dba/user_advisor_recommendations; 2. dbms_advisor.get_task_script ; 10. SAA : 1. / ; 2. / ; 3. / ; 4. ; 11. SQL : 1. DIRECTORY; 2. ; 3. ; 7. SQL , , DBMS_ADVISOR.QUICK_TUNE() ; 8. : 1. DBMS_MVIEW.EXPLAIN_MVIEW: / ; 2. DBMS_MVIEW.EXPLAIN_REWRITE: , , ; 3. DBMS_ADVISOR.TUNE_MVIEW: ; -------------------------------- SAA -------------------------------- -- 1. ; CONNECT / AS SYSDBA; ALTER USER sh IDENTIFIED BY oracle ACCOUNT UNLOCK; GRANT DBA TO sh; ALTER SYSTEM FLUSH shared_pool; ALTER SYSTEM FLUSH buffer_cache; CONNECT sh/oracle; SET autotrace traceonly stat; SELECT c.cust_last_name, SUM(s.amount_sold) AS dollars, SUM(s.quantity_sold) AS quantity FROM sales s, customers c, products p WHERE c.cust_id = s.cust_id AND s.prod_id = p.prod_id AND c.cust_state_province IN ('Dublin', 'Galway') GROUP BY c.cust_last_name; SELECT c.cust_id, SUM(amount_sold) AS dollar_sales FROM sales s, customers c WHERE s.cust_id = c.cust_id GROUP BY c.cust_id; SELECT SUM(unit_cost) FROM costs GROUP BY prod_id; SELECT * FROM customers WHERE cust_postal_code = '83786'; -- 2. EM SAA ; 1.Databaes Instance->Advisor Central->SQL Access Advisor; 2. SQL : SQL ; 3. : , ; 4. , ; 5. ; 6. ; -- 3. DBMS_ADVISOR ; 1. ; VARIABLE v_task_id NUMBER; VARIABLE v_task_name VARCHAR2(255); VARIABLE v_wkld_name VARCHAR2(255); 2. ; EXECUTE :v_task_name := 'my_task'; EXECUTE :v_wkld_name := 'my_sql_wkld'; 3. ; BEGIN dbms_advisor.delete_sqlwkld_ref(:v_task_name, :v_wkld_name); dbms_advisor.delete_sqlwkld(:v_wkld_name); dbms_advisor.delete_task(:v_task_name); EXCEPTION WHEN OTHERS THEN NULL; END; / 4. ; EXECUTE DBMS_ADVISOR.CREATE_TASK(DBMS_ADVISOR.SQLACCESS_ADVISOR, :v_task_id, :v_task_name); 5. ; SELECT * FROM user_advisor_tasks; 6. , , ; EXECUTE dbms_advisor.set_task_parameter(:v_task_name, 'EXECUTION_TYPE', 'FULL'); EXECUTE dbms_advisor.set_task_parameter(:v_task_name, 'MODE', 'COMPREHENSIVE'); 7. ; EXECUTE dbms_advisor.create_sqlwkld(:v_wkld_name); 8. ; EXECUTE dbms_advisor.add_sqlwkld_ref(:v_task_name, :v_wkld_name); 9. ; SELECT * FROM user_advisor_sqla_wk_map; 10. , SQL Cache ; VARIABLE v_saved_stmts NUMBER; VARIABLE v_failed_stmts NUMBER; EXECUTE DBMS_ADVISOR.IMPORT_SQLWKLD_SQLCACHE(:v_wkld_name, 'APPEND', 2, :v_saved_stmts, :v_failed_stmts); 11. SQL ; SELECT * FROM user_advisor_sqlw_stmts; 12. , ; EXECUTE DBMS_ADVISOR.EXECUTE_TASK(:v_task_name); 13. ; SELECT * FROM user_advisor_recommendations; 14. ; :SELECT DBMS_ADVISOR.GET_TASK_SCRIPT(:v_task_name) FROM dual; , ; CONNECT / AS SYSDBA; DROP DIRECTORY ADVISOR_RESULTS; CREATE OR REPLACE DIRECTORY ADVISOR_RESULTS AS '/home/oracle'; GRANT READ, WRITE ON DIRECTORY ADVISOR_RESULTS TO sh; CONNECT SH/ORACLE EXECUTE DBMS_ADVISOR.CREATE_FILE(DBMS_ADVISOR.GET_TASK_SCRIPT(:v_task_name), 'ADVISOR_RESULTS', 'advscript.sql'); -------------------------------- SAA -------------------------------- -------------------------------- SAA -------------------------------- 1. ; CONNECT sh/oracle; VARIABLE v_task_name VARCHAR2(30); EXECUTE :v_task_name := 'quick_task'; 2. , SQL , ; EXECUTE dbms_advisor.quick_tune(dbms_advisor.sqlaccess_advisor, :v_task_name, 'SELECT AVG(amount_sold) FROM sh.sales WHERE promo_id=10'); 3. ; SELECT DBMS_ADVISOR.GET_TASK_SCRIPT(:v_task_name) FROM dual; -------------------------------- SAA --------------------------------