Download presentation
Presentation is loading. Please wait.
Published byFlora Wiggins Modified over 8 years ago
1
13 Copyright © 2004, Oracle. All rights reserved. Optimizing Database Performance
2
13-2 Copyright © 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to: Provide a brief review of the advisors Formulate tuning goals Tune applications Simplify file management using ASM
3
13-3 Copyright © 2004, Oracle. All rights reserved. Advisory Framework Overview ADDM SQL Tuning Advisor SQL Access Advisor Memory Space PGA Advisor SGA Segment Advisor Undo Advisor Buffer Cache Advisor Library Cache Advisor PGA
4
13-4 Copyright © 2004, Oracle. All rights reserved.
5
13-5 Copyright © 2004, Oracle. All rights reserved. Database Control and Advisors
6
13-6 Copyright © 2004, Oracle. All rights reserved. Typical Advisor Tuning Session Create an advisor task Adjust task parameters Accept results? Implement recommendations Yes No Perform analysis
7
13-7 Copyright © 2004, Oracle. All rights reserved. Manually Invoking ADDM
8
13-8 Copyright © 2004, Oracle. All rights reserved. Application Tuning Challenges DBA ADDM SQL Tuning Advisor High-load SQL SQL Workload I can do it for you! How can I tune my high-load SQL?
9
13-9 Copyright © 2004, Oracle. All rights reserved. SQL Tuning Advisor Overview Add Missing Index Run Access Advisor Restructure SQL Plan Tuning (SQL Profile) Automatic Tuning Optimizer SQL Analysis Optimization Mode Access Analysis Optimization Mode Plan Tuning Optimization Mode Statistics Check Optimization Mode Detect Stale/Missing Statistics Comprehensive SQL Tuning SQL Tuning Advisor
10
13-10 Copyright © 2004, Oracle. All rights reserved. SQL Tuning Advisor Options and Recommendations
11
13-11 Copyright © 2004, Oracle. All rights reserved. Using the SQL Tuning Advisor Use the SQL Tuning Advisor to analyze SQL statements and obtain performance recommendations Sources for SQL Tuning Advisor to analyze: –Top SQL: Analyzes the top SQL statements currently active –SQL Tuning Sets: Analyzes a set of SQL statements you provide –Snapshots: Analyzes a snapshot –Baselines: Analyzes a baseline
12
13-12 Copyright © 2004, Oracle. All rights reserved. Using the SQL Tuning Advisor
13
13-13 Copyright © 2004, Oracle. All rights reserved. Using the SQL Access Advisor
14
13-14 Copyright © 2004, Oracle. All rights reserved. Full Notes Page
15
13-15 Copyright © 2004, Oracle. All rights reserved. Using the Memory Advisor
16
13-16 Copyright © 2004, Oracle. All rights reserved. Segment Advisor Overview Determines the list of objects that are good candidates for shrinking Recommendations are based on: –Sampled analysis –Historical information –Future growth trends Accessible from Database Control: –Advisor Central page –Tablespaces page –Schema object pages
17
13-17 Copyright © 2004, Oracle. All rights reserved. Segment Advisor
18
13-18 Copyright © 2004, Oracle. All rights reserved. Growth Trend Report Used by the Segment Advisor Space usage statistics are collected into AWR
19
13-19 Copyright © 2004, Oracle. All rights reserved. Segment Resource Estimation
20
13-20 Copyright © 2004, Oracle. All rights reserved. The Undo Management Page
21
13-21 Copyright © 2004, Oracle. All rights reserved. The Undo Advisor Page
22
13-22 Copyright © 2004, Oracle. All rights reserved. What Is Automatic Storage Management? Portable and high performance cluster file system Manages Oracle database files Data is spread across disks to balance load Integrated mirroring across disks Solves many storage management challenges ASM File System Volume Manager Operating System Application Database
23
13-23 Copyright © 2004, Oracle. All rights reserved. ASM Key Features and Benefits Stripes files, not logical volumes Online disk reconfiguration and dynamic rebalancing Adjustable rebalancing speed Provide redundancy on a file basis ASM only supports Oracle database files Cluster aware Automatically installed
24
13-24 Copyright © 2004, Oracle. All rights reserved. ASM Concepts Database Tablespace Segment Extent Oracle block Data file Physical Block ASM Disk Group ASM Disk ASM File Allocation Unit File System File or Raw Device
25
13-25 Copyright © 2004, Oracle. All rights reserved. ASM General Architecture ASM Instance SID=ant ASM Instance SID=bee ASM Disks ASM Diskgroup TomASM Diskgroup DickASM Diskgroup Harry DB Instance SID= sales DB Instance SID=test DB Instance SID= sales DB Instance SID=test ASMB FG Node2Node1 Group Services tom=ant dick=ant harry=ant Group Services tom=bee dick=bee harry=bee DBW 0 ASMB RBAL ARB 0 ARB A … ARB 0 ARB A … ASMB RBAL
26
13-26 Copyright © 2004, Oracle. All rights reserved.
27
13-27 Copyright © 2004, Oracle. All rights reserved. ASM Instance Creation
28
13-28 Copyright © 2004, Oracle. All rights reserved. ASM Instance Initialization Parameters INSTANCE_TYPE = ASM DB_UNIQUE_NAME = +ASM ASM_POWER_LIMIT = 1 ASM_DISKSTRING = '/dev/rdsk/*s2', '/dev/rdsk/c1*' ASM_DISKGROUPS = dgroupA, dgroupB LARGE_POOL_SIZE = 8MB
29
13-29 Copyright © 2004, Oracle. All rights reserved. Accessing an ASM Instance Disk group Storage system AS SYSDBA AS SYSOPER ASM instance All operationsNondestructive operations
30
13-30 Copyright © 2004, Oracle. All rights reserved. ASM Home Page
31
13-31 Copyright © 2004, Oracle. All rights reserved. ASM Performance Page
32
13-32 Copyright © 2004, Oracle. All rights reserved. ASM Configuration Page
33
13-33 Copyright © 2004, Oracle. All rights reserved. Starting Up an ASM Instance $ sqlplus /nolog SQL> CONNECT / AS sysdba Connected to an idle instance. SQL> STARTUP; ASM instance started Total System Global Area 147936196 bytes Fixed Size 324548 bytes Variable Size 96468992 bytes Database Buffers 50331648 bytes Redo Buffers 811008 bytes ASM diskgroups mounted
34
13-34 Copyright © 2004, Oracle. All rights reserved. Shutting Down an ASM Instance SHUTDOWN NORMAL ASM Instance Database Instance ADatabase Instance B 11 2 3
35
13-35 Copyright © 2004, Oracle. All rights reserved. ASM Disk Groups A pool of disks managed as a logical unit Partitions total disk space into uniform sized units Spreads each file evenly across all disks Uses coarse or fine grain striping based on file type Administer disk groups not files Disk Group ASM Instance
36
13-36 Copyright © 2004, Oracle. All rights reserved. ASM Administration Page
37
13-37 Copyright © 2004, Oracle. All rights reserved. Create Disk Group Page
38
13-38 Copyright © 2004, Oracle. All rights reserved. ASM Files Database File ASM File automatically spread inside Disk Group dgroupA CREATE TABLESPACE sample DATAFILE '+dgroupA'; 1 2 3 4 12 3 4 Automatic ASM file Creation RMAN
39
13-39 Copyright © 2004, Oracle. All rights reserved. ASM Filenames ASM Filename Fully- qualified Incomplete with template NumericAlias Alias with template Incomplete Reference Single-file Creation Multiple-file Creation
40
13-40 Copyright © 2004, Oracle. All rights reserved. ASM File Name Mapping Oracle File Type Def Template Control filescontrolfileCF/BCFCONTROLFILE Data filesdatafile _ DATAFILE Online logsonline_loglog_ ONLINELOG Archive logsarchive_logparameterARCHIVELOG Temp filestemp _ TEMPFILE Data file backup piecesbackupsetClient SpecifiedBACKUPSET Data file incremental backup pieces backupsetClient SpecifiedBACKUPSET Arch log backup piecebackupsetClient SpecifiedBACKUPSET Data file copydatafile _ DATAFILE Initialization parametersinitspfilePARAMETERFILE Broker configurationsdrc DATAGUARDCONFIG Flashback logsrlog _ FLASHBACK Change tracking bitmapsCTBBITMAPCHANGETRACKING Auto backupAutoBackupClient SpecifiedAUTOBACKUP Data Pump dump setDumpsetdumpDUMPSET Cross-platform converted data files XTRANSPORT
41
13-41 Copyright © 2004, Oracle. All rights reserved. SQL Commands and File Naming CREATE CONTROLFILE DATABASE sample RESETLOGS ARCHIVELOG MAXLOGFILES 5 MAXLOGHISTORY 100 MAXDATAFILES 10 MAXINSTANCES 2 LOGFILE GROUP 1 ('+dgroupA','+dgroupB') SIZE 100M, GROUP 2 ('+dgroupA','+dgroupB') SIZE 100M DATAFILE '+dgroupA.261.12345678' SIZE 100M DATAFILE '+dgroupA.262.87654321' SIZE 100M;
42
13-42 Copyright © 2004, Oracle. All rights reserved. DBCA and Storage Options
43
13-43 Copyright © 2004, Oracle. All rights reserved. Migrating Your Database to ASM Storage 1.Shut down your database cleanly 2.Shutdown the database and modify your server parameter file to use Oracle Managed Files (OMF) 3.Edit and execute the following RMAN script: STARTUP NOMOUNT; RESTORE CONTROLFILE FROM '/u1/c1.ctl'; ALTER DATABASE MOUNT; BACKUP AS COPY DATABASE FORMAT '+dgroup1'; SWITCH DATABASE TO COPY; SQL "ALTER DATABASE RENAME '/u1/log1' TO '+dgroup1' "; # Repeat RENAME command for all online redo log members... ALTER DATABASE OPEN RESETLOGS; SQL "ALTER DATABASE TEMPFILE '/u1/temp1' DROP";
44
13-44 Copyright © 2004, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Provide a brief review of the advisors Formulate tuning goals Tune applications Simplify file management using ASM
45
13-45 Copyright © 2004, Oracle. All rights reserved. Practice 13 Overview: Optimizing Database Performance This practice covers the following topics: Proactively tuning your database using ADDM. Using Automatic Shared Memory Management to avoid long running queries issues.
46
13-46 Copyright © 2004, Oracle. All rights reserved.
47
13-47 Copyright © 2004, Oracle. All rights reserved.
48
13-48 Copyright © 2004, Oracle. All rights reserved.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.