Beruflich Dokumente
Kultur Dokumente
ble
fe r a
ans
n - t r
a no
Oracle Database
h a s 11g:
ฺ New
r ) e
Features
m uid
ฺa forGAdministrators
n ฺ co ent
@ ao Stud
z i l le thVolume
is I • Student Guide
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
Marc
D50081GC21
Edition 2.1
September 2010
D63697
Authors Copyright © 2009, 2010, Oracle and/or it affiliates. All rights reserved.
license, post, transmit, or distribute this document in whole or in part without the
Donna Keesling express authorization of Oracle.
Deidre Matishak
James Spiller The information contained in this document is subject to change without notice. If you
Jenny Tsai find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Jean-Francois Verrier warranted to be error-free.
James Womack
Marcie Young Restricted Rights Notice
n ฺ
Jacco Draaijer
Al Flournoy
@ ao Stud
Steve Fogel
z i l le this
Andy Fortunak
c e loฺ use
Gerlinde Frenzen
a r to
Greg Gagnon m e
GP Gongloor
i l l e ( icens Technical Contributors
oZ
Joel Goodman
e l
Hansen Han
l and Reviewers
arc
Tim Shetler
Uwe Hesse Eric Siglin
M Sunil Hingorani Ranbir Singh
Magnus Isaksson Jeff Skochil
Susan Jang George Spears
Martin Jensen Kesavan Srinivasan
Dominique Jeunot Birgitte Taagholt
Pete Jones Glenn Tripp
Yash Kapani Branislav Valny
Pierre Labrousse Anthony Woodell
Richard.W.Lewis
Hakan Lindfors Editors
Russ Lowenthal
Aju Kumar
Kurt Lysy
Amitha Narayan
Isabelle Marchand
Silvia Marrone
Publishers
Heejin Park
Srinivas Putrevu Sujatha Nagendra
Jagannath Poosarla Michael Sebastian Almeida
Surya Rekha Jobi Varghese
Contents
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
I Introduction
Overview I-2
Oracle Database Innovation I-3
Enterprise Grid Computing I-4
Oracle Database 11g: Focus Areas I-5
Management Automation I-7
Self-Managing Database: The Next Generation I-8 ble
Suggested Additional Courses I-9 fe r a
ans
Further Information I-10
n - t r
Suggested Schedule I-11 o
s an
1 Oracle Grid Infrastructure r ) ha deฺ
Objectives 1-2 m ฺa Gui
Oracle Grid Infrastructure 1-3 n ฺ co ent
Automatic Storage Management Technology
@ ao Stack S tud1-4
z
Oracle Grid Infrastructure and i l le Database
Oracle t h is Installation: System
Requirements 1-5cel
oฺ use
a r System
to 1-6
Preparing the Operating
m e
l l e ( iceVariables
Setting iEnvironment ns 1-7
Z l
lo the System Requirements 1-8
r c eChecking
Ma Defining Ownership of OS Devices for ASM 1-9
Installation Scenario 1-10
Part One: Installing the Oracle Grid Infrastructure for Stand-Alone Server 1-11
Selecting Product Languages 1-12
Creating an ASM Disk Group 1-13
Defining ASM Passwords 1-14
Defining Privileged Operating System Groups 1-15
Specifying Installation Location 1-16
Creating Inventory 1-17
Performing Prerequisite Checks 1-18
Verifying Installation Summary Data 1-19
Monitoring Installation Progress 1-20
Executing root Configuration Scripts 1-21
Executing Configuration Assistants 1-22
Finishing the Installation 1-23
iii
Configuring the FRA Disk Group 1-24
Oracle Local Registry 1-25
Quiz 1-27
Practice 1-1: Overview 1-28
ASM Files and Volumes 1-29
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
e oZ
Quiz 1-51
l l
Marc Summary 1-52
Practice 1-2: Overview 1-53
2 Installation Enhancements
Objectives 2-2
Oracle Database 11g Installation: Changes 2-3
Part Two: Installing the Oracle Database Software 2-6
Choosing the Type of Installation 2-7
Choosing Grid Installation Options 2-8
Choosing Language Settings 2-9
Choosing the Database Edition 2-10
Specifying Installation Location 2-11
Choosing Operating System Groups 2-12
Performing Prerequisite Checks 2-13
Installation Summary Page 2-14
Install Product Page 2-15
iv
Installation Finish Page 2-16
Quiz 2-17
Practice 2-1: Overview 2-18
Oracle Database 11g Release 2 Upgrade Paths 2-19
Deprecated Features in Oracle Database 11g Release 1 and Release 2 2-20
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
4 ASM Enhancements
Objectives 4-2
Without ASM Fast Mirror Resync 4-3
v
ASM Fast Mirror Resync: Overview 4-4
Using Enterprise Manager to Perform Fast Mirror Resync 4-5
Setting Up ASM Fast Mirror Resync 4-7
ASM Preferred Mirror Read: Overview 4-9
ASM Preferred Mirror Read: Setup 4-10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
5 Storage Enhancements
Objectives 5-2
Supporting 4 KB Sector Disks 5-3
vi
Using 4 KB Sector Disks 5-4
Specifying the Disk Sector Size 5-5
Using the SECTOR_SIZE Clause 5-6
Creating a Database with 4 KB Sector Disks 5-7
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
vii
Considerations and Usage Notes 6-12
Quiz 6-13
Review: Degree of Parallelism (DOP) 6-14
Review: PARALLEL Clause 6-16
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
7 Oracle SecureFiles
Objectives 7-2
Managing Enterprise Information 7-3
viii
Issues with Existing LOB Implementation 7-4
Oracle SecureFiles 7-5
Enabling SecureFiles Storage 7-6
SecureFiles: Storage Options 7-7
SecureFiles: Advanced Features 7-8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ix
Managing Fine-Grained Access to External Network Services 8-21
Supporting IPv6 Address Notification 8-23
Connecting to the Oracle Database 8-24
IPv6 Supported in Java Interfaces 8-25
Summary 8-26
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
e oZ l
Using Enterprise Manager to Access SQL Performance Analyzer 9-18
l
Marc SQL Performance Analyzer: PL/SQL Example 9-19
Tuning Regressed SQL Statements 9-21
Testing Database Upgrades: Oracle9i Database and Oracle Database 10g
Release 1 9-22
Testing Database Upgrades: Oracle Database 10g Release 2 and
Later Releases 9-25
SQL Performance Analyzer: Data Dictionary Views 9-28
Summary 9-29
Practice 9: Overview 9-30
x
Viewing Important Baseline SQL Plan Attributes 10-8
Important Baseline SQL Plan Attributes 10-9
SQL Plan Selection 10-10
Quiz 10-12
Possible SQL Plan Manageability Scenarios 10-13
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
xi
Automatic SQL Tuning in Oracle Database 11g 12-4
Summary of Automation in Oracle Database 11g 12-5
Selecting Potential SQL Statements for Tuning 12-6
Maintenance Window Timeline 12-7
Automatic Tuning Process 12-8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
xii
I/O Calibration and Enterprise Manager 13-27
I/O Calibration and the PL/SQL Interface 13-28
I/O Statistics: Overview 13-30
I/O Statistics and Enterprise Manager 13-32
Practices 13-2 and 13-3: Overview 13-34
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
xiii
Track the SR and Implement Repairs 14-24
Creating User-Reported Problems 14-25
Enterprise Manager Support Workbench for ASM 14-26
Invoking IPS Using ADRCI 14-27
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Quiz 14-29
Health Monitor: Overview 14-30
Running Health Checks Manually: Enterprise Manager Example 14-32
Running Health Checks Manually: PL/SQL Example 14-33
Viewing HM Reports Using the ADRCI Utility 14-34
SQL Repair Advisor: Overview 14-35
Accessing the SQL Repair Advisor Using Enterprise Manager 14-36
Viewing, Disabling, or Removing a SQL Patch 14-37 ble
Using SQL Repair Advisor from PL/SQL: Example 14-38 fe r a
ans
Using the SQL Test Case Builder 14-39
n - t r
Quiz 14-40 o
Summary 14-41 s an
Practice 14: Overview 14-42
r ) ha deฺ
m ฺa Gui
15 Real-Time SQL Monitoring n ฺ co ent
Objectives 15-2
@ ao Stud
SQL Monitoring 15-3 z i l le this
ฺ
loDatabase e Release 2 15-5
s11g
SQL Monitoring in Oracle
c e
r Enterprise u
SQL Monitoring with
m a e to Manager Database Control 15-6
Monitored
i l l eSQL( Executions
c e ns 15-7
SQL
l o Z
Monitoring li 15-8
List
e
Marc Monitored SQL Execution Details 15-9
SQL Execution Details for Parallel Queries 15-10
Details for Parallel Execution 15-11
Activity Details for Parallel Execution 15-12
Viewing Session Details 15-13
SQL Details 15-14
Viewing the SQL Monitoring Report 15-15
Quiz 15-16
Summary 15-17
Practice 15-1: Overview 15-18
16 Performance Enhancements
Objectives 16-2
Using the DBMS_ADDM Package 16-3
Advisor Named Findings and Directives 16-6
xiv
Modified Advisor Views 16-7
New ADDM Views 16-8
Quiz 16-9
Review: Oracle Database 10g SGA Parameters 16-10
Review: Oracle Database 10g PGA Parameters 16-11
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
e oZ l
Multicolumn Statistics: Overview 16-39
l
Marc Expression Statistics: Overview 16-41
Deferred Statistics Publishing: Overview 16-42
Deferred Statistics Publishing: Example 16-44
Quiz 16-45
Locking Enhancements 16-46
Identify Foreground and Background Process Events 16-47
Summary 16-48
Practice 16: Overview 16-49
xv
Usage Guidelines to Reduce Invalidation 17-9
Invisible Index: Overview 17-10
Invisible Indexes: Examples 17-11
Adaptive Cursor Sharing: Overview 17-12
Adaptive Cursor Sharing: Architecture 17-13
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
xvi
Parallel Backup and Restore for Very Large Files 18-13
Using RMAN Multisection Backups 18-14
Quiz 18-15
Duplicating a Database 18-16
Performing Active Database Duplication 18-17
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
xvii
Flashback Data Archive: Supporting Transparent Schema Evolution 19-17
Flashback Data Archive: Supporting Full Schema Evolution 19-18
Viewing Flashback Data Archives 19-19
Guidelines and Usage Tips 19-20
Quiz 19-21
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
xviii
Appendix A: Practices and Solutions
xix
Using Destination Groups for Multiple Destination Jobs B-40
Using CREATE_GROUP B-41
Using ADD_GROUP_MEMBER B-42
Using DROP_GROUP B-43
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
xx
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Introduction
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
l l e@ is S
l o ฺzi se th
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Oracle Database
l
Zi Innovationlic
l o
As
a rcaeresult of its early focus on innovation, Oracle has maintained the lead in the industry with a
M large number of trend-setting products. Continued emphasis on Oracle’s key development areas
has led to a number of industry firsts—from the first commercial relational database, to the first
portable tool set and UNIX-based client/server applications, to the first multimedia database
architecture.
bl e
Managing fe r a
SMP RAC
dominance clusters
Grids of
changet r a ns
low-cost
o n
across
- the
for hardware and n
availability storagehas
a enterprise
r ) d e ฺ
ฺa Gu i
c o m n t
n ฺ e
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
l
i Computing
EnterpriseZGrid lic
l o
rce Database 10g was the first database designed for grid computing. Oracle Database 11g
Oracle
a
M consolidates and extends Oracle’s unique ability to deliver the benefits of grid computing. Oracle
Infrastructure grids fundamentally changed the way data centers look and operate, transforming
data centers from silos of isolated system resources to shared pools of servers and storage.
Oracle’s unique grid architecture enables all types of applications to scale out server and storage
capacity on demand. By clustering low-cost commodity server and storage modules on
Infrastructure grids, Oracle Database 11g enables customers to improve their user service levels,
reduce their down time, and make more efficient use of their IT resources while still increasing
the performance, scalability, and security of their business applications.
Oracle Database 11g furthers the adoption of grid computing by offering:
• Unique scale-out technology with a single database image
• Lower server and storage costs
• Increased availability and scalability
• Manageability
• Availability
• Performance
• Business intelligence and data warehousing
• Security e
r a bl
s fe
- t r an
n no
a
s ฺ
h a
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Oracle Database
l
Zi 11g: licFocus Areas
l o
rceOracle Infrastructure grid technology enables information technology systems to be built out
The
a
M of pools of low-cost servers and storage that deliver the highest quality of service in terms of
manageability, high availability, and performance. With Oracle Database 11g, the existing grid
capabilities are extended in the areas listed in the slide, thereby making your databases more
manageable.
Manageability: New manageability features and enhancements increase DBA productivity,
reduce costs, minimize errors, and maximize quality of service through change management,
additional management automation, and fault diagnosis.
Availability: New high-availability features further reduce the risk of down time and data loss,
including further disaster recovery offerings, important high-availability enhancements to
Automatic Storage Management, support for online database patching, improved online
operations, and more.
Performance: Many innovative new performance capabilities are available, including
SecureFiles, compression for OLTP, Real Application Clusters optimizations, SQL Query Result
Cache, TimesTen enhancements, and more.
• Information management
– Content management
– XML
– Oracle Text
– Spatial
– Multimedia and medical imaging ble
fe r a
• Application development ans
n - t r
– PL/SQL
a no
– .NET
h a s ฺ
– PHP ฺ a r) uide
– SQL Developer ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi 11g:
Oracle Database licFocus Areas (continued)
l o
rceOracle Infrastructure grid provides the additional functionality required to manage all the
The
a
M information in the enterprise with robust security, information life-cycle management, and
integrated business intelligence analytics to support fast and accurate business decisions at the
lowest cost.
Auto-tuning
Advisory
ble
Instrumentation fe r a
ans
n - t r
a no
Recovery
Replication
RAC
Memory
Schema
Apps/SQL
Backup
Storage
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Management
l
Zi Automation
lic
l o
rce Database 11g continues the effort begun in Oracle9i Database and carried on through
Oracle
a
M Oracle Database 10g to dramatically simplify and ultimately, fully automate the tasks that DBAs
must perform. What is new in Oracle Database 11g is Automatic SQL Tuning with self-learning
capabilities. Other new capabilities include automatic, unified tuning of both SGA and PGA
memory buffers, and new advisors for partitioning, database repair, streams performance, and
space management. Enhancements to Oracle Automatic Database Diagnostic Monitor (ADDM)
give it a better global view of performance in Oracle Real Application Clusters (RAC)
environments and improved comparative performance analysis capabilities.
Installation I, 1 - 3 1
Manage Security 8 3
Marc
le
oZ
i l l l
m a r c e
e ( icens
e
z i
to
l @
loฺ use
n
le this
ฺ
m
ao Stud
r )
co ent
s
ฺa Gui
ha deฺ
an
on - t r an
s
fe r a bl
e
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Standardized infrastructure
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Applications
software
• Eliminates need for third- Middleware
party solutions
• Includes:
Database
– Automatic Storage
Management (ASM) EM
Oracle Grid Infrastructure ble
– ASM Cluster File System
fe r a
(ACFS)
ans
– ACFS Snapshots
n - t r
– Oracle Clusterware
a no
– Oracle Restart h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Oracle Grid
i l lic
ZInfrastructure
l o
e Grid Infrastructure includes: Automatic Storage Management (ASM), ASM
The
a rcOracle
MCluster File System (ACFS), ACFS Snapshots, Oracle Clusterware, and Oracle Restart. These
components are installed into the Grid Infrastructure home using the Oracle Universal
Installation (OUI) tool.
Application Application
Application 3rd Party
Database Database ACFS FS
Database
ASM ble
ASM/ADVM fe r a
ASM
t r a ns
Operating System
Operating Systemo n -
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Automatic Z i l
Storage ic
lManagement Technology Stack
e l o
The
a rcgraphics in the slide illustrate the software stack for previous versions of ASM and ASM
M in Oracle Database 11g Release 2. “Previous Releases of ASM” refers to Oracle Database 10g
and Oracle Database 11g Release 1. Previously, ASM sat on top of the operating system,
which provided the drivers to access the storage devices. The database sits on top of ASM, and
applications on top of the database.
In the Oracle 11g Release 2 Automatic Storage Management stack, ASM still sits on the
operating system (OS) level and includes the ASM Dynamic Volume Manager (ADVM). At
the same level as the database there is the ASM Cluster File System (ACFS), and the
possibility of third-party file systems built on ASM.
• Memory requirements:
– 1 GB for the database instance with Database Control
– 1.5 GB for the ASM instance and Oracle Restart
• Disk space requirements:
– 3 GB of swap space (based on 2GB RAM)
– 1 GB of disk space in the /tmp directory le
a b
– Between 1.5 GB and 3.8 GB for the Oracle software
s f er
– 1.7 GB for the preconfigured database (optional)-tra
n
– 2.4 GB for the fast recovery area (optional) n on
a s ฺ
) ha
• Operating system (see documentation)
ฺ a r ide
u
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Oracle Grid i l lic and Oracle Database Installation: System
ZInfrastructure
l o
rce
Requirements
a
MA standard database installation can be completed on a computer with 1 GB of RAM and 1.5
GB of swap space or larger. A standard Oracle Grid Infrastructure for stand-alone server
installation requires a minimum of 1.5GB RAM.
Note: Oracle Restart enables Oracle components to be automatically restarted after a hardware
or software failure, or whenever your database host computer restarts. Additional information
on Oracle Restart is provided later in this lesson and in the lesson titled "Oracle Restart."
The amount of swap space required is dependent on the amount of RAM. Please see the
OS-specific installation guide for more details.
Depending on the activity level of the machine on which you are installing the Oracle
Database software, the standard installation can complete in 20 minutes or less.
Some installation details:
• Oracle Database 11g ships two seed database templates.
• Duplicated files are removed.
• Many other products and demonstrations are installable from additional CDs.
The hardware requirements listed in the slide are minimal requirements across all platforms.
Your installation may have additional requirements (especially disk space).
Note: An Enterprise Edition installation type that includes a standard seed database is referred
to as a “standard installation.”
Oracle Database 11g: New Features for Administrators 1 - 5
11.2
• Groups:
– oinstall
– dba
– Optional groups (for separation of duty across
multiple users):
— oper ble
fe r a
— asmdba
ans
— asmoper
n - t r
— asmadmin
a no
• Users: h a s ฺ
ฺ a r) uide
– Software owner, usually oracle
ฺ c om ent G
– Can create multiple users a on fortumultipled product
installations lle @ is S
ฺ z i t h
e loCopyright
u e
s2009,
a r c t o © Oracle. All rights reserved.
l e (m ense
Preparing Zi l lic
e l o the Operating System
arc are steps that need to be performed by the systems administrator for the hardware you
There
Mare using for your Oracle installation. Refer to your operating system-specific installation
documentation for detailed information on the operating system configuration details and
commands.
One of the required steps is to create the necessary operating system groups and users. The two
required operating system groups are: oinstall and dba. If you are implementing separation
of duty across multiple user accounts, other groups that should be created are: oper, asmdba,
asmoper, and asmadmin. You need at least one operating system user to act as the owner of
your Oracle installation. In most cases the oracle user is configured for this purpose. If you
want to have a true separation of duty then you can have separate owners for each of your
Oracle products.
Installation Scenario
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Part One: Zi l
Installing c Oracle Grid Infrastructure for Stand-Alone Server
lithe
l o
To
a ce the Oracle Grid Infrastructure software by using OUI, log on to your computer as a
rinstall
Mmember of the administrative group that is authorized to install the Oracle Grid Infrastructure
software, and create and manage the database. Insert the distribution CD for the clusterware
into your CD drive, or navigate to the Oracle clusterware staging location. From that location,
enter ./runInstaller to start the Oracle Universal Installer (OUI). The Select Installation
Option page is displayed. Select the “Install and Configure Grid Infrastructure for a
Standalone Server” option and click Next.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
SelectingoProduct lic
Languages
l
e Product Languages” page is displayed. To add a language to the installation, click
The
a rc“Select
M the language to highlight it and then use the right-arrow button to move it the “Selected
Languages” list. Multiple languages can be selected by pressing and holding the Ctrl key while
selecting them with the mouse. Click the Next button to proceed with the installation.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
CreatingoanZASM
l
i Disk lic Group
l
e ASM Disk Group” page is displayed. The Oracle Grid Infrastructure includes
The
a rc“Create
M support for ASM and Oracle Restart. The OUI will not proceed unless an ASM disk group is
created. Enter the name of the first ASM disk group to be created in the “Disk Group Name”
field. If the “Add Disks” section is not populated with candidate disks, then click the “Change
Discovery Path” button, and enter the disk discovery path to the ASM disks.
Oracle recommends that you create two disk groups for most environments. The OUI is only
capable of creating a single ASM disk group at this time. You may create the recommended
second ASM disk group after the installation using the ASM Configuration Assistant
(ASMCA) utility or the SQL*Plus utility. Click the Next button to proceed with the
installation.
Note: Devices appear in the list for the example due to ASMLib being configured. ASMLib is
only for Linux platforms. There is a default discovery path specific to each operating system.
If the default discovery path does not locate any devices, you can click the “Change Discovery
Path” button and define the actual path.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
DefiningoASM
l
Zi Passwords
lic
e l
The
a rc“Specify ASM Password” page is displayed. Passwords must be supplied for two
Maccounts: the SYS account and the ASMSNMP account. The option to use different passwords
for the accounts or the option to use the same password for the accounts is presented. The
ASM instance does not contain a data dictionary such as an Oracle database, so the only
authentication methods are operating system authentication and password file authentication.
The SYS account will be added to the password file (orapw+ASM on Linux) and granted the
SYSDBA, SYSOPER, and SYSASM privileges. The ASMSNMP account will be added to the
password file and granted only the SYSDBA privilege. After entering appropriate passwords,
click the Next button to proceed with the installation.
Note: The ASMSNMP user is created to provide monitoring of the ASM instance through
Enterprise Manager. ASMSNMP has limited access and capabilities.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
DefiningoPrivileged ic
lOperating System Groups
e l
The
a rc“Privileged Operating System Groups” page is displayed. The OUI utility provides
M suggested default values for the following groups if the current user is an operating system
member of the groups:
• ASM Database Administrator (OSDBA) Group: asmdba
• ASM Instance Operator (OSOPER) Group: asmoper
• ASM Instance Administrator (OSASM) Group: asmadmin
Because this installation is for a stand-alone server, it is common practice to use the same
operating system group for all three, such as dba (as shown in the slide). Click the Next button
to proceed with the installation. Click Yes in response to the warning that appears because you
use the same operating system group for OSDBA, OSOPER, and OSASM.
Note: Because the Oracle Database server logs in to the ASM instance with a SYSDBA
connection, the OSDBA group selected for the Grid Infrastructure installation needs to be the
same as the OSDBA group selected for the Database installation.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Specifying i l
ZInstallationlic Location
e l o
The
a rc“Specify Installation Location” page is displayed. In the “Oracle Base” field, enter the
Mvalue of ORACLE_BASE for the software owner. The default value is /u01/app/grid, but
because this installation is not using a separate grid user, this value should be changed to
match the installation user. In the example, this user is oracle. In the “Software Location”
field, enter the value of the ORACLE_HOME for the Grid Infrastructure software. The default
value is /u01/app/oracle/product/11.2.0/grid. Click the Next button to proceed
with the installation.
Creating Inventory
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
CreatingoInventory lic
l
e Inventory directory does not exist on the host machine, the "Create Inventory"
rcOracle
Ifaan
M page is displayed. In the "Inventory Directory" field, enter the desired location for the
oraInventory directory. The recommended oraInventory directory should be one
level higher than the ORACLE_BASE directory. The directory is
/u01/app/oraInventory in the example.
Select the oraInventory group name from the selection list. The recommended name is
oinstall. Click the Next button to proceed with the installation.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Performing i l
ZPrerequisitelic Checks
e l o
The
a rc“Performing Prerequisite Checks” page appears. No action is required on this page unless
M the checks fail with errors.
If errors do occur, they will need to be corrected before proceeding with the installation. If the
error is one that is not fixable, you must either fix the problem manually or choose to Ignore
All and continue on with the installation (if the failed check is not critical).
Note: Not all failures can be fixed by the runfixup.sh script generated by the OUI. In such
cases, manual intervention to correct the problem is required before you can reattempt the
installation.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
VerifyingoInstallationlicSummary Data
e l
The
a rc“Summary” page is displayed. You are presented with the option to save the interactive
M installation questions and answers to a response file. A response file can be used in future
installations to perform a silent installation in the same manner in which this installation is
being performed. The response file is a text file and can also be edited with a text editing tool
to modify it for a different installation. Click the Finish button to proceed with the installation.
bl e
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Monitoring i l lic Progress
ZInstallation
e l o
The
a rc“Setup” page shows the progress of the installation. This includes preparing for
M installation, copying files, linking libraries, and creating setup files. No action is required on
this page unless the installation fails with errors. If errors do occur, they will need to be
corrected before proceeding with the installation.
bl e
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Executing root
l
Zi Configuration
lic Scripts
e l o
The
a rc“Execute Configuration scripts” dialog box appears, indicating configuration scripts that
Mneed to be executed as the root user. The orainstRoot.sh script is executed to change
the permission of the Oracle Central Inventory directory by adding read and write permissions
for the group, along with removing the read, write, and execute permissions for world. The
root.sh script copies files to the /usr/local/bin directory, creates the
/etc/oratab file, creates OCR keys for the grid user, starts the ohasd daemon, and
modifies the /etc/inittab to automatically start the ohasd daemon when the machine is
started. After you execute the root scripts, click the OK button to return to the “Setup”
progress page and proceed with the installation.
Note: The ohasd daemon is the Oracle High Availability Services daemon. In an Oracle
Restart environment the ohasd daemon manages application resources.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Executing Zi l lic Assistants
Configuration
l o
e Net Configuration Assistant (NETCA) is invoked with a silent installation method
The
a rcOracle
M to create the network configuration files, followed by the Automatic Storage Management
Configuration Assistant (ASMCA) to create the ASM disk group and register ASM
components with Oracle Restart.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Finishingothe
l
Zi Installation
lic
e l
The
a rc“Finish” page is displayed at the end of the installation. Click the Close button to exit the
M OUI utility.
Note: At this point Grid Infrastructure daemons are running, the ASM instance is started, a
single disk group is mounted, and the listener is running.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Configuring
l
Zithe FRAlicDisk Group
l o
rce you can configure only one disk group during the installation of Oracle Grid
Because
a
M Infrastructure, the creation of further disk groups must be done manually. In this scenario, the
FRA disk group is used for the fast recovery area of the database. The ASM Configuration
Assistant (ASMCA) utility provides an intuitive GUI interface allowing you to easily create
new or remove existing ASM disk groups.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e l oZ l
M arc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Answer:o 2 Zi
l lic
l
a rce
M
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
user
ASM
ASMInstance
Instance
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Kernel ASM
ASMCluster
ClusterFile
FileSystem
System(ACFS)
(ACFS)
OS ACFS Snapshots
ACFS Snapshots
Dynamic
DynamicVolume
VolumeManager
Manager
ASM Device File: /dev/asm/dgbvol1-123
ble
ASM Files Dynamic Volumes fe r a
ans
ASM n - t r
DB
DB
DB
files
DB
files
files
files a no
Disk DB
DB files
files a s ฺ
DB files h
Group
DBDB
DBDB
files
files
files
files
ACFSr)
ฺ a u ide3rd Party
DBDB
DBDB
files
files
files
DBfiles ฺ c om ent G FS
files
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
ASM Files
l
Zi Volumes
and lic
l o
e feature of Oracle Database has been extended in Oracle Grid 11g Release 2 to
The
a rcASM
Minclude support for a general purpose cluster file system, ASM Cluster File System (ACFS).
To understand the operation of this feature, some terminology needs to be defined and
explained.
At the OS user level, the ASM instance provides the disk group which is a logical container for
physical disk space. The disk group can hold ASM database files and ASM dynamic volume
files. The ASM Dynamic Volume Manager (ADVM) presents the volume device file to the
operating system as a block device. The mkfs utility can be used to create an ASM file system
in the volume device file. Once mounted, general purpose files may be created in the ACFS.
There are four OS kernel modules that are loaded in the OS, providing the data service. On
Linux they are: oracleasm, the ASM module; oracleadvm, the ASM Dynamic Volume
Manager module; oracleoks, the kernel services module; and oracleacfs, the ASM file system
module. These modules provide the ASM Cluster File System, ACFS snapshots, the ADVM,
and cluster services. The ASM volumes are presented to the OS as a device file at
/dev/asm/<volume name>-nnn, where nnn is the disk group number.
The volume device file appears as another ASM file to the ASM instance and ASMCMD
utility. But to the OS file system commands, the ASM layers are transparent. Only the general
purpose files and directories created in the ACFS and the ACFS snapshots are visible to the
OS file system commands.
Primary
AU
Data Stripe 1 2 3 4
(Default: 128KB) 5
Allocation
ble
Unit (AU)
... ... ... ...
fe r a
Volume Extent
(64MB)
Volume Extent 1 Volume Extent 2 Volume Extent 3 Volume Extent 4
an s
ASM Dynamic Volume (Default: 128KB stripe width, 4 stripe columns)
n - t r
a no
h a s ฺ
ฺ a r) uide
1
2
ACFS File
ฺ c om ent G 3
4 (640KB)
a on tud 5
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
ASM Dynamic
l
Zi Volume lic Striping
e l o
The
a rcdiagram in this slide illustrates the relationship between an ASM Dynamic Volume and
Mthe ASM structures that underpin it. It also illustrates how files are striped using an ASM
Dynamic Volume.
A Dynamic Volume is essentially the same as an ASM file. It is made up of units of space
known as Allocation Units (AU). These are spread across the available disks in an ASM Disk
Group and may be mirrored for data protection purposes. Like any other ASM file, a Dynamic
Volume must be wholly contained with a single disk group.
Dynamic Volume extents and space allocation differs from regular ASM files. In a disk group
with an AU size of 1 MB, each volume extent is 64 MB in size. Volume extents are allocated
in groups based on the number of striping columns specified for the volume. The default
number of striping columns is 4. The volume extent size multiplied by the number of striping
columns determines the volume allocation unit (VAU) for the volume. The default VAU is
256 MB for a volume created in a disk group with a 1 MB AU. The overall size of a volume
must be a multiple of the VAU.
Volume striping is similar to fine grain ASM striping. The default stripe settings specify a
stripe size of 128 KB with four striping columns. In other words, data is written in turn across
four allocation units in 128 KB chucks until each group of four AUs is filled.
Setting the number of columns on an Oracle ADVM volume to 1 effectively turns off striping
for the ADVM volume.
Note: To add a volume to an ASM disk group, the COMPATIBLE.ASM and
COMPATIBLE.ADVM disk group attributes must be set to 11.2.
Oracle Database 11g: New Features for Administrators 1 - 31
11.2
ADVM Restrictions
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
CreatingoanZASM Dynamic Volume
e l
rc the following steps to create an ASM dynamic volume:
Perform
Ma 1. On the Enterprise Manager home page, scroll down to the Instances section. Click the
name of one of the ASM instances.
2. On the Automatic Storage Management page, click the ASM Cluster File System tab.
3. On the ASM Cluster File System tab, click Create.
4. On the Create ASM Cluster File System page, click Create ASM Volume.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
i l
CreatingoanZASM Dynamic lic Volume (continued)
l
On
a rctheeCreate ASM Volume page, enter a volume name and size. In this example, a volume
M named testvol with a size of 1 GB is created.
If you click “Show SQL,” you see the following SQL command:
ALTER DISKGROUP DATA ADD VOLUME TESTVOL SIZE 1G;
Click OK to create the volume.
Optionally, you can specify a region of the physical disk in the disk group where the extents
should be placed. Optimal Disk Placement is discussed in detail in the ASM Enhancements
lesson.
The ASMCMD command to add a volume is:
ASMCMD> volcreate -d DATA -s 1G testvol
You can use the ASMCMD and SQL commands to view the volume information as shown
below:
ASMCMD> volinfo –a
SQL> SELECT * FROM v$asm_volume;
• Add a volume:
SQL> ALTER DISKGROUP DGROUPA
ADD VOLUME asmvol1 SIZE 10G;
• Resize a volume:
SQL> ALTER DISKGROUP DGROUPA
RESIZE VOLUME asmvol1 SIZE 15G; ble
fe r a
• Drop a volume: ans
n - t r
SQL> ALTER DISKGROUP DGROUPA
a no
DROP VOLUME asmvol1;
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Using SQL
l
Ztoi Manage lic ASM Dynamic Volumes
l o
rceare new SQL commands that enable you to manage ASM volumes. Note that each
There
a
Mvolume is managed as a part of a disk group. You can create volumes, resize the volume, and
drop volumes as shown in the examples in the slide.
Note: When you create a volume named asmvol1 in the DGROUPA disk group (as shown in
the example in the slide), a device is created in /dev/asm named asmvol1-xxx, where
xxx is a number unique to the disk group.
• Enable a volume:
SQL> ALTER DISKGROUP DGROUPA
ENABLE VOLUME asmvol1;
• Disable a volume:
SQL> ALTER DISKGROUP ALL
DISABLE VOLUME ALL; ble
fe r a
• Modify a volume: ans
n - t r
o
SQL> ALTER DISKGROUP DGROUPA
an
as
MODIFY VOLUME asmvol1 USAGE 'acfs';
) h deฺ
r
ฺa Gui
co entm
n ฺ
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Using SQL
l
Ztoi Manage lic ASM Dynamic Volumes (continued)
l o
e enable and disable volume as shown in the slide. The MODIFY VOLUME clause
You
a rccan
Menables you to set the intelligent data placement option [HOT|COLD], the mount point, and the
usage name of the volume.
Intelligent data placement enables you to specify disk regions on Oracle ASM disks for best
performance and is discussed in detail in the lesson titled “ASM Enhancements.”
l e (m ense
ASM Cluster
l
ZiFile System
lic
l o
e Cluster File System (ACFS), extends Automatic Storage Management (ASM) by
rcASM
The
a
Mproviding a robust, general purpose, extent-based, and journaling file system. ACFS provides
support for files such as Oracle binaries, report files, trace files, alert logs, and other
application data files. With the addition of ACFS, ASM becomes a complete storage
management solution for both Oracle database and non-database files. ACFS scales from small
files to very large files (exabytes) and supports large numbers of nodes in a cluster. ACFS is an
extent-based file system to provide high performance and uses a log-based metadata
transaction engine for file system integrity and fast recovery. The ACFS on-disk structure
supports endian neutral metadata. ACFS systems can be exported to remote clients through
industry standard protocols such as network file system (NFS) and Common Internet File
Systems (CIFS).
ACFS eliminates the need for third-party cluster file system solutions while simplifying all
file-type management in a single node, as well as RAC and Grid computing environments.
ACFS supports dynamic file system expansion and contraction without any down time. ACFS
is highly available, making use of the ASM mirroring and striping features in addition to
hardware RAID functionality.
ACFS is integrated with the Oracle tools for easy installation and configuration. ACFS can be
managed with Enterpriser Manager, SQL*Plus, and ASMCMD. ACFS is integrated with
native OS file management tools, so the file system is transparent to users.
Oracle Database 11g: New Features for Administrators 1 - 39
11.2
ACFS Architecture
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Manager
Using Enterprise lic to Manage ACFS
l o
e use Enterprise Manager to create and manage an ASM Cluster File System.
You
a rccan
M
Linux/UNIX Extensions
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Windows Extensions
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
l e (m ense
Zi l
WindowsoExtensions lic
e l
a•rcCreate an ACFS file system:
M acfsformat [/vf] [/b blksz] [/n name] device [blocks]
• Mount an ACFS file system:
acfsmountvol [/all] [/v]
• Unmount an ACFS file system:
acfsdismount [/v] [/p] [/P] path
• Check and repair an ACFS file system:
acfschkdsk [/a] [/v] [/n] [/f] [info] device
ACFS Platform-Independent
Commands
Command Function
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
acfsutil info Display new ACFS file and file system features
(ACFS, snapshots, registry, size) and information.
acfsutil snapshot Create and display ACFS snapshots.
acfsutil registry Register an ACFS file system with the ACFS mount
registry.
bl e
acfsutil rmfs Remove an ACFS file system. fe r a
an s
acfsutil size Resize an ACFS file system. n - t r
a no
acfsutil tune View or modify ACFS tuneables.
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l lic
ACFS Platform-Independent Commands
e l o
rcACFS commands for Linux/UNIX and Windows that are not natively supported are listed
New
Main the slide.
ACFS:
• Cannot be used for root file system or bootable
partition
• Cannot be used for the Grid Infrastructure home
directory
ASM Dynamic Volume Manager (ADVM)
a b le
• Presents a block device called a volume to the OS nsfe
r
• Uses a device driver n - tra
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
ASM Cluster
l
ZiFile System
lic Limitations
l o
e volume is constructed from an ASM file. One or more ADVM volumes may be
An
a rcADVM
Mconfigured within each ASM disk group. The ADVM Driver maps I/O requests against an
ADVM volume to blocks in a corresponding ASM file and disk set located within an ASM
disk group. An ADVM volume device exports ASM volume manager features and ensures
that volume mirrors remain consistent in the face of abnormal system shutdowns, ASM
instance failures, or system crashes. The ADVM volume can be extended dynamically if there
is space available in the ASM disk group.
Creating an ASM
Cluster File System
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
bl e
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Create an
l
Zi Cluster
ASM lic File System
l o
ceexample, an ASM Cluster File System is created on the testvol ASM volume that
In rthis
a
Mwas created previously. Note that a unique number is added to the volume name. This number
is system assigned.
Complete the fields on the page as follows:
• Assign a volume label. In this example, it is labeled test.
• Assign a mount point. The mount point must be an existing directory. Best practice is to
place the ACFS mount points in a common directory below the ORACLE_BASE
directory. In this example, ORACLE_BASE is /u01/app/oracle. The common
directory is acfsdata and the mount point is
/u01/app/oracle/acfsdata/test. The mount point directory must be created
on all the nodes of the cluster.
If you click “Show Command,” you can view the commands used to make the file system on
the ASM volume and to register the volume and mount point. For Linux, the commands are:
$ /sbin/mkfs -t acfs -b 4k /dev/asm/testvol-93 -n "test"
$ /sbin/acfsutil registry -f -a /dev/asm/testvol-93 \
/u01/app/oracle/acfsdata/test
Click OK to perform the operations. The file system will be created on the ASM volume and
the volume will be registered. The file system is then mounted on all the nodes of the cluster.
Note: Automount of ACFS mount points is not supported for single-node installations.
Oracle Database 11g: New Features for Administrators 1 - 48
11.2
ACFS Snapshots
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Answer:o 1 Zi
l lic
l
a rce
M
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Marc
le
oZ
i l l l
m a r c e
e ( icens
e
z i
to
l @
loฺ use
n
le this
ฺ
m
ao Stud
r )
co ent
s
ฺa Gui
ha deฺ
an
on - t r an
s
fe r a bl
e
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Installation Enhancements
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi 11glicInstallation: Changes (continued)
Oracle Database
l o
In
a ce Database 11g, Oracle Universal Installer (OUI) prompts you to specify the Oracle
rOracle
Mbase. The Oracle base that you provide during installation is logged in the local inventory. You
can share this Oracle base across all of the Oracle homes that you create on the system. Oracle
Corporation recommends that you share an Oracle base for all of the Oracle homes created by
a user.
Oracle Universal Installer has a list box in which you can edit or select the Oracle base. The
installer derives the default Oracle home from the Oracle base location that you provide in the
list box. However, you can change the default Oracle home by editing the location.
The following are changes made in Oracle Database 11g with respect to the Oracle base to
make it compliant with Optimal Flexible Architecture (OFA):
• ORACLE_BASE is a recommended environment variable.
• In Oracle Database 10g, the default flash recovery area and the data file location are one
level above the Oracle home directory. However, in Oracle Database 11g, the Oracle base
is the starting point to set the default fast recovery area and the data file location. Oracle
Corporation recommends that you keep the fast recovery area and data file location on
separate disk groups in ASM.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Part Two: Zi l
Installing c Oracle Database Software
lithe
l o
In
a celesson, the installation steps for the Oracle Database software are reviewed.
rthis
MLog on to your computer as a member of the administrative group that is authorized to install
the Oracle software, and to create and manage the database. Insert the distribution CD for the
database into your CD drive, or navigate to the Oracle database staging location. From that
location enter ./runInstaller to start the Oracle Universal Installer (OUI).
If desired, enter the email address where you want to be informed of security issues. If you
want to receive security updates via My Oracle Support, also include your My Oracle Support
password. If you do not enter your email address, a warning message is displayed asking if you
are sure you do not want to be informed about critical issues in your configuration. Click Yes
in response to this warning to continue with the installation.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Choosing the
l
Zi Type lof
ic Installation
l o
e Installation Option page is displayed. Choose the type of installation that you want
The
a rcSelect
M to perform:
• Create and Configure a Database: This option creates a database after the product is
installed.
• Install Database Software Only: This option installs only the Oracle Database binaries.
• Upgrade an Existing Database: This option is used to upgrade a database of an earlier
release.
Click Next.
bl e
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Choosing
l
Zi Installation
Grid lic Options
l o
e Installation Options page is displayed. Choose whether this is to be a single instance
The
a rcGrid
M database installation or an Oracle Real Application Clusters (RAC) database installation on a
cluster. Click Next to continue.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Choosing Zi l
Language licSettings
l o
e Product Languages page is next. Here you select all the languages in which your
The
a rcSelect
M product will run. English is selected by default and cannot be removed from the Selected
Languages list. Click Next to continue.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Choosing the
l
Zi Database
lic Edition
l o
e Database Edition page is displayed. Choose from one of the following three
The
a rcSelect
M editions:
• Enterprise Edition: This edition delivers a self-managing database that provides
performance, scalability, security, and reliability on a choice of clustered or single-
servers. It provides comprehensive features to easily manage the most demanding
transaction processing, business intelligence, and content management applications.
• Standard Edition: This edition provides a full-featured database for servers with up to
four sockets. It includes Oracle Real Application Clusters for higher availability, provides
enterprise-class performance and security, is simple to manage, and can easily scale as
demand increases. It is also upwardly compatible with the Enterprise edition.
• Standard Edition One: This edition provides a full-featured database for servers with up
to two sockets. It provides enterprise-class performance, security, and manageability that
can easily scale as demand increases. It is also upwardly compatible with other database
editions.
Click the Select Options button to further customize what components are installed. Click
Next when finished with all selections on the Select Database Edition page.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Specifying i l lic Location
ZInstallation
l o
e Installation Location page is displayed next. A suggested Oracle base path
The
a rcSpecify
M appears by default. You can change the path based on your requirement. In the Software
Location section, you can accept the default values or enter the Oracle home name and
directory path in which you want to install the Oracle components. The directory path should
not contain spaces. Click Next to continue the installation process.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Choosing Zi l
Operating licSystem Groups
e l o
The
a rcPrivileged Operating System Groups page is displayed. Choose the appropriate operating
Msystem group for the OSDBA and OSOPER privileges. By default dba is specified for OSDBA
and oper is specified for OSOPER. Click Next to continue.
bl e
fe r a
an s
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Performing i l lic Checks
ZPrerequisite
e l o
The
a rcPerform Prerequisite Checks page is displayed. The OUI goes through various
M prerequisite checks. After all the checks have been performed, the OUI displays a message if
any of the tests fail. No action is required on this page unless the checks fail with errors. If
errors do occur, they will need to be corrected before proceeding with the installation. In most
cases, OUI is able to correct those errors by instructing you to run a script that will correct
these issues and then run the checks again. If the error is not fixable, you must either fix the
problem manually or choose “Ignore All” and continue with the installation (if the failed check
is not critical). Click Next to continue.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Installation i l
ZSummary licPage
e l o
a rcSummary
The page is displayed. Review the information presented that is related to the
M installation answers provided on previous windows. You are presented with the option to save
the interactive installation questions and answers to a response file. A response file can be
used in future installations to perform a silent installation in the same manner in which this
installation is being performed. The response file is a text file and can also be edited with a
text editing tool to modify it for a different installation. Click the Finish button to proceed with
the installation.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Pagelic
Install Product
l o
rceinstallation process pauses at this point, requiring you to execute an additional
Your
a
Mconfiguration script as the root user. In a separate terminal window, enter:
$ su
# password: oracle <root password, does not appear in the window>
# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Accept the default for the local bin directory during a Linux or UNIX installation. When the
script is finished, exit from the root account and close the window. Click OK in the Execute
Configuration scripts dialog box to allow the installation to complete.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Installation i l
ZFinish lic
Page
l o
rceall the installation steps are completed, the Finish page is displayed. Click the Close
After
a
M button to exit the OUI utility.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
≥≥ 9.2.0.8
9.2.0.8
≥≥ 10.1.0.5
10.1.0.5
ble
fe r a
≥≥ 10.2.0.2
10.2.0.2
ans
n - t r 11.2
11.2
o
s an
r ) ha deฺ
m ฺa Gui
11.1.0.6 onฺ
≥≥ 11.1.0.6
co ent
@ a Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
l
Zi 11glicRelease 2 Upgrade Paths
Oracle Database
l o
e that you must take to upgrade to Oracle Database 11g Release 2 depends on the
The
a rcpath
Mrelease number of your current database. It might not be possible to upgrade directly from the
current version of the Oracle Database to the latest version. Depending on your current release,
you might be required to upgrade through one or more intermediate releases to upgrade to
Oracle Database 11g Release 2.
For example, if the current database is running release 8.1.6, follow these steps:
1. Upgrade release 8.1.6 to release 8.1.7.4 by using the instructions in Oracle8i Database
Migration, Release 3 (8.1.7).
2. Upgrade release 8.1.7.4 to release 10.2.0.4 by using the instructions in Oracle Database
Upgrade Guide 10g Release 2 (10.2).
3. Upgrade release 10.2.0.4 to Oracle Database 11g Release 2 by using the latest Upgrade
Guide.
Deprecated Features in
Oracle Database 11g Release 1 and Release 2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
•
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
USER_DUMP_DEST
• BACKGROUND_DUMP_DEST DIAGNOSTIC_DEST
• CORE_DUMP_DEST
• UNDO_MANAGEMENT not set implies AUTO mode.
• CONTROL_MANAGEMENT_PACK_ACCESS
– Specifies the Server Manageability Packs that should be able
active s f er
– Default is DIAGNOSTIC+TUNING - t r an
n no
a
s ฺ
h a
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Initialization
l
ZiParameter
lic Information
e l o
The
a rcDIAGNOSTIC_DEST initialization parameter replaces the USER_DUMP_DEST,
M BACKGROUND_DUMP_DEST, and CORE_DUMP_DEST parameters. Starting with Oracle
Database 11g, the default location for all trace information is defined by
DIAGNOSTIC_DEST, which defaults to $ORACLE_BASE/diag. Old parameters are
ignored if specified.
For more information about diagnostics, refer to the lesson titled “Diagnosability
Enhancements.”
A newly installed Oracle Database 11g instance defaults to automatic undo management
mode, and, if the database is created with the DBCA, an undo tablespace is automatically
created. A null value for the UNDO_MANAGEMENT initialization parameter now defaults to
automatic undo management; in previous releases, it defaulted to manual undo management
mode. You must, therefore, be careful when upgrading a previous release to Oracle Database
11g.
The Diagnostic Pack must be enabled before the Tuning Pack can be enabled.
The possible values for the CONTROL_MANAGEMENT_PACK_ACCESS parameter:
• NONE: Diagnostic Pack and Tuning Pack functionality is disabled in the database server.
• DIAGNOSTIC: Only Diagnostic Pack functionality is enabled in the server.
• DIAGNOSTIC+TUNING (default): Diagnostic Pack and Tuning Pack functionality is
enabled in the database server.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e l oZ l
M arc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Optional generic
configuration
parameters
Oracle Oracle
RDBMS RDBMS
kernel kernel
Specific
configuration
parameters DBA
Specific Specific
kernel kernel
ble
NFS driver NFS driver
fe r a
an s
n - t r
Variations across platforms
a no
Many parameters to tune
h a s ฺNAS
NAS
a r) uideStorage
Ease of NFS configuration
ฺ
Storage
o m ntune
Fewer parameters
c
to
t G
n ฺ e (NFS V3)
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Direct NFS
i l
ZClient: lic
Overview
l o
rceNFS is implemented as a Direct Network File System client as part of the Oracle
Direct
a
MRDBMS kernel in the Oracle Disk Manager library. NAS-based storage systems use Network
File System to access data. In Oracle Database 10g, NAS storage devices are accessed using
the operating system–provided kernel Network File System driver, which requires specific
configuration settings to ensure its efficient and correct usage with Oracle Database. The
following are the major problems that arise from incorrectly specifying these configuration
parameters:
• NFS clients are very inconsistent across platforms and vary across operating system
releases.
• With more than 20 parameters to tune, manageability is affected.
Oracle Direct Network File System implements the NFS version 3 protocol in the Oracle
RDBMS kernel. The following are the main advantages of implementing Oracle Direct NFS:
• It enables complete control over the input/output path to Network File Servers. This
results in predictable performance and enables simpler configuration management and a
superior diagnosability.
• Its operations avoid the kernel Network File System layer bottlenecks and resource
limitations. However, the kernel is still used for network communication modules.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e l oZ l
M arc
1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
mv libodm11.so libodm11.so_stub
3 ln -s libnfsodm11.so libodm11.so
ble
fe r a
ans
Mount points lookup order
n - t r
$ORACLE_HOME/dbs/oranfstab Load balancing
server: MyDataServer1
a no
and
path: 132.34.35.12
h
path: 132.34.35.13 a s ฺ
/etc/oranfstab
failover
ฺ a r) uide
export: /vol/oradata1 mount: /mnt/oradata1
ฺ c om ent G
on tud
/etc/mtab
a
@ is S
i l l e
l o ฺz se th
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Direct NFS
i l lic
ZConfiguration
l o
By
a ce Direct NFS attempts to serve mount entries found in /etc/mtab. No other
rdefault,
Mconfiguration is required. You can optionally use oranfstab to specify additional Oracle-
specific options to Direct NFS. For example, you can use oranfstab to specify additional
paths for a mount point as shown in the example in the slide.
When oranfstab is placed in $ORACLE_HOME/dbs, its entries are specific to a single
home. However, when oranfstab is placed in /etc, it is global to all Oracle databases and
thus, can contain mount points for all Oracle databases.
Direct NFS looks for the mount point entries in the following order:
$ORACLE_HOME/dbs/oranfstab, /etc/oranfstab, and /etc/mtab. It uses the
first matched entry as the mount point.
In all cases, Oracle requires that mount points be mounted by the kernel NFS system even
when being served through Direct NFS. Oracle verifies kernel NFS mounts by cross-checking
entries in oranfstab with the operating system NFS mount points. If a mismatch exists,
Direct NFS logs an informational message and does not serve the NFS server.
2. (Optional) Create an oranfstab file with the following attributes for each NFS server to
be accessed using Direct NFS:
- Server: The NFS server name
- Path: Up to four network paths to the NFS server, specified either by IP address or by
name, as displayed using the ifconfig command. The Direct NFS client performs
load balancing across all specified paths. If a specified path fails, Direct NFS reissues
I/Os over any remaining paths. le
- Export: The exported path from the NFS server r a b
s f e
tranNFS. To
- Mount: The local mount point for the NFS server
3. Oracle Database uses the ODM library, libnfsodm10.so, to enablenDirect -
replace this standard ODM library with the ODM NFS library, a no the following
complete
steps: h a s ฺ
- Change directory to $ORACLE_HOME/lib. ฺar) u ide
m nt G
- Enter the following commands: ฺco
on tude
cp libodm11.so libodm11.so_stub a
@ is S
i l l e
ln -s libnfsodm11.so libodm11.so
ththe Direct NFS client:
l
Use one of the following methodso ฺz to disable
s e
• Remove the oranfstab a rce file.to u
• Restore the l estub
e n se file by reversing the process you completed in step 3.
(mlibodm11.so
• Remove
l
Zithe specific
lic NFS server or export paths in the oranfstab file.
l o
rce
Note
a
M • If you remove an NFS path that the Oracle Database is using, you must restart the
database for the change to be effective.
• If Oracle Database is unable to open an NFS server using Direct NFS, it uses the platform
operating system kernel NFS client. In this case, the kernel NFS mount options must be
set up correctly. Additionally, an informational message is logged in to the Oracle alert
and trace files indicating that Direct NFS could not be established.
• With the current ODM architecture, there can be only one active ODM implementation
for each instance at any given time. Using NFS ODM in an instance precludes any other
ODM implementation.
• The Oracle files resident on the NFS server that are served by the Direct NFS Client are
also accessible through the operating system kernel NFS client. The usual considerations
for maintaining integrity of the Oracle files apply in this situation.
SVR_ID/
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
V$DNFS_FILES
ID
Join column
ble
fe r a
ans
n - t r
o
an
ID/
SVR_ID V$DNFS_CHANNELS s
ha deฺ
r
ฺa Gui)
co entm
n ฺ
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Monitoring
i l
ZDirect lic
NFS
l o
e following views for Direct NFS management:
Use
a rcthe
M • V$DNFS_SERVERS: Shows a table of servers accessed using Direct NFS
• V$DNFS_FILES: Shows a table of files currently open using Direct NFS
• V$DNFS_CHANNELS: Shows a table of open network paths (or channels) to servers for
which Direct NFS is providing files
• V$DNFS_STATS: Shows a table of performance statistics for Direct NFS
l e (m ense
Installingoan
l
ZiOnlineliPatch
c
l
rce traditional patching mechanisms, applying an online patch does not require instance
Unlike
a
M shutdown or restart.
Similar to traditional patching, you can use OPatch to install an online patch.
You can determine whether a patch is an online patch by using the following commands:
opatch query -is_online_patch <patch location> or
opatch query <patch location> -all
Note: The patched code is shipped as a dynamic/shared library, which is then mapped to
memory by each Oracle process.
ฺ c om ent G
– Minimum amount of memory:
a on tuApproximately
d one OS
page per runningeOracle
l @ iprocess s S
i l h
e l oฺz use t
a rc Copyright
t o © 2009, Oracle. All rights reserved.
l e (m ense
Zi
Online Patching
l lic
Considerations
e l o
arcoperating system (OS) page is typically 4 KB on Linux x86 and 8 KB on Solaris
One
MSPARC64. With an average of approximately one thousand Oracle processes running at the
same time, this represents around 4 MB of extra memory for a small online patch.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Oracle Restart
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
11.2
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Oracle Restart
l e (m ense
Oracle RestartZi l lic
l o
rceRestart is designed to improve the availability of your Oracle Database. It implements a high
Oracle
a
Mavailability solution for single instance (nonclustered) environments only. For Oracle Real
Application Cluster (Oracle RAC) environments, the functionality to automatically restart
components is provided by Oracle Clusterware. Oracle Restart can monitor the health and
automatically restart the following components:
• Database instances
• Oracle Net listener
• Database services
• ASM instance
• ASM disk groups
• Oracle Notification Services (ONS/eONS): Service for sending Fast Application Notification
(FAN) events to integrated clients upon failover. The eONS is used by Oracle Enterprise
Manager to receive notification of change in status of components managed by Oracle Restart.
Restarting an ASM disk group means mounting it. The ability to restart ONS is applicable only in
Oracle Data Guard installations for automatic failover of connections between primary and standby
databases through FAN.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
Oracle Restart.
• To display the Oracle Restart configuration:
$ crsctl config has
l e (m ense
Zi l
Starting Components c Using the SRVCTL Utility
liby
l o
a ce
TherSRVCTL utility can be used to start individual components, along with any dependent
Mcomponents that are necessary. For example, the srvctl start database –d PROD
command may also start the listener, the ASM instance, and multiple disk groups if those
components have been defined as being managed by Oracle Restart and are listed as dependent
components to the PROD database.
The SRVCTL utility can also be used to start all components that are associated with a specified
Oracle home and have been configured for Oracle Restart with the following command:
srvctl start home –o /u01/app/oracle/product/11.2.0/dbhome_1 –s
/usr/local/bin/group_state_file
The state file contains the current state information for the components in the Oracle home and is
created when the srvctl status home command is executed. It is indicated with the state file
option (-s), and must specify the complete path of the state file. The state file can be created in any
directory.
Note: The options shown in the slide represent the most common options and are not a complete list.
You can use the help option (-h) for a complete list of all available options for each command.
l e (m ense
Zi l
Stopping Components licby Using the SRVCTL Utility
l o
a ce
TherSRVCTL utility can be used to stop individual components, along with any dependent
Mcomponents that must be stopped. For example, the srvctl stop diskgroup –g "DATA -f"
command will force an unmount of the diskgroup even if files are open in it. It will also stop all
database instances that depend on the DATA disk group.
The SRVCTL utility can also be used to stop all components that are associated with a specified
Oracle home and have been configured for Oracle Restart with the following command:
srvctl stop home –o /u01/app/oracle/product/11.2.0/dbhome_1 –s
/usr/local/bin/group_state_file -f
This can be very useful when it is necessary to stop all components such as when you need to apply a
patch to the software binaries.
Note: The options shown in the slide represent the most common options and are not a complete list.
You can use the help option (-h) for a complete list of all available options for each command.
Refer to the Oracle Database Administrators Guide for a list of options for each of the above objects.
l e (m ense
Displaying the
l
Zi OracleliRestart
c Configuration for a Component
l o
e use the SRVCTL utility to display the Oracle Restart configuration of a component with the
Yourccan
a
Mconfig command. The config command is valid for the database, service, asm,
listener, ons, and eons components.
The configuration for an Oracle Restart component can be modified with the SRVCTL utility
modify command. The following syntax shows an example of how to modify the database with the
unique name of orcl to use a different, nonstandard directory for the server parameter file
(SPFILE).
srvctl modify database –d orcl –p
/usr/local/oracle/spfileorcl.ora
• Add a database:
a
s ฺ
h a
$ srvctl add database -d orcl omฺ
ar) Guide
ฺ c e n t
-o /u01/app/oracle/acfsmounts/acfs_db11 n
ao Stud
l @
le this
ฺ z i
e loCopyright u e
s2009,
a r c t o © Oracle. All rights reserved.
l e (m ense
Manually Adding l
Zi Components
lic to the Oracle Restart Configuration
l o
a ce
TherSRVCTL utility can be used to manually add components to the Oracle Restart configuration
Mwith the add command. If the component was created with an Oracle utility such as NETCA,
DBCA, ASMCA, or OUI, it would have been automatically added to the Oracle Restart
configuration and it would not be necessary to manually add it.
The slide illustrates manually adding a new listener called MYLISTENER to the Oracle Restart
configuration. The listener will use the software binaries of the Grid home installation, but will
depend on a nonstandard location for the networking files. For this example, it is assumed that the
listener.ora networking file has been created in the /usr/local/oracle directory. The
setenv command of the srvctl utility is used to define environment variables that may be
needed for specific components. The TNS_ADMIN environment variable is set to the nondefault
location of the listener.ora file, and is defined only for the listener named MYLISTENER. This
will not have an impact on any other listeners that may already exist and that use different directories
for the networking files.
The SRVCTL utility includes a remove command to manually delete a component from the Oracle
Restart configuration. To delete the listener created above, use the following syntax:
srvctl remove listener –l mylistener –f
This will also remove the environment variable that was associated with the listener.
You can also use Oracle Enterprise Manager Database Control to add database instances and
listeners to the Oracle Restart configuration.
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Marc
le
oZ
i l l l
m a r c e
e ( icens
e
z i
to
l @
loฺ use
n
le this
ฺ
m
ao Stud
r )
co ent
s
ฺa Gui
ha deฺ
an
on - t r an
s
fe r a bl
e
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ASM Enhancements
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Secondary
Primary
extent
extent
l e (m ense
Without o ASM
l
Zi Fast Mirror
lic Resync
l
ASM
a rceofflines a disk whenever it is unable to complete a write to an extent allocated to the
M disk, while writing at least one mirror copy of the same extent on another disk if the
corresponding disk group uses ASM redundancy.
With Oracle Database 10g, ASM assumes that an offline disk contains only stale data;
therefore, it no longer reads from such disks. Shortly after a disk is put offline, ASM drops it
from the disk group by re-creating the extents allocated to the disk on the remaining disks in
the disk group using redundant extent copies. This process is a relatively costly operation and
can take hours to complete.
If the disk failure is only a transient failure (such as failure of cables, host bus adapters,
controllers, or disk power supply interruptions), you have to add the disk again after the
transient failure is fixed. However, adding the dropped disk back to the disk group incurs the
additional cost of migrating the extents back to the disk.
Secondary
Primary
extent
extent
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
4 Disk again accessible;
ฺ c o3mFailure n t G
need only to resync modified extents on
a t u de time < DISK_REPAIR_TIME
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
ASM Fast
l
Zi Resync:
Mirror lic Overview
l o
ASM
a rcefast mirror resync significantly reduces the time required to resynchronize a transient
Mfailure of a disk. When a disk goes offline following a transient failure, ASM tracks the extents
that are modified during the outage. When the transient failure is repaired, ASM can quickly
resynchronize only the ASM disk extents that have been affected during the outage.
This feature assumes that the content of the affected ASM disks has not been damaged or
modified.
When an ASM disk path fails, the ASM disk is taken offline but not dropped if you have set
the DISK_REPAIR_TIME attribute for the corresponding disk group. The setting for this
attribute determines the duration of disk outage that ASM will tolerate while still being able to
resynchronize after you complete the repair.
Note: The tracking mechanism uses one bit for each modified extent. This ensures that the
tracking mechanism is very efficient.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Manager
Using Enterprise lic to Perform Fast Mirror Resync
l o
rceyou take an ASM disk offline in Oracle Enterprise Manager, you are asked to confirm
When
a
Mthe operation. On the Confirmation page, you can override the default disk repair time.
Similarly, you can view by failure group and choose a particular failure group to take offline.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Manager
Using Enterprise lic to Perform Fast Mirror Resync (continued)
l o
e also bring disks online by using Enterprise Manager.
You
a rccan
M
l e (m ense
Setting Up
l
i FastlicMirror Resync
ZASM
l o
e up this feature on a per disk group basis. You can do so after disk-group creation using
You
a rcset
M the ALTER DISKGROUP command. Use a command similar to the following to enable ASM
fast mirror resync:
ALTER DISKGROUP SET ATTRIBUTE 'DISK_REPAIR_TIME'='2D4H30M'
After you repair the disk, execute the ALTER DISKGROUP ONLINE DISK SQL statement.
This statement brings a repaired disk group back online to enable writes so that no new writes
are missed. This statement also starts a procedure to copy all extents that are marked as stale
on their redundant copies. You cannot apply the ONLINE statement to already-dropped disks.
You can view the current attribute values by querying the V$ASM_ATTRIBUTE view.
You can determine the time left before ASM drops an offlined disk by querying the
REPAIR_TIMER column of either V$ASM_DISK or V$ASM_DISK_IOSTAT. In addition, a
row corresponding to a disk resync operation appears in V$ASM_OPERATION with the
OPERATION column set to SYNC.
DISKGROUP DROP DISKS IN FAILGROUP command with the FORCE option. This ensures
that data originally stored on these disks is reconstructed from redundant copies of the data and
stored on other disks in the same disk group.
Note: The time elapses only when the disk group is mounted. Furthermore, changing the value
of DISK_REPAIR_TIME does not affect disks previously offlined. The default setting of 3.6
hours for DISK_REPAIR_TIME should be adequate for most environments.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
P S
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
ASM Preferred
l
Zi Mirror licRead: Overview
l o
rceyou configure ASM failure groups in Oracle Database 10g, ASM always reads the
When
a
Mprimary copy of a mirrored extent. It may be more efficient for a node to read from a failure
group extent that is closest to the node, even if it is a secondary extent. This is especially true
in extended cluster configurations (when nodes are spread across several sites) where reading
from a local copy of an extent provides improved performance.
With Oracle Database 11g, you can do this by configuring the preferred mirror read using the
new initialization parameter, ASM_PREFERRED_READ_FAILURE_GROUPS, to specify a
list of preferred mirror read names. The disks in those failure groups become the preferred read
disks. Thus, every node can read from its local disks. This results in higher efficiency and
performance, and reduced network traffic. The setting for this parameter is instance specific.
Setup
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
On first instance
ASM_PREFERRED_READ_FAILURE_GROUPS=DATA.SITEA
On second instance
ASM_PREFERRED_READ_FAILURE_GROUPS=DATA.SITEB
ble
Monitor
fe r a
an s
n - t r
SELECT preferred_read FROM v$asm_disk;
a no
h a s ฺ
SELECT * FROM v$asm_disk_iostat;
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
ASM Preferred
l
Zi Mirror licRead: Setup
l o
To
a ce
rconfigure this feature, set the new ASM_PREFERRED_READ_FAILURE_GROUPS
Minitialization parameter. This parameter is a multivalued parameter and should contain a string
with a list of failure group names separated by commas. Each failure group name specified
should be prefixed with its disk group name and a “.” character. This parameter is dynamic
and can be modified using the ALTER SYSTEM command at any time. An example is shown
in the slide. However, this initialization parameter is valid only for ASM instances. With the
extended cluster, the failure groups specified in this parameter should contain only those disks
that are local to the corresponding instance.
The new PREFERRED_READ column has been added to the V$ASM_DISK view. Its format is
a single character. If the disk group to which the disk belongs pertains to a preferred read
failure group, the value of this column is Y.
To identify specific performance issues with the ASM preferred read failure groups, use the
V$ASM_DISK_IOSTAT view. This view displays the disk input/output (I/O) statistics for
each ASM client. If this view is queried from a database instance, only the rows for this
instance are shown.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Enterprise i l
ZManager c Configuration Page
liASM
l o
e specify a set of disks as preferred disks for each ASM instance by using Enterprise
You
a rccan
M Manager. The preferred read attributes are instance specific. In Oracle Database 11g, the
Preferred Read Failure Groups field (ASM_PREFERRED_READ_FAILURE_GROUP) is
added to the configuration page.
This parameter takes effect only before the disk group is mounted or when the disk group is
created. It applies only to newly opened files or to a newly loaded extent map for a file.
P S P S S S S P
Only two failure groups: One for each instance Max four failure groups: Two for each instance
ble
Three sites: High redundancy
fe r a
ans
n - t r
P S S a no
h a s ฺ
ฺ a r) uide
Only three failure groups: One form
ฺ c o eacheinstance
n tG
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
ASM Preferred
l
Zi Mirror licRead: Best Practice
l o
In
a ce there are only a limited number of good disk group configurations in an extended
rpractice,
Mcluster. A good configuration takes into account both performance and availability of a disk
group in an extended cluster. Here are some possible examples:
For a two-site extended cluster, a normal redundancy disk group should have only two failure
groups; all disks local to one site should belong to the same failure group. Also, no more than
one failure group should be specified as a preferred read failure group by each instance. If
there are more than two failure groups, ASM may not mirror a virtual extent across both sites.
Furthermore, if the site with more than two failure groups were to go down, it would take the
disk group down as well. If the disk group to be created is a high-redundancy disk group, at
most two failure groups should be created on each site with its local disks, with both local
failure groups specified as preferred read failure groups for the local instance.
For a three-site extended cluster, a high redundancy disk group with three failure groups
should be used. In this way, ASM can guarantee that each virtual extent has a mirror copy
local to each site and that the disk group is protected against a catastrophic disaster on any of
the three sites.
You can set up the ASM fast mirror resync feature on a per
disk group basis.
1. True
2. False
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Answer:o 1 Zi
l lic
l
a rce
M
Nevertheless, this should happen only very rarely because ASM also automatically performs
defragmentation during extents allocation if the desired size is unavailable. This can
potentially make some allocation operations longer.
Note: This feature also enables much faster file opens because of the significant reduction in
the amount of memory that is required to store file extents.
bl e
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Manager
Using Enterprise lic to Manage ASM Users
l o
rceEnterprise Manager 11g enables you to manage the users who access the ASM instance
Oracle
a
Mthrough a remote connection (using password file authentication). These users are used
exclusively for the ASM instance.
However, you have this functionality only when connected as the SYSASM user. It is hidden if
you connect as the SYSDBA or SYSOPER user.
When you click the Create button, the Create User page is displayed.
When you click the Edit button, the Edit User page is displayed.
By clicking the Delete button, you can delete the created users.
Note: In Oracle Database 11g the SYSASM role is added to the ASM instance login page.
must always be greater than or equal to the RDBMS compatibility level of the same disk
group. ASM compatibility is concerned only with the format of the ASM metadata. The
format of the file contents is determined by the database instance. For example, the ASM
compatibility of a disk group can be set to 11.0 while its RDBMS compatibility could be
10.1. This implies that the disk group can be managed only by ASM software whose
software version is 11.0 or higher, while any database client whose software version is
higher than or equal to 10.1 can use that disk group.
• ADVM compatibility determines whether the disk group can contain Oracle ASM rab
le
volumes. The value must be set to 11.2 or higher. Before setting this attribute, n s fe
the
COMPATIBLE.ASM value must be 11.2 or higher. Also, the Oracle ADVM
n - tra volume
drivers must be loaded. By default, the value of the COMPATIBLE.ADVM
a no attribute is
empty until set.
h a s ฺ
The compatibility of a disk group needs to be advancedฺa r) when
only
e is a change to either
idthere
u
persistent disk structures or protocol messaging.ฺc om enadvancing
However, t G disk group compatibility
is an irreversible operation. If you advanceathe ondisktgroup
ud compatibility settings, you cannot
change the values back to the previous @
le settings. S
isTo revert to the previous values, you must
z i l t h
create a new disk group withlthe
e oฺ olducompatibility
se attribute settings and then restore the
database files that were a c
rin the disktogroup to the new disk group.
You can set the l e m
( group
disk e n se
compatibility by using either the CREATE DISKGROUP command
or the ALTERZ i l l i c
e l o DISKGROUP command.
arc In addition to disk group compatibilities, the COMPATIBLE parameter (database
MNote:
compatible version) determines the features that are enabled. It applies to the database or ASM
instance depending on the INSTANCE_TYPE parameter. For example, setting it to 10.1 would
preclude use of any new features that are introduced in Oracle Database 11g (disk
online/offline, variable extents, and so on).
m ฺa attribute
G
template.tname.
stripe
A COARSE|FINE
n ฺ co ent Striping
@ ao Stud A: ALTER
l l e i s
ฺzi se th
C: CREATE
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
ASM Disk
l
Zi Attributes
Group lic
l o
rceyou create or alter an ASM disk group, you can change its attributes by using the new
When
a
M ATTRIBUTE clause of the CREATE DISKGROUP or ALTER DISKGROUP commands.
These attributes are briefly summarized in the table in the slide:
• ASM enables the use of different AU sizes that you specify when you create a disk group.
The AU size can be 1 MB, 2 MB, 4 MB, 8 MB, 16 MB, 32 MB, or 64 MB.
• RDBMS compatibility: See the section titled “ASM Disk Group Compatibility” for more
information.
• ASM compatibility: See the section titled “ASM Disk Group Compatibility” for more
information.
• You can specify the DISK_REPAIR_TIME in units of minutes (M), hours (H), or
days (D).
If you omit the unit, the default is H. If you omit this attribute, the default is 3.6H. You
can override this attribute with an ALTER DISKGROUP statement.
• You can specify the redundancy attribute of the specified template.
• You can specify the striping attribute of the specified template.
For a complete reference all attributes, look at the Oracle Database SQL Language Reference.
Note: For each defined disk group, you can look at all the defined attributes by using the
V$ASM_ATTRIBUTE fixed view.
Oracle Database 11g: New Features for Administrators 4 - 21
Using Enterprise Manager to
Edit Disk Group Attributes
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Manager
Using Enterprise lic to Edit Disk Group Attributes
l o
rce Manager provides a simple way to store and retrieve environment settings related to
Enterprise
a
Mdisk groups.
You can now set the compatible attributes from both the Create Disk Group page and the Edit
Advanced Attributes for Disk Group page. The DISK_REPAIR_TIME attribute is added to
only the Edit Advanced Attributes for Disk Group page.
Note: For 11g ASM instances, the default ASM compatibility is 11.2.0.0.0 and the default
RDBMS compatibility is 10.1.0.0.0.
l e (m ense
Restricted Z l
i Disk
Mount lic Group for Fast Rebalance
l o
rcemount mode to mount a disk group in Oracle Database 11g is called RESTRICTED.
Aanew
M When a disk group is mounted in RESTRICTED mode, clients cannot access the files in a disk
group. When an ASM instance knows that there are no clients, the instance improves the
performance of the rebalance operation by not attempting to message clients for
locking/unlocking extent maps.
A disk group mounted in RESTRICTED mode is mounted exclusively on only one node;
clients of ASM on that node cannot use that disk group.
The RESTRICTED mode allows you to perform all maintenance tasks on a disk group in the
ASM instance without external interaction.
At the end of the maintenance cycle, you must explicitly dismount the disk group and remount
it in normal mode.
The ALTER DISKROUP diskgroupname MOUNT command is extended to enable ASM to
mount the disk group in RESTRICTED mode. An example is shown in the slide.
When you use the RESTRICTED option to start up an ASM instance, all disk groups defined
in the ASM_DISKGROUPS parameter are mounted in RESTRICTED mode.
bl e
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Forcing Disk
l
Zi GroupliDrop
c
l o
a rceDISKGROUP FORCE marks the headers of disks belonging to a disk group that cannot
DROP
Mbe mounted by the ASM instance as FORMER. However, the ASM instance first determines
whether the disk group is being used by any other ASM instance using the same storage
subsystem. If it is being used, and if the disk group is in the same cluster or on the same node,
the statement fails.
If the disk group is in a different cluster, the system checks further to determine whether the
disk group is mounted by an instance in the other cluster. If the disk group is mounted
elsewhere, the statement fails. However, this latter check is not as definitive as the checks for
disk groups in the same cluster. You should therefore use this clause with caution.
Note: When executing the DROP DISKGROUP command with the FORCE option, you must
also specify the INCLUDING CONTENTS clause.
User-created directories
Templates
Disk group compatibility md_backup
Disk group name full
Disk names and failure groups
between Little-Endian and Big-Endian systems. You can also use the cp command to copy an
ASM file to your operating system. For example:
cp +DATA/ORCL/DATAFILE/TBSJFV.256.629730771 /home/oracle/tbsjfv.dbf
Similarly, you can use the cp command to copy a file from your operating system to an ASM
directory. For example:
cp /home/oracle/tbsjfv.dbf +data/jfv
If you want to copy an ASM file from your local ASM instance to a remote ASM instance, you
e
could use the following syntax: abl
fer
cp +DATA/orcl/datafile/tbsjfv.256.629989893
a n s
\sys@edcdr12p1.+ASM2:+D2/jfv/tbsjfv.dbf
o n -tr
n see the Oracle
Note: For more information about the syntax for each of these commands,
a
Database Storage Administrator’s Guide.
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce to u
l e (m ense
Zi l lic
l o
a rce
M
ASM ACLs
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
ASM ACLs Zi l lic
l o
ASM
a rceACLs provide optional protection for ASM files. The objective of the ASM access
Mcontrol list is not security, but separation of duties to prevent accidental file damage. Without
ACLs, any user with the SYSDBA privilege may access ASM files in the mounted disk group,
including removing them.
To set up Oracle ASM File Access Control, you must create separate operating system groups
for the OSASM, OSDBA for ASM, and OSDBA for database groups. The OSDBA group for the
database must be different for each database instance using the same ASM instance.
Each ASM file is created by a DBUSER. This DBUSER is usually an owner of a database
instance. The ASM files created for that database are owned by that DBUSER. The OS user ID
of the database software owner identifies the DBUSER to the ASM instance. Access is limited
by the OS effective user ID NUMBER of the DBUSER. The operating system user of a
running database instance is automatically added to a disk group when the database instance
accesses that disk group and creates files.
Each DBUSER can create access control lists.
The ASM ACL includes a user group, a list of DBUSERS, but not any passwords. ASM trusts
the OS authentication mechanisms. A DBUSER is a member of the OSDBA group for ASM.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e l oZ l
M arc
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Managing
l
Zi ACLs
ASM licby Using Enterprise Manager
l o
e access control lists can be viewed and managed through Enterprise Manager. This
The
a rcASM
M slide shows the attributes and permissions associated with each file.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Managing
l
Zi ACLs
ASM licby Using Enterprise Manager (continued)
l o
On
a rctheeEdit File page, permissions and ownership of the ASM file can be modified. The
M ownership and permissions cannot be changed in an open file.
JBOD Inner
Greater throughput disks Lesser throughput
tracks
tracks
mark files
ASM files
DBA
HOT COLD
ble
COMPATIBLE.ASM>=11.2
fe r a
s
COMPATIBLE.RDBMS>=11.2
an
n - t r
ASM Disk Group ASM Disk Group
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
ASM without IDP a on tud ASM with IDP
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi DatalicPlacement
ASM Intelligent
l o
In
a ce releases, ASM attempted to optimize ASM files placement only across ASM disks
rearlier
Musing striping techniques, treating one ASM disk as one uniform object. However, physical
disk regions furthest from the disk spindle, also called outer tracks, have greater throughput
than inner tracks. So, with ASM Intelligent Data Placement (IDP), not only ASM stripes files
across disks, but it also makes sure that manually marked files are placed in corresponding
physical disk regions as shown in the graphic in the slide. That is, ASM allocates extents for a
file based on that file’s preferred region: HOT or COLD. Because ASM does not know
anything about physical disk characteristics, IDP is targeted at spanning disk architectures and
not high-end storage arrays. The two disk regions, HOT and COLD, are artificially identified
each time a new disk group is created or a disk is added to an existing disk group. Using these
settings, you can ensure that frequently accessed data is placed on the outermost tracks which
have higher bandwidth, and the collocation of such data reduces seek latency. This is
especially relevant for applications using a small working set in a large amount of data.
The COMPATIBLE.ASM and COMPATIBLE.RDBMS disk group attributes must be set to 11.2
or higher to use Intelligent Data Placement.
Note: A disk region is a set of contiguous tracks having similar performance characteristics.
Outer tracks are longer and, therefore, contain more sectors than inner tracks. Because the
rotational speed is constant, the number of sectors that can be read is greater for outer tracks.
Oracle Database 11g: New Features for Administrators 4 - 40
11.2
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Managing
l
Zi Intelligent
ASM lic Data Placement
l o
rceASM Configuration Assistant (ASMCA) supports Intelligent Data Placement with
Oracle
a
M template creation during disk group alterations.
On the Configure ASM Disk Groups tab, right-click a selected disk group to display the
configuration options menu. Select Manage Templates.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Managing
l
Zi Intelligent
ASM lic Data Placement (continued)
l o
e manage disk group templates with the Templates tab of the Disk Group page.
You
a rccan
M 1. Access the Oracle Automatic Storage Management Home page.
2. Click the Disk Groups link to display the Disk Groups property page.
3. Click a link in the Name column to select a disk group.
4. Click the Templates tab to display the Templates page.
5. Click Create to add a new template or click Edit to change a template. You can specify
extent regions (hot or cold).
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Marc
le
oZ
i l l l
m a r c e
e ( icens
e
z i
to
l @
loฺ use
n
le this
ฺ
m
ao Stud
r )
co ent
s
ฺa Gui
ha deฺ
an
on - t r an
s
fe r a bl
e
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Storage Enhancements
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Emulation mode:
LBA0 LBA1 LBA2 LBA3 LBA4 LBA5 LBA6 LBA7
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Supporting 4 ZKBl
i Sector lic Disks
l o
rcea primary storage medium for databases, currently have predominantly a physical sector–size
Disks,
a
Mof 512 bytes. Larger, 4 KB sector disks are beginning to appear on the market offering higher storage
capacity with a lower overhead. Oracle Database servers access the hard disk via a platform specific
device driver. The database writer, log writer, and ASM processes can write directly to the disk
without going through the operating system (OS).
Oracle Database 11g Release 2 detects the disk sector size and uses the high-capacity disks without
performance degradation.
As illustrated in the slide, 4 KB sector disks have physical sectors (shown in gray) and logical sectors
(shown in blue). There are two types of 4 KB sector disks: emulation mode and native mode, also
shown in the slide.
• 4 KB sector disks in emulation mode have eight logical sectors per one physical sector as shown
in the slide. They maintain a 512-byte interface to their 4 KB physical sectors; that is, the logical
block address (LBA) references 512 bytes on disk. You will incur a significant performance
degradation in emulation mode when a redo log write is not aligned with the beginning of the 4
KB physical sector.
• 4 KB sector disks in native mode have one logical sector per physical sector as shown in the
slide. So, there is only the 4 KB interface. In other words, the LBA references 4096 bytes on
disk.
l e (m ense
l
Zi Disks
Using 4 KB Sector lic
l o
rce Database 11g Release 2, 4 KB sector disks mainly affect the redo log files. This includes
In Oracle
a
Monline redo logs, standby redo logs, and archived redo logs. Oracle recommends that you create 4 KB
block size logs on 4 KB emulation mode disks. On 4 KB native mode disks, you must create 4 KB
block size logs.
In other words, the redo block size must match the physical disk sector size (for 512-byte and for 4
KB native-mode disks). Otherwise, you receive the ORA-1378 error. For 4 KB emulation-mode
disks, the redo block size could be 512 or 4096 bytes. 4 KB is the preferred block size. When you are
creating 512-byte blocks on a 4 KB emulation disk, a warning is written to the alert log to indicate
that the mismatched block size leads to degraded performance. This also applies to ASM disk groups.
The 4 KB sector disks also affect the Oracle Database data file. The Oracle Database server allows
you to create 2 KB block size data files on 512 byte sector disks. With 4 KB sector disks, Oracle
recommends that you create 4 KB (or larger) block size data files on the 4 KB emulation-mode disks.
On 4 KB native-mode disks, you must create 4 KB block (or larger) size logs.
The control file block size is already 16 KB. Therefore, the 4 KB sector disks do not affect the
control file.
Specify the sector size for disk drives with the new
SECTOR_SIZE and BLOCKSIZE clauses of the following
commands:
• CREATE DISKGROUP
• ALTER DATABASE
• CREATE DATABASE e
r a bl
• CREATE CONTROL FILE s fe
- t r an
n no
a
s ฺ
h a
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Specifying the
l
Zi Disk Sector
lic Size
e l o
a rcAutomatic
In an Storage Management (ASM) environment, you can set the SECTOR_SIZE attribute
Mfor disk groups. This attribute can be set only at disk group creation time by using the CREATE
DISKGROUP command.
You can specify the size of the log file with the new BLOCKSIZE clause for the following
commands:
• ALTER DATABASE
• CREATE DATABASE
• CREATE CONTROL FILE
• No extra work
• No GUI change
• Default sector size based on hardware (not the earlier 512
bytes sectors)
Specifying BLOCKSIZE
('$ORACLE_BASE/oradata/sample/redo03a.log',
'$ORACLE_BASE/oradata/sample/redo03b.log')
SIZE 500K BLOCKSIZE 4096;
l e (m ense
Zi l
Specifying BLOCKSIZE lic
l o
rceBLOCKSIZE to override the operating system–dependent sector size. The example in the
Specify
a
Mslide shows the ALTER DATABASE and the CREATE CONTROLFILE commands.
• When you add a redo log file to a 512-byte sector disk or to a 4 KB native disk, the block size of
the new file must be the original platform base block size.
• When you add a redo log file to a 4 KB sector disk with 512-byte emulation, then you can
specify either 512, 1024 (or 1K), or 4096 (or 4K) as the block size, depending on your platform.
All logs within a log group must have the same block size. Two log groups created on separate disks
can have different block sizes. However, the mixed configuration introduces overhead at every log
switch. Oracle recommends that you create all log files with the same block size.
This clause is useful when the 4 KB sector size is in use, and you want to optimize disk space use
rather than performance. In such a case, you can override the operating system sector size by
specifying BLOCKSIZE 512 or, for HP-UX, BLOCKSIZE 1024.
Reminder: Use the CREATE CONTROLFILE command very carefully. Oracle recommends that
you perform a full backup of all files in the database before using this command. For more
information, see Oracle Database Backup and Recovery User's Guide.
3 4096 0 UNUSED
4 4096 0 UNUSED
a r logs. to
2. Drop all 512 block
l e m size
se
(alteredatabase
n
i
SQL>
Z l l i caltered. drop logfile group 1;
elo SQL> alter database drop logfile group 2;
Database
a r c
M Database altered.
3. Query the V$LOG view to ensure that there are only 4 KB block size logs available for your
database.
SQL> SELECT group#, blocksize, sequence#, status FROM v$log;
GROUP# BLOCKSIZE SEQUENCE# STATUS
---------- ---------- ---------- ----------------
3 4096 3 INACTIVE
4 4096 4 CURRENT
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Answer: 1 Zi
l lic
l o
a rce
M
Compressed
data
PCTFREE reached
triggers compression.
Uncompressed
bl e
data
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Viewing Table
l
Zi Compression
lic Information
l o
a ce
Ther*_TABLES views have the COMPRESSION and COMPRESS_FOR columns which enable you
Mto view compression information.
What
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
partitions, indexes,
and MVs do I need SQL
to optimize Solution Access
my entire Advisor
workload?
ble
fe r a
DBA ans
n - t r
No expertise
a no Component
Workload required
h a s ฺ of CBO
ฺ a r)Provides
u ide
ฺ c om eimplementation
n tG
a on tud script
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
i l
SQL AccessZAdvisor: c
liOverview
l o
rce appropriate access structures to optimize SQL queries has always been a concern for
Defining
a
Man Oracle DBA. As a result, there have been many papers and scripts written as well as high-end
tools developed to address the matter. In addition, with the development of partitioning and
materialized view technology, deciding on access structures has become even more complex.
As part of the manageability improvements in Oracle Database 10g and 11g, SQL Access Advisor
has been introduced to address this very critical need.
SQL Access Advisor identifies and helps resolve performance problems relating to the execution of
SQL statements by recommending which indexes, materialized views, materialized view logs, or
partitions to create, drop, or retain. It can be run from Database Control or from the command line by
using PL/SQL procedures.
SQL Access Advisor takes an actual workload as input, or the Advisor can derive a hypothetical
workload from the schema. It then recommends the access structures for faster execution path. It
provides the following advantages:
• Does not require you to have expert knowledge
• Bases decision making on rules that actually reside in the cost-based optimizer
• Is synchronized with the optimizer and Oracle database enhancements
• Is a single advisor covering all aspects of SQL access methods
• Provides simple, user-friendly GUI wizards
• Generates scripts for implementation of recommendations
Oracle Database 11g: New Features for Administrators 5 - 20
SQL Access Advisor: Usage Model
SQL Access
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Advisor
SQL cache
Workload
Hypothetical
STS e
Filter r a bl
s fe
Options
- t r an
n no
a
s ฺ
h a
ฺ a r) uide
ฺ c om ent G
Indexes on Materialized d Materialized Partitioned
a
@ is S views t u views log objects
i l l e h
e l oฺz use t
a rc Copyright
t o © 2009, Oracle. All rights reserved.
l e (m ense
i l
SQL AccessZAdvisor: c
liUsage Model
l o
e Advisor takes as input a workload that can be derived from multiple sources:
SQLrcAccess
a
M • SQL cache, to take the current content of V$SQL
• Hypothetical, to generate a likely workload from your dimensional model. This option is
interesting when your system is being initially designed.
• SQL Tuning Sets, from the workload repository
SQL Access Advisor also provides powerful workload filters that you can use to target the tuning.
For example, a user can specify that the advisor should look at only the 30 most resource-intensive
statements in the workload, based on optimizer cost. For the given workload, the advisor then does
the following:
• Simultaneously considers index solutions, materialized view solutions, partition solutions, or
combinations of all three
• Considers storage for creation and maintenance costs
• Does not generate drop recommendations for partial workloads
• Optimizes materialized views for maximum query rewrite usage and fast refresh
• Recommends materialized view logs for fast refresh
• Recommends partitioning for tables, indexes, and materialized views
• Combines similar indexes into a single index
• Generates recommendations that support multiple workload queries
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
Possible Recommendations lic
l o
e Advisor carefully considers the overall impact of recommendations and makes
SQLrcAccess
a
Mrecommendations by using only the known workload and supplied information. Two workload
analysis methods are available:
• Comprehensive: With this approach, SQL Access Advisor addresses all aspects of tuning
partitions, materialized views, indexes, and materialized view logs. It assumes that the workload
contains a complete and representative set of application SQL statements.
• Limited: Unlike the comprehensive workload approach, a limited workload approach assumes
that the workload contains only problematic SQL statements. Thus, advice is sought for
improving the performance of a portion of an application environment.
When comprehensive workload analysis is chosen, SQL Access Advisor forms a better set of global
tuning adjustments, but the effect may be a longer analysis time. As shown in the table, the chosen
workload approach determines the type of recommendations made by the advisor.
Note: Partition recommendations can work on only those tables that have at least 10,000 rows, and
workloads that have some predicates and joins on columns of NUMBER or DATE type. Partitioning
advice can be generated only on these types of columns. In addition, partitioning advice can be
generated only for single-column interval and hash partitions. Interval partitioning recommendations
can be output as range syntax but interval is the default. Hash partitioning is done to leverage only
partitionwise joins.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Advisor
Using SQL Access lic
l o
e access the SQL Access Advisor wizard through the Advisor Central link on the Database
Yourc
can
a
MHome page or through individual alerts or performance pages that may include a link to facilitate
solving a performance problem. The SQL Access Advisor wizard consists of several steps during
which you supply the SQL statements to tune and the types of access methods you want to use.
Use the SQL Access Advisor: Initial Options page to select a template or task from which to populate
default options before starting the wizard. You can click Continue to start the wizard or Cancel to
go back to the Advisor Central page.
Note: The SQL Access Advisor may be interrupted while generating recommendations, thereby
allowing the results to be reviewed.
For general information about using SQL Access Advisor, see the “Overview of the SQL Access
Advisor” section in the “SQL Access Advisor” chapter of the Oracle Data Warehousing Guide.
Step 3
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ADD_STS_REF
Step 1
DELETE_STS_REF
CREATE_TASK EXECUTE_TASK
UPDATE_TASK_ATTRIBUTES INTERRUPT/CANCEL_TASK
DELETE_TASK MARK_RECOMMENDATION
QUICK_TUNE UPDATE_REC_ATTRIBUTES
GET_TASK_REPORT
Task-dependent GET_TASK_SCRIPT ble
fe r a
SQL
ans
Advisor-dependent
Access Advisor
task n - t r
a no
h a s ฺ
Report/Scripts
SET_TASK_PARAMETER ฺ a r) uide
RESET_TASK
ฺ c om ent G
a on tud
Step 2
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
i l
SQL AccessZAdvisor: c
liPL/SQL Procedure Flow
l o
ce shows the typical operational flow of the SQL Access Advisor procedures from the
Thergraphic
a
MDBMS_ADVISOR package. You can find a complete description of each of these procedures in the
Oracle Database PL/SQL Packages and Types Reference guide.
• Step 1: Create and manage tasks and data. This step uses a SQL Access Advisor task.
• Step 2: Prepare tasks for various operations. This step uses SQL Access Advisor parameters.
• Step 3: Prepare and analyze data. This step uses SQL Tuning Sets and SQL Access Advisor
tasks. With Oracle Database 11g, GET_TASK_REPORT can report back using HTML or XML
in addition to text.
Note: The DBMS_ADVISOR.QUICK_TUNE procedure is a shortcut that performs all the necessary
operations to analyze a single SQL statement. The operation creates a task for which all parameters
are defaulted. The workload is constituted by the specified statement only. Finally, the task is
executed and the results are saved in the repository. You can also instruct the procedure to implement
the final recommendations.
1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
BEGIN
dbms_advisor.create_task(dbms_advisor.sqlaccess_advisor,'MYTASK');
END;
BEGIN
dbms_advisor.set_task_parameter('MYTASK','ANALYSIS_SCOPE','ALL');
2
dbms_advisor.set_task_parameter('MYTASK','MODE','COMPREHENSIVE');
END;
bl e
BEGIN 3fe r a
dbms_advisor.add_sts_ref('MYTASK','SH','MYSTS');
a n s
dbms_advisor.execute_task('MYTASK');
o n -tr
dbms_output.put_line(dbms_advisor.get_task_script('MYTASK'));
s an
ha deฺ
END;
r
ฺa Gui)
co entm
n ฺ
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l
SQL AccessZAdvisor: c
liPL/SQL Example
l o
rce the order shown in the previous slide, the examples in this slide show you a possible SQL
Matching
a
MAccess Advisor tuning session using PL/SQL code.
The first PL/SQL block creates a new tuning task called MYTASK. This task uses the SQL Access
Advisor.
The second PL/SQL block sets SQL Access Advisor parameters for MYTASK. In the example, you
set ANALYSIS_SCOPE to ALL, which means you generate recommendations for indexes,
materialized views, and partitions. Then, you set MODE to COMPREHENSIVE to include all SQL
statements that are part of the SQL Tuning Set associated to a future task.
The third PL/SQL block associates a workload to MYTASK. Here, you use an existing SQL Tuning
Set called MYSTS. You can now execute the tuning task. After its execution completes, you can
generate corresponding recommendation scripts as shown in the third example in the slide.
Note: For a complete list of SQL Access Advisor parameters (around 50), refer to the Oracle
Database PL/SQL Packages and Types Reference guide.
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
DBA_TEMP_FREE_SPACE lic
e l o
Thisrc
dictionary view reports temporary space usage information at the tablespace level. The
a
Minformation is derived from various existing views.
bl e
fe r a
t r a ns
CREATE TABLE INSERTon -
INTO
s an
• Save disk space
r ) ha deฺ
• Improve installationm ฺa Gui
time
of applications n ฺ co ent
with
@
large schemas
ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Segment Creation
l
Zi onliDemand
c
l o
rceDatabase 11g Release 2 includes a new space allocation method. When you create a
Oracle
a
Mnonpartitioned heap table, the table segment creation is deferred to the first row insert. This
functionality is enabled by default with the DEFERRED_SEGMENT_CREATION initialization
parameter set to TRUE.
Advantages of this new space allocation method:
• A significant amount of disk space can be saved for applications that create hundreds or
thousands of tables upon installation, many of which might never be populated.
• The application installation time is reduced.
When you insert the first row into the table, the segments are created for the base table, its LOB
columns, and its indexes. During segment creation, cursors on the table are invalidated. These
operations have a small additional impact on performance.
Note: With this new allocation method, it is essential that you do proper capacity planning so that the
database has enough disk space to handle segment creation when tables are populated. For more
details, see the Oracle Database Administrator's Guide.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
New feature:
Preprocessing
of files for
external tables
enables
Enabling feature: ble
EXECUTE fe r a
privilege for ans
n - t r
directory objects
External
a no
files
h a s ฺExternal
ฺ a r) uide tables
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Preprocessing l
Zi Data forlicORACLE_LOADER Access Driver in External Tables
l o
rce Database 11g Release 2, the syntax for the ORACLE_LOADER access driver has been
In Oracle
a
Mextended to allow specification of a program to preprocess the data files that are read for the external
table. (An access driver is the actual mechanism used to read the external data in the table. The
ORACLE_LOADER access driver is the one affected by this new feature.)
To enable this new feature, another new feature is introduced in Oracle Database 11g Release 2. The
EXECUTE privilege has been added for DIRECTORY objects. The ORACLE_LOADER access driver
will create a process that runs a user-specified program. That program must live in a directory path
specified by a directory object defined in the database. Only a user that has been given the EXECUTE
access to the directory object will be allowed to run programs in it.
The access parameters can specify the name of a directory object and the name of an executable file
in that directory object.
When the access driver needs to read data from a file, it will create a process that executes the
specified program, passing in the name of the data file.
The output from the program will be passed into the access driver which parses the data into records
and columns.
The user will specify the name of the program used to decompress the file as part of the access
parameters. The access driver reads the output of the decompression program.
Windows Example
[C:\TEMP]type C:\DATA/input.dat
hello world
[C:\TEMP]type C:\TEMP/bar.bat
Windows uses a batch file
@cat %1 | tr hw HW rather than shell script to
SQL> @ex1
SQL> connect /as sysdba preprocess the data.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Connected.
SQL> create or replace directory def_dir1 as 'C:\DATA’;
Directory created.
SQL> create or replace directory execdir as 'C:\TEMP’ ;
Directory created.
SQL> grant read, write on directory def_dir1 to scott;
Grant succeeded.
SQL> grant read, write, execute on directory execdir to scott;
Grant succeeded.
SQL> connect scott/tiger
Connected.
SQL> drop table ex1;
Table dropped.
SQL> create table ex1 (recno varchar2(2000))
2 organization external (
ble
3
4
type ORACLE_LOADER
default directory def_dir1
fe r a
5
6
access parameters (
debug = 3
ans
7
8
records delimited by newline
preprocessor execdir:'bar.bat' Preprocessor n - t r
9
10
fields (
col1 char(2000)
a no
11
12
))
location ('input.dat'))
h a s ฺ
13 reject limit unlimited;
Table created.
ฺ a r) uide
om ent G
SQL> select * from ex1;
ฺ c
on tud
COL1
Hello World a
----------------------------------------------------------------
@ is S
SQL>
i l l e
l o ฺz se th
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi
Windows Example
l lic
l o
rceWindows example, the table to be loaded has a single VARCHAR2 column. The batch file will
In this
a
Mconvert the string hello world (the contents of the input data) to Hello World.
Windows uses a batch file rather than shell script to preprocess the data. Secondly, note the “@”
character used in the batch file. This will prevent the preprocessing command from echoing what
would then be considered input data. Lastly, note that Windows batch files use the “%” character
rather than the UNIX style “$” to provide access to arguments.
Example of Preprocessing
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
Security Implications
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e l oZ l
M arc
l e (m ense
i l lic
Securing theZORACLE_LOADER Access Driver
l o
e take some precautions when allowing preprocessors to be used with external tables
Yourc
should
a
Mbecause you may not know what the preprocessor is doing.
Follow these guidelines to secure the ORACLE_LOADER access driver. These guidelines are detailed
in Oracle Database Security Guide 11g Release 2.
Database Vault.
• Output must go to standard out.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Considerations
l
Zi and Usage
lic Notes
l o
a ce
TherPREPROCESSOR clause is not available for databases that use Oracle Database Vault.
MThe preprocessor uses the output from standard out (stdout) for the external table. Any script or
binary executable used as a preprocessor command must ensure that the desired output goes to
standard out (as opposed to standard error).
l e (m ense
Review: Degree
l
Zi of Parallelism
lic
l o
ce of parallel execution servers associated with a single operation is known as the degree of
Thernumber
a
Mparallelism. Note that the degree of parallelism applies directly only to intraoperation parallelism. If
interoperation parallelism is possible, the total number of parallel execution servers for a statement
can be twice the specified degree of parallelism. No more than two sets of parallel execution servers
can execute simultaneously. Each set of parallel execution servers may process multiple operations.
Only two sets of parallel execution servers need to be active to guarantee optimal interoperation
parallelism. Oracle Database provides several ways to manage resource utilization in conjunction
with parallel execution environments, including:
• The adaptive multiuser algorithm, which is enabled by default, and which reduces the degree of
parallelism as the load on the system increases
• User resource limits and profiles, which allow you to set limits on the amount of various system
resources available to each user as part of a user’s security domain
• The Database Resource Manager, which enables you to allocate resources to groups of users
Partition granules are used in limited situations such as:
• Parallel DML accessing more than one table partition and where a local partitioned bitmap index
exists. (By definition, the local index has only one index partition per table partition and the first
case is ambiguous because it may be interpreted as saying that the local bitmap index accesses
more than one partition.)
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
1 DOP determination
Generate a serial plan.
Serial cost plan
ฺ c om ent G
Use serial plan.
a on tud Use parallel plan.
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Automatic Degree
l
Zi OflParallelism
ic Determination
l o
e illustrates the high-level design of the automatic DOP determination. Basically, for a
Thisrc
diagram
a
Mpotentially parallel statement, two complete compilation passes are done. One purely serial pass is
used to evaluate the cost of the statement and to compute the DOP of each operation if they had to be
executed in parallel. The second pass uses this DOP to compute the parallel plan. These two plans
are then compared to decide which one is the most efficient (has the best response time).
In automatic degree of parallelism, a serial plan is first compiled (step 1). During the serial plan
compilation, the cost, in terms of estimated execution elapsed time, of the serial plan is obtained.
Also, the best DOP for the statement is computed within 2 and the degree limit set by the parameter
PARALLEL_DEGREE_LIMIT.
If the serial elapsed time is found to be smaller than the threshold (step 2), determined by the
parameter PARALLEL_MIN_TIME_THRESHOLD, the statement will be executed in serial
immediately.
If the serial elapsed time is found to be greater than the threshold (step 2), a parallel plan will be
compiled with the DOP computed (step 3).
The parallel plan cost, in terms of estimated execution elapsed time, is obtained and is compared
with the serial plan estimated elapsed time. If the parallel elapsed time is considered beneficial over
the serial elapsed time (step 4), the statement will be executed in parallel with the computed DOP.
Otherwise, the statement will be executed in serial.
Oracle Database 11g: New Features for Administrators 6 - 18
11.2
l e (m ense
Zi l lic
Using PARALLEL_MIN_TIME_THRESHOLD
l o
e concept related to simplified parallelism is minimum threshold for parallelism. Even if a
Onerc
new
a
MSQL statement is deemed a candidate for automatic determination of parallelism, does the parallel
overhead justify the cost of this SQL going parallel?
The PARALLEL_MIN_TIME_THRESHOLD parameter limits parallelism to only SQL statements for
which it is worth the effort. Any SQL that has the computed elapsed time below this threshold will
execute in serial.
This new parameter indicates the threshold (expressed in seconds) that limits the scope of automatic
parallel execution. Only if the estimated serial execution elapsed time of a statement is greater than
the threshold, will the statement be a candidate for automatic parallel execution. It accepts any
numerical value greater than 0 or a keyword AUTO. When it is set to AUTO, the threshold is
computed by the system.
Note: PARALLEL_MIN_PERCENT works as in past releases if the estimated elapsed time exceeds
PARALLEL_MIN_TIME_THRESHOLD.
Using PARALLEL_DEGREE_POLICY
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
e l oฺz use t
a rc Copyright
t o © 2009, Oracle. All rights reserved.
l e (m ense
Zi l lic
Using PARALLEL_DEGREE_POLICY
l o
rce Mode: MANUAL mode exists for backward compatibility. In this mode, it is the
MANUAL
a
Mresponsibility of a DBA to specify the degree of parallelism with object properties name value pairs,
if a statement is to be executed in parallel. Statements touching objects with parallel properties name
value pairs are executed with a DOP derived directly from the properties name value pairs.
This mode is enabled when PARALLEL_DEGREE_POLICY is set to MANUAL. MANUAL mode is the
default mode.
LIMITED Mode: The degree of parallelism is derived from the elapsed time of the most costly
operation during the first serial compilation. To derive the DOP, the optimizer uses a unit of work
that can be performed by a slave. This unit is expressed in seconds. (The default is 10s and is
controlled by an underscore parameter.)
To have access to another slave, an operation needs to require at least that unit of work above the
threshold. As an example, if the unit is 10s, the threshold is also 10s and the estimated elapsed time
of the operation is 43s, the ideal degree of parallelism will be 4.
The optimizer still uses response time to compute the best parallel plan. The DOP is derived from the
expected response time of a single operation. The unit of work that a slave should have to efficiently
cover for its cost is the quotient used to derive the DOP.
DOP = ElapsedTime(operation)/ parallel_time_unit.
This mode is enabled when the PARALLEL_DEGREE_POLICY parameter is set to LIMITED.
Oracle Database 11g: New Features for Administrators 6 - 21
Using PARALLEL_DEGREE_POLICY (continued)
Note: Under MANUAL mode, PARALLEL_MIN_TIME_THRESHOLD,
PARALLEL_DEGREE_LIMIT, and PARALLEL_FORCE_LOCAL do not have any effect on the
compilation or execution of a statement, unless hint is specified in the statement.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e l oZ l
M arc
Using PARALLEL_DEGREE_LIMIT
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
CPU scan
fe r a
CPU scan
ans
CPU scan
n - t r
Maximum DOP?
a no
h a s ฺ
New Parameters Allowable Values ฺ a r) uide Default
ฺ
Any numberc om>=e1,nCPU, t G IO, CPU
on tud
PARALLEL_DEGREE_LIMIT
a
AUTO
@ is S
i l l e
l o ฺz se th
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l lic
Using PARALLEL_DEGREE_LIMIT
l o
rce new concept related to simplified parallelism is “maximum degree of parallelism.” By
Another
a
Mdefault, the maximum degree of parallelism for a statement is capped by the default DOP. In some
cases, this DOP might be too high. There is a need to have a limit on the maximum degree of
parallelism for all parallel statements in the system to prevent overloading of the system.
A new parameter, PARALLEL_DEGREE_LIMIT, allows you to specify the maximum DOP.
The allowable values for the parameter are any numerical value greater than or equal to 1, CPU, IO,
or AUTO. If the parameter is set to CPU, IO, or AUTO, the degree limit will be automatically
computed by the system, based on the system resource constraint. Users are also allowed to set the
limit to a fixed value, if they want to limit the degree of parallelism below a certain value for
whatever reasons.
When PARALLEL_DEGREE_LIMIT is set to AUTO, the threshold is derived by the optimizer.
When PARALLEL_DEGREE_LIMIT is set to IO, the threshold is derived from I/O resource
constraints.
The default value for this parameter is CPU, calculated as follows:
threads_per_cpu * total number of CPUs in the cluster
This control is applicable to LIMITED mode only. The DOP derived either from object decoration
directly under manual mode or by the optimizer under limited mode would never exceed the degree
limit specified in the control.
Oracle Database 11g: New Features for Administrators 6 - 23
Using PARALLEL_DEGREE_LIMIT (continued)
Note: If PARALLEL_DEGREE_POLICY is set to MANUAL (the default), the maximum DOP a
statement can have is limited by PARALLEL_MAX_SERVERS, as in previous releases. If
PARALLEL_DEGREE_POLICY is set to AUTO or LIMITED, the maximum DOP a statement can
have is limited by PARALLEL_DEGREE_LIMIT. However, when PARALLEL_DEGREE_POLICY
is utilized, the maximum DOP that the Oracle server will choose is DEFAULT_DOP, which is the
default value for PARALLEL_DEGREE_LIMIT. It is possible to use a hint to force a greater DOP
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e l oZ l
M arc
Using PARALLEL_FORCE_LOCAL
Parallel
hint
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Enhanced Explain
l
Zi Plan licExample
l o
rceexample using SQL Developer, the note in the EXPLAIN PLAN output shows the computed
In this
a
Mdegree of parallelism used by the optimizer. Autotrace is enabled, and the note appears in the Script
Output tab after executing the script in SQL Developer.
In this example, the computed degree of parallelism is 2. It has been derived from a scan of the
SCOTT.EMP table.
l e (m ense
l
Zi Query
In-Memory Parallel lic
l o
rcecases, the database server can cache parallel query data in the buffer cache instead of
In some
a
Mperforming direct reads into the PGA. This configuration may be appropriate when the database
servers have a large amount of memory.
With Oracle’s new automatic parallelization capabilities (minimal effort parallel execution), the
instancewide buffer cache can be used to store and reuse the clusterwide data cache for a single
parallel operation, thus minimizing or even completely eliminating the physical I/O for a parallel
operation.
Parallel Data Cache enables the clusterwide usage of the buffer cache for parallel operations, scaling
out the available memory for data caching with the number of nodes in a cluster. This new
functionality optimizes the physical I/O requirements, speeding up the processing of large parallel
operations.
See the Oracle Database Data Warehousing Guide 11g Release 2 for more details about In Memory
Parallel Query.
See the Oracle Database VLDB and Partitioning Guide 11g Release 2 to learn more about using
parallel execution.
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Zi l
Oracle Partitioning lic
l o
ce summarizes the ten years of partitioning development at Oracle.
Therslide
a
MNote: REF partitioning enables pruning and partitionwise joins against child tables. While
performance seems to be the most visible improvement, do not forget about the rest. Partitioning
must address all business-relevant areas of performance, manageability, and availability.
• Interval partitioning
• System partitioning
• Composite partitioning enhancements
• Virtual column-based partitioning
• Reference partitioning
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Partitioning Z i l lic
Enhancements
l o
rce is an important tool for managing large databases. Partitioning allows the DBA to
Partitioning
a
Memploy a “divide and conquer” methodology for managing database tables, especially as those tables
grow. Partitioned tables allow a database to scale for very large data sets while maintaining
consistent performance, without unduly impacting administrative or hardware resources.
Partitioning enables faster data access within an Oracle database. Whether a database has 10 GB or
10 TB of data, partitioning can speed up data access by orders of magnitude.
Oracle Database 11g includes the following partitioning enhancements:
• Addition of interval partitioning
• Addition of system partitioning
• Composite partitioning enhancements
• Addition of virtual column-based partitioning
• Addition of reference partitioning
PREVIOUS
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Not yet
PREVIOUS materialized
SYS_Px SYS_Py SYS_Pz SYS_Pt
< 01/01/07 < 01/08/07 < 01/11/07 < 01/12/07 < 01/03/08
Transition point
ble
alter table orders_interval merge partitions
fe r a
for(TO_DATE('15-10-2007','dd-mm-yyyy')),for(TO_DATE('15-11-2007','dd-mm-yyyy'))
an s
into partition sys_p5z;
n - t r
a no
h a s ฺ
PREVIOUS SYS_Px
r ) SYS_P5z
i d e SYS_Pt
< 01/01/07 < 01/08/07
m ฺa G< 01/12/07
u < 01/03/08
o
ฺc den t
o
a Stun Transition point
l l e@ is
ฺ z i t h
e loCopyright u e
s2009,
a r c t o © Oracle. All rights reserved.
l e (m ense
Zi l
Moving the Transition licPoint: Example
l o
ce in the slide shows you a typical Information Lifecycle Management (ILM) scenario
Thergraphic
a
Mwhere after one year of automated partition creation, you merge the created partitions (SYS_Py and
SYS_Pz in the example) to move the transition point. You can then move the resulting partitions to
a different storage for ILM purposes.
The example assumes that you created a table called ORDERS_INTERVAL that initially has one
range partition called PREVIOUS, which holds orders from before 2007. The interval is defined to be
one month. Then during the years 2007 and 2008, some orders are inserted, and it is assumed that
four partitions are created. They are shown on the graphic. They are automatically named according
to system rules.
Then you decide to merge the last two partitions of the year 2007 using the ALTER TABLE
statement shown in the slide. You must merge two adjacent partitions. Note the new extended
partition syntax that can be used to designate a partition without knowing its name. The syntax uses
an expression that must represent a possible value for the partition in question. This syntax works for
all cases when you have to reference a partition, whether it be range, list, interval, or hash. It supports
all operations such as drop, merge, split, and so on.
As a result of your MERGE operation, you can see that the transition point moved. The bottom part of
the graphic shows you the new range section that now contains three partitions.
System partitioning:
• Enables application-controlled partitioning for selected
tables
• Provides the benefits of partitioning but the partitioning
and data placement are controlled by the application
• Does not employ partitioning keys like other
a b le
partitioning methods s f er
t
• Does not support partition pruning in the traditional
- r an
sense n on
a s ฺ
h a
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
System Partitioning lic
l o
rcepartitioning enables application-controlled partitioning for arbitrary tables. This is mainly
System
a
Museful when you develop your own partitioned domain indexes. The database simply provides the
ability to break down a table into meaningless partitions. All other aspects of partitioning are
controlled by the application. System partitioning provides the well-known benefits of partitioning
(scalability, availability, and manageability), but the partitioning and actual data placement are
controlled by the application.
The most fundamental difference between system partitioning and other methods is that system
partitioning does not have any partitioning keys. Consequently, the distribution or mapping of the
rows to a particular partition is not implicit. Instead, the user specifies the partition to which a row
maps by using partition-extended syntax when inserting a row.
Because system-partitioned tables do not have a partitioning key, the usual performance benefits of
partitioned tables are not available for system-partitioned tables. Specifically, there is no support for
traditional partition pruning, partitionwise joins, and so on. Partition pruning is achieved by
accessing the same partitions in the system-partitioned tables as those that were accessed in the base
table.
System-partitioned tables provide the manageability advantages of equipartitioning. For example, a
nested table can be created as a system-partitioned table that has the same number of partitions as the
base table. A domain index can be backed up by a system-partitioned table that has the same number
of partitions as the base table.
Oracle Database 11g: New Features for Administrators 6 - 39
System Partitioning: Example
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
INSERT INTO systab PARTITION (p1) VALUES (4,5);
n - t r
INSERT INTO systab PARTITION (p2) VALUES (150,2);
a no
h a s ฺ
ฺ a r) uide p1;
om ent G
alter table systab merge partitions p1,p2 into partition
ฺ c
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
System Partitioning: ic
lExample
l o
ce in the slide example creates a table with four partitions. Each partition can have different
Thersyntax
a
Mphysical attributes. INSERT and MERGE statements must use partition-extended syntax to identify a
particular partition that a row should go into. For example, the value (4,5) can be inserted into any
one of the four partitions given in the example.
Deletes and updates do not require the partition-extended syntax. However, because there is no
partition pruning, if the partition-extended syntax is omitted, the entire table is scanned to execute the
operation. Again, this example highlights the fact that there is no implicit mapping from rows to any
partition.
l e (m ense
System-Managed
l
Zi Indexes lic for List Partitioning
l o
rce indexes enable you to define your own domain-specific indexing schemes and plug them
Domain
a
Minto the Oracle Database using Oracle’s Extensibility Framework. In Oracle Database 11g Release 2,
system-managed local domain indexes are supported for list-partitioned tables.
An indextype is an object that specifies the routines that manage a domain (application-specific)
index. Indextypes reside in the same namespace as tables, views, and other schema objects. The
CREATE INDEXTYPE statement binds the indextype name to an implementation type, which in turn
specifies and refers to user-defined index functions and procedures that implement the indextype.
If you define an indextype with the WITH LOCAL PARTITION and the WITH SYSTEM MANAGED
STORAGE TABLES clauses, it can support local domain indexes on range- and list- partitioned
tables. The RANGE keyword is no longer required and will be deprecated in a future release.
The *_INDEXTYPES family of views has been modified to include the PARTITIONING column
with values of Y or N, indicating whether or not the indextype can support local domain indexes.
l e (m ense
Zi l
Virtual Column–Based licPartitioning
l o
rce of a table whose values are derived by computation of a function or an expression are
Columns
a
Mknown as virtual columns. These columns can be specified during a CREATE or ALTER table
operation. Virtual columns share the same SQL namespace as other real table columns and conform
to the data type of the underlying expression that describes it. These columns can be used in queries
like any other table columns, thereby providing a simple, elegant, and consistent mechanism of
accessing expressions in a SQL statement.
The values for virtual columns are not physically stored in the table row on disk, rather they are
evaluated on demand. The functions or expressions describing the virtual columns should be
deterministic and pure, meaning the same set of input values should return the same output values.
Virtual columns can be used like any other table columns. They can be indexed, and used in queries,
DML, and DDL statements. Tables and indexes can be partitioned on a virtual column and even
statistics can be gathered upon them.
You can use virtual column partitioning to partition key columns defined on virtual columns of a
table. Frequently, business requirements to logically partition objects do not match existing columns
in a one-to-one manner. With the introduction of Oracle Database 11g, partitioning has been
enhanced to allow a partitioning strategy defined on virtual columns, thus enabling a more
comprehensive match of the business requirements.
… Range(ORDER_DATE) …
Primary key (ORDER_ID)
Table ORDERS
bl e
fe r a
Table
an s
ORDER_ITEMS
n - t r
a no
… Range(ORDER_DATE) h a s ฺ…
Foreign key (ORDER_ID) r)
ฺ a u ide
ฺ c om ent G
Redundant storage/maintenance of ORDER_DATE a
on tuPartition d key inherited through PK/FK relationship
@
le this S
ฺ z i l
e loCopyright u e
s2009,
a r c t o © Oracle. All rights reserved.
l e (m ense
Zi l
Reference Partitioning: licBenefit
l o
rce in the slide, you can see the benefit of using reference partitioning. The left part of the
As illustrated
a
Mgraphic shows you the situation where you have two tables, ORDERS and ORDER_ITEMS, that are
equipartitioned on the ORDER_DATE column. In that case, both tables need to define the
ORDER_DATE column. However, defining ORDER_DATE in the ORDER_ITEMS table is redundant
because there is a primary key/foreign key relationship between the two tables.
The right part of the graphic shows you the situation where you use reference partitioning. This time,
you no longer need to define the ORDER_DATE column in the ORDER_ITEMS table. The partition
key of the ORDER_ITEMS table is automatically inherited from the primary key/foreign key
relationship that exists.
When used for pruning and partitionwise joins, reference partitioning has the benefit that query
predicates can be different and partitionwise joins still work—for example, partitioning on
ORDER_DATE and search on ORDER_ID. With previous releases, both partitioning and predicates
had to be identical for a partitionwise join to work.
Note: This partitioning method can be useful for nested table partitioning.
– List-Hash
SP2 SP2 SP2 … SP2 SP2
– List-Range ble
fe r a
• Interval top level
SP3 SP3 SP3 … SP3
t r a ns
SP3
– Interval-Range n- n o
– Interval-List SP4 SP4 SP4 a
s … ฺ SP4 SP4
h a
– Interval-Hash
ฺ a r) uide
ฺ c om eHASH
LIST, RANGE, n tG
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
Composite Partitioning licEnhancements
l o
rcethe release of Oracle Database 11g, the only composite partitioning methods supported were
Before
a
Mrange-list and range-hash. With this new release, list partitioning can be a top-level partitioning
method for composite partitioned tables giving us list-list, list-hash, list-range, and range-range
composite methods. With the introduction of interval partitioning, interval-range, interval-list, and
interval-hash are now supported composite partitioning methods.
Range-Range Partitioning
Composite range-range partitioning enables logical range partitioning along two dimensions; for
example, range partition by ORDER_DATE and range subpartition by SHIPPING_DATE.
List-Range Partitioning
Composite list-range partitioning enables logical range subpartitioning within a given list partitioning
strategy; for example, list partition by COUNTRY_ID and range subpartition by ORDER_DATE.
List-Hash Partitioning
Composite list-hash partitioning enables hash subpartitioning of a list-partitioned object; for
example, to enable partitionwise joins.
List-List Partitioning
Composite list-list partitioning enables logical list partitioning along two dimensions; for example,
list partition by COUNTRY_ID and list subpartition by SALES_CHANNEL.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Marc
le
oZ
i l l l
m a r c e
e ( icens
e
z i
to
l @
loฺ use
n
le this
ฺ
m
ao Stud
r )
co ent
s
ฺa Gui
ha deฺ
an
on - t r an
s
fe r a bl
e
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Oracle SecureFiles
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
l e (m ense
Zi l
Oracle SecureFiles lic
l o
rceDatabase 11g completely reengineers the LOB data type as Oracle SecureFiles,
Oracle
a
Mdramatically improving the performance, manageability, and ease of application development.
The new implementation also offers advanced, next-generation functionality such as intelligent
compression and transparent encryption.
With SecureFiles, chunks vary in size from Oracle data block size up to 64 MB. The Oracle
Database server attempts to colocate data in physically adjacent locations on disk, thereby
minimizing internal fragmentation. By using variable chunk sizes, SecureFiles avoids versioning
of large, unnecessary blocks of LOB data.
SecureFiles also offer a new client/server network layer allowing for high-speed data transfer
between the client and server supporting significantly higher read and write performance.
SecureFiles automatically determines the most efficient way for generating redo and undo,
eliminating user-defined parameters. SecureFiles automatically determines whether to generate
redo and undo for only the change, or create a new version by generating a full redo record.
SecureFiles is designed to be intelligent and self-adaptable as it maintains different in-memory
statistics that help in efficient memory and space allocation. This provides for easier
manageability due to lower number of tunable parameters that are harder to tune with
unpredictable loads.
Note: LOB implementation available in prior database versions is now referred to as BasicFiles.
Altering the RETENTION with the ALTER TABLE statement affects the space created only after
the statement is executed.
For SecureFiles, you no longer need to specify CHUNK or PCTVERSION. Because SecureFiles
are stored in ASSM tablespaces FREEPOOLS, FREELISTS, and FREELIST GROUPS cannot
be specified. For compatibility with existing scripts, these clauses are parsed but not interpreted.
capabilities:
– Intelligent LOB compression (requires Advanced
Compression Option)
– Deduplication (requires Advanced Compression Option)
– Transparent encryption (requires Advanced Security
Option) e
r a bl
• These capabilities leverage the security, reliability, and
n s fe
scalability of the database.
n - tra
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
SecureFiles:
l
ZiAdvancedlic Features
l o
rceSecureFiles implementation also offers advanced, next-generation functionality such as
Oracle
a
M intelligent compression and transparent encryption. Compression enables you to explicitly
compress SecureFiles. SecureFiles transparently uncompresses only the required set of data
blocks for random read or write access, automatically maintaining the mapping between
uncompressed and compressed offsets. If the compression level is changed from MEDIUM to
HIGH, the mapping is automatically updated to reflect the new compression algorithm.
Deduplication automatically detects duplicate SecureFile LOB data and conserves space by
storing only one copy—implementing disk storage, I/O, and redo logging savings. Deduplication
can be specified at the table level or partition level and does not span across partitioned LOBs.
Deduplication requires the Advanced Compression Option.
Encrypted LOB data is now stored in place and is available for random reads and writes offering
enhanced data security. SecureFile LOBs can be encrypted only on a per-column basis (same as
Transparent Data Encryption). All partitions within a LOB column are encrypted using the same
encryption algorithm. BasicFiles data cannot be encrypted. SecureFiles supports the industry-
standard encryption algorithms: 3DES168, AES128, AES192 (default), and AES256. Encryption
is part of the Advanced Security Option.
Note: The COMPATIBLE initialization parameter must be set to 11.0.0.0.0 or later to use
SecureFiles. The BasicFiles (previous LOB) format is still supported under 11.1.0.0.0
compatibility. There is no downgrade capability after 11.0.0.0.0 is set.
Oracle Database 11g: New Features for Administrators 7 - 8
Creating SecureFiles
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Creating o Zi l
SecureFiles licUsing Enterprise Manager
l
e use Enterprise Manager to create SecureFiles from the Schema tab > Tables link. After
You
a rccan
Myou click the Create button, you can click the Advanced Attributes button against the column
you are storing as a SecureFile, to enter any SecureFiles options.
The LOB implementation available in prior versions is still supported for backward
compatibility reasons and is now referred to as BasicFiles. If you add a LOB column to a table,
you can specify whether it should be created as a SecureFile or a BasicFile. If you do not specify
the storage type, the LOB is created as a BasicFile to ensure backward compatibility.
You can select the following as values for the Cache option:
• CACHE: Oracle places LOB pages in the buffer cache for faster access.
• NOCACHE: As a parameter in the STORE AS clause, NOCACHE specifies that LOB values
are not brought into the buffer cache.
• CACHE READS: LOB values are brought into the buffer cache only during read and not
during write operations.
NOCACHE is the default for both SecureFile and BasicFile LOBs.
LOB Cache
z ill e t hi s
ฺ e
r c eloCopyright
o u©s2009, Oracle. All rights reserved.
a t
l e (m ense
Zi l
Altering SecureFiles lic
l o
rcethe DEDUPLICATE option, you can specify that LOB data that is identical in two or more
Using
a
Mrows in a LOB column should share the same data blocks. The opposite of this is
KEEP_DUPLICATES. Oracle uses a secure hash index to detect duplication and combines
LOBs with identical content into a single copy, reducing storage and simplifying storage
management. The LOB keyword is optional and is for syntactic clarity only.
The COMPRESS or NOCOMPRESS keywords enable or disable LOB compression, respectively.
All LOBs in the LOB segment are altered with the new compression setting. Additional
information on compression is provided later in the lesson.
The ENCRYPT or DECRYPT keyword turns on or off LOB encryption using Transparent Data
Encryption (TDE). All LOBs in the LOB segment are altered with the new setting. A LOB
segment can be altered only to enable or disable LOB encryption. That is, ALTER cannot be
used to update the encryption algorithm or the encryption key. The encryption algorithm or
encryption key can be updated using the ALTER TABLE REKEY syntax. Encryption is done at
the block level allowing for better performance (smallest encryption amount possible) when
combined with other options.
Note: For a full description of the options available for the ALTER TABLE statement, see the
Oracle Database SQL Reference.
SecureFile Compression
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Compression Modes
SecureFile compression:
– MEDIUM (Default)
– HIGH
• In Oracle Database 11g Release 2, a new SecureFile
compression mode, LOW, is available.
• LOW mode is recommended for customers who want: ble
fe r a
– Faster performance during writes
t r a ns
– Faster performance during reads o n -
an
– Lower compression compared to other smodes
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Compression
l
Zi Modeslic
l o
In
a rce Database 11g Release 1, there were two modes of SecureFile compression: HIGH and
Oracle
MMEDIUM. HIGH compression provides maximum compression. It is useful for databases that are
CPU intensive and have a relatively higher latency. MEDIUM compression mode provides lower
compression than HIGH mode. It is useful for databases that have a lower latency compared to
HIGH mode databases. MEDIUM compression is the default compression mode if not specified.
In Oracle Database 11g Release 2, a new mode of SecureFile compression is introduced: LOW.
This mode of compression is recommended for customers who want faster performance during
reads and writes.
Configuration Parameters
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Configuration
l
Zi Parameters
lic
l o
To
a ce performance, you can force the I/O to be written to disk and avoid file system
roptimize
Mbuffering by setting the FILESYSTEMIO_OPTIONS parameter to SETALL.
DBMS_LOB
SecureFiles
– GETOPTIONS()
– SETOPTIONS e
r a bl
s fe
- t r an
n no
a
s ฺ
DBMS_SPACE.SPACE_USAGE
h a
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Accessing Z i l
SecureFiles lic Metadata
l o
a rce package: LOBs inherit the LOB column settings for deduplication, encryption, and
DBMS_LOB
Mcompression, which can also be configured on a per-LOB level using the LOB locator API.
However, the LONG API cannot be used to configure these LOB settings. You must use the
following DBMS_LOB package additions for these features:
• DBMS_LOB.GETOPTIONS: Settings can be obtained using this function. An integer
corresponding to a predefined constant based on the option type is returned.
• DBMS_LOB.SETOPTIONS: This procedure sets features and allows the features to be set
on a per-LOB basis, overriding the default LOB settings. It incurs a round-trip to the server
to make the changes persistent.
DBMS_SPACE.SPACE_USAGE: The existing SPACE_USAGE procedure is overloaded to
return information about LOB space usage. It returns the amount of disk space in blocks used by
all the LOBs in the LOB segment. This procedure can be used only on tablespaces created with
ASSM and does not treat LOB chunks belonging to BasicFiles as used space.
Note: For further details, see the Oracle Database PL/SQL Packages and Types Reference.
SecureFiles
ble
fe r a
an s
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
i l lic
MigratingotoZSecureFiles
l
rce of LOB interfaces allows easy migration from BasicFile LOBs. The two
Aasuperset
M recommended methods for migration to SecureFiles are partition exchange and online
redefinition.
Partition Exchange
• Needs additional space equal to the largest of the partitions in the table
• Can maintain indexes during the exchange
• Can spread the workload out over several smaller maintenance windows
• Requires that the table or partition needs to be offline to perform the exchange
Online Redefinition (recommended practice)
• No need to take the table or partition offline
• Can be done in parallel
• Requires additional storage equal to the entire table and all LOB segments to be available
• Requires that any global indexes be rebuilt
These solutions generally mean using twice the disk space used by the data in the input LOB
column. However, using partitioning and taking these actions on a partition-by-partition basis
may help lower the disk space required.
(partition p1 values less than (100) tablespace tbs1 lob(c) store as lobp1,
partition p2 values less than (200) tablespace tbs2 lob(c) store as lobp2,
partition p3 values less than (300) tablespace tbs3 lob(c) store as lobp3);
SecureFiles usage:
• *_SEGMENTS
• *_LOBS
• *_LOB_PARTITIONS
• *_PART_LOBS
ble
SQL> SELECT segment_name, segment_type, segment_subtype
fe r a
2 FROM dba_segments
an s
3 WHERE tablespace_name = 'SECF_TBS2' n - t r
4 AND segment_type = 'LOBSEGMENT'
a no
5 /
h a s ฺ
ฺ a r) uideSEGMENT_SU
SEGMENT_NAME
om ent G ----------
SEGMENT_TYPE
ฺ c
---------------------------- ------------------
SYS_LOB0000071583C00004$$ ao
n ud
@
LOBSEGMENT
S t SECUREFILE
z ill e t hi s
ฺ e
r c eloCopyright
o u©s2009, Oracle. All rights reserved.
a t
l e (m ense
Zi l lic
l o
rce
Ma
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Configuration
Automatic Secure lic
l o
rceDatabase 11g is installed with and the database is created with certain security features
Oracle
a
Mrecommended by the Center for Internet Security (CIS) benchmark. The CIS recommended
configuration is more secure than the 10gR2 default installation; yet open enough to allow the
majority of applications to be successful. Many customers have adopted this benchmark already.
There are some recommendations of the CIS benchmark that may be incompatible with some
applications.
• By default:
– Default password profile is enabled
– Account is locked after 10 failed login attempts
• In upgrade:
– Passwords are not case-sensitive until changed
– Passwords become case-sensitive when the ALTER USER
a b le
command is used fer s
• On creation: - t r an
n no
– Passwords are case-sensitive a
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Secure Default
l
Zi Configuration
lic
l o
rcecreating a custom database using the Database Configuration Assistant (DBCA), you can
When
a
Mspecify the Oracle Database 11g default security configuration. By default, if a user tries to connect
to an Oracle instance multiple times using an incorrect password, the instance delays each login after
the third try. This protection applies for attempts made from different IP addresses or multiple client
connections. Later, it gradually increases the time before the user can try another password, up to a
maximum of about ten seconds.
The default password profile is enabled with these settings at database creation:
PASSWORD_LIFE_TIME 180
PASSWORD_GRACE_TIME 7
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_REUSE_MAX UNLIMITED
FAILED_LOGIN_ATTEMPTS 10
PASSWORD_LOCK_TIME 1
PASSWORD_VERIFY_FUNCTION NULL
When an Oracle Database 10g database is upgraded, passwords are not case-sensitive until the
ALTER USER… command is used to change the password.
When the database is created, the passwords will be case-sensitive by default.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Enable Built-in
l
Zi Passwordlic Complexity Checker
l o
rce
VERIFY_FUNCTION_11G
a is a sample PL/SQL function that can be easily modified to enforce the
Mpassword complexity policies at your site. This function does not require special characters to be
embedded in the password. Both VERIFY_FUNCTION_11G and the older VERIFY_FUNCTION
are included in the utlpwdmg.sql file.
To enable the password complexity checking, create a verification function owned by SYS. Use one
of the supplied functions or modify one of them to meet your requirements. The example shows how
to use the utlpwdmg.sql script. If there is an error in the password complexity check function
named in the profile or it does not exist, you cannot change passwords nor can you create users. The
solution is to set the PASSWORD_VERIFY_FUNCTION to NULL in the profile, until the problem is
solved.
The VERIFY_FUNCTION_11G function checks that the password contains at least eight characters;
contains at least one number and one alphabetic character; and differs from the previous password by
at least three characters. The function also checks that the password is not a username or username
appended with any number 1–100; a username reversed; a server name or server name appended with
1–100; or one of a set of well-known and common passwords such as “welcome1,” “database1,”
“oracle123,” or “oracle (appended with 1–100),” and so on.
be automatically dropped after the specified number of attempts. This parameter is enforced even
when the password profile is not enabled.
This parameter prevents a program from making a database connection and then attempting to
authenticate by trying hundreds or thousands of passwords.
You can set limits on the number of times an unauthorized user (possibly an intruder) attempts to log
in to Oracle Call Interface (OCI) applications by using the
SEC_MAX_FAILED_LOGIN_ATTEMPTS initialization parameter.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
Features
l e (m ense
Zi l
Enterprise Manager lic
Security Management
l o
rce management has been integrated into Enterprise Manager.
Security
a
MThe Policy Manager Java console–based tool has been superseded. Oracle Label Security,
Application Context, and Virtual Private Database previously administered through the Oracle Policy
Manager tool are now managed through the Enterprise Manager. The Oracle Policy Manager tool is
still available.
The Enterprise Manager Security tool has been superseded by Enterprise Manager features.
Enterprise User Security is also now managed though Enterprise Manager. The menu item for
Enterprise Manager appears as soon as the ldap.ora file is configured. See the Enterprise User
Administrator’s Guide for configuration details. The Enterprise Security Manager tool is still
available.
TDE can now be managed through Enterprise Manager, including wallet management. You can
create, open, and close the wallet from Enterprise Manager pages.
BEGIN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (
acl => 'us-oracle-com-permissions.xml',
description => 'Permissions for oracle network',
principal => 'SCOTT',
is_grant => TRUE, a b le
privilege => 'connect'); s f er
n
END; -tra on
a n
a
h deฺs
r
ฺa Gui)
co entm
n ฺ
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Zi l
Managing Fine-Grained lic Access to External Network Services
l o
ce utility family of PL/SQL packages, such as UTL_TCP, UTL_INADDR, UTL_HTTP,
Thernetwork
a
MUTL_SMTP, and UTL_MAIL, allow Oracle users to make network callouts from the database using
raw TCP or using higher-level protocols built on raw TCP. A user either did or did not have the
EXECUTE privilege on these packages and there was no control over which network hosts were
accessed. The new package DBMS_NETWORK_ACL_ADMIN allows fine-grained control using
access control lists (ACL) implemented by XML DB.
1. Create an access control list (ACL). The ACL is a list of users and privileges held in an XML
file. The XML document named in the acl parameter is relative to the /sys/acl/ folder in
XML DB. In the example given in the slide, SCOTT is granted connect. The username is
case-sensitive in the ACL and must match the username of the session. There are only
resolve and connect privileges. The connect privilege implies resolve. Optional
parameters can specify a start and end time stamp for these privileges. To add more users and
privileges to this ACL, use the ADD_PRIVILEGE procedure.
host01=
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
FEDC:BA98:7654:3210:FEDC:BA98:7654:3210
1080:0:0:0:8:800:200C:417A
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)
ble
(HOST=[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210])(PORT=5521))
fe r a
(CONNECT_DATA=(SERVICE_NAME=host02.example.com)))
ans
n - t r
a no
• IPv6 Support for JVM and Java Debuggers a s ฺ
h
r) uide
ฺ a
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
IPv6 Supported
l
Zi in JavalicInterfaces
l o
rce IPv6 Support for JDBC Thin Clients
Complete
a
MJDBC supports IPv6 style addresses in the JDBC URL and host names that resolve to IPv6 addresses.
For example:
FEDC:BA98:7654:3210:FEDC:BA98:7654:3210
1080:0:0:0:8:800:200C:417A
A JDBC URL looks like the following:
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)
(HOST=[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210])(PORT=5521))
(CONNECT_DATA=(SERVICE_NAME=host02.example.com)))
This provides Java interoperability with IPv6.
Complete IPv6 Support for JVM and Java Debuggers
The IPv6 support for the database resident Java Virtual Machine (JVM) allows Java applications
running in the Oracle database to connect and accept connections from both IPv4 and IPv6 hosts.
For more details see the Oracle Database Java Developer's Guide.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Marc
le
oZ
i l l l
m a r c e
e ( icens
e
z i
to
l @
loฺ use
n
le this
ฺ
m
ao Stud
r )
co ent
s
ฺa Gui
ha deฺ
an
on - t r an
s
fe r a bl
e
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi
Change Management
l liinc Oracle Database 11g
e l o
SQLrcPerformance Analyzer automates the process of assessing the overall effect of a change on the
a
Mfull SQL workload by identifying performance divergence for each SQL statement. Additional
information about SQL Performance Analyzer is presented in this lesson.
SQL Plan Management is a new feature introduced with Oracle Database 11g that enables the system
to automatically control SQL plan evolution by maintaining SQL plan baselines. SQL Plan
Management is discussed in detail in the next lesson.
Database Replay enables you to test the impact of a system change by replaying a real-world
workload on the test system before it is exposed to a production system. Database Replay is
discussed in detail in a later lesson.
Set up test
environments
(snapshot standby Provision for
databases) production
ble
fe r a
ans
n - t r
Patches and no
Diagnose problems
a
workarounds a
h deฺs
r
ฺa Gui)
m
Realisticon ฺco dent
testing
@ a Stu
z i l l e t h is
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Lifecycle of Z i l
Change lic
Management
l o
rceDatabase 11g supports realistic testing through the use of snapshot standby databases to set up
Oracle
a
Mand test the physical environment. You can open a physical standby database temporarily (that is,
activated) for read and write activities such as reporting and testing. Once testing is completed, you
can then simply revert to the physical standby mode to allow catch-up to the primary site. This
functionality preserves zero data loss and is similar to storage snapshots, but allows for disaster
recovery and offers a single copy of storage at the time of testing. Refer to the Oracle Database 11g:
New Features for Data Guard Seminar for detailed information on snapshot standby databases.
For enterprises to be able to perform an accurate test of a database environment, it is vital that they
be able to reproduce the production scenarios accurately. Database Replay provides further support
for realistic testing in Oracle Database 11g. Database Replay is designed to capture client requests on
a given database to be reproduced on other copies of production databases. Oracle Enterprise
Manager provides an easy-to-use set of steps to set up the capture of a workload.
Some of the changes that a DBA deals with are database upgrades, new tuning recommendations,
schema changes, statistics collection, and changes in operating system and hardware. DBAs can use
SQL Performance Analyzer to track and forecast SQL performance changes caused by these
changes.
If SQL performance has regressed in some of the cases, the DBA can then run the SQL Tuning
Advisor to tune the SQL statements.
Test
Diagnose and
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Set up test
environments
Provision for
production
ble
(rolling upgrades)
fe r a
ans
n - t r
Patches and no
Diagnose problems
a
workarounds
(ADR/Support Workbench)
a
h deฺs
(Enterprise Manager) r
ฺa Gui)
co entm
Provisioning n ฺ
automation
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Lifecycle of Z i l
Change lic
Management (continued)
l o
When
a rceupgrading from Oracle Database 11g, Release 1, you can use the rolling upgrade functionality
Mto ensure that various versions of the software can still communicate with each other. This allows
independent nodes of an ASM cluster to be migrated or patched without affecting the availability of
the database, thereby providing higher uptime and problem-free migration to new releases. ASM
offers further system capacity planning and workload change enhancements (Fast Disk Resync,
Preferred Mirror Read). Numerous enhancements to the online functionality (online index
reorganization and online table redefinition) further support application change.
Automatic Diagnostic Repository (ADR) is a new system-managed repository for storing and
organizing trace files and other error diagnostic data. You get a comprehensive view of all the
serious errors encountered by the database, and the relevant data needed for problem diagnosis and
eventual resolution. You can also use EM Support Workbench, which provides a simple workflow
interface to view and diagnose incident data, and package it for Oracle Support. The Data Recovery
Advisor tool can be used to automatically diagnose data failures and report on the appropriate repair
option.
Oracle Database 11g Enterprise Manager supports end-to-end automation of patch application on
single-instance database homes and rolling patches on clusterware. You no longer need to perform
manual steps for shutting down your system, invoking OPatch, applying SQL, and other such best-
practice steps in the patching procedure.
Cursor cache
ble
fe r a
ans
Production Test
n - t r
database database
a no
h a s ฺ
• Copy SQL Tuning Set to staging table (“pack”).
ฺ a r) uide
• Transport staging table to test system
ฺ c om(data n t G DB link, etc).
pump,
• Copy SQL Tuning Set from staging a on table t u de(“unpack”).
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi to alicTest System
Step 2: Transport
l o
ce step is to transport these SQL statements to a similar system that is being tested. Here,
Thersecond
a
MSTS can be exported from production and then imported into a test system.
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
i l
Step 3: BuildZBefore lic
Change Performance Data
l o
ce step is to capture a baseline of the test system performance consisting of the execution plan
Therthird
a
Mand execution statistics.
The information collected in this stage represents a snapshot of the current state of the system
workload. The performance data includes:
• Execution plans (for example, generated by explain plan)
• Execution statistics (for example, includes elapsed time, buffer gets, disk reads, and rows
processed)
In Oracle Database 11g Release 2, each SQL statement is executed at least twice, for as many times
as possible until the execution times out (up to a maximum of 10 times). The first execution is used
to warm the buffer cache. All subsequent executions are then used to calculate the run-time
execution statistics for the SQL statement based on their averages.
an s
• Reexecute SQL after change:
n - t r
– Test/execute SQL in STS to
a no
generate SQL execution plans and
h a s ฺ
statistics.
ฺ a r) uide
– Explain plan SQL in STS to
ฺ c om ent G database Test
generate SQL plans.
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Planned
Step 4: Implement lic Change and Step 5: Build After-Change Performance Data
l o
ce step is to make the changes to the test system. Rerun the SQL statements to assess the
Therfourth
a
Mimpact of the changes on the SQL performance as step five.
– ELAPSED_TIME, BUFFER_GETS,
DISK_READS, ...
• Calculate impact of change on
individual SQLs and SQL workload: Improvement Regression
Database instance e
• Use SQL execution frequency to
r a bl
define a weight of importance.
n s fe
• Detect improvements, regressions,
n - tra
and unchanged performance.
a no
• Detect changes in execution plans.
h a s ฺ
• Recommend running SQL Tuning ฺ a r) uide
Advisor to tune regressed SQLs. om t G
n ฺ c e n Test
• Analysis results can be used
@ aoto seed
S t ud database
SQL Plan Management llebaselines.
ฺzi se th
is
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Step 6: Compare
l
Zi andliAnalyze
c Performance and Step 7: Tune Regressed SQL
l o
a ce
Thercomparison is based on the execution statistics, such as elapsed time, CPU time, and buffer gets.
MEnterprise Manager provides the tools to make a full comparison of performance data, including
execution statistics such as elapsed time, CPU time, and buffer gets. If the SQL performance has
regressed in some of the cases, you must then run SQL Tuning Advisor to tune the SQL statements—
either immediately or at a scheduled time. As with any tuning strategy, it is recommended that only
one change be implemented at a time and retested before making further changes.
You can use SQL Tuning Advisor or Access Advisor against the identified statements and then
implement those recommendations. Alternatively, you can seed SQL Plan Management (SPM) with
plans captured in step 3 to guarantee that the plans remain the same.
perform?
1. Tunes regressions
2. Provides before-and-after execution statistics
3. Executes SQL statements serially
4. Builds different versions of SQL workload
performance ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
l
3,i and 4 lic
Answers: 2, Z
l o
a rce
M
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Accessing SQL
l
Zi Performance
lic Analyzer
l o
e access SQL Performance Analyzer through Enterprise Manager or by using the
Yourc
can
a
MDBMS_SQLPA package.
l e (m ense
SQL Performance
l
Zi Analyzer:
lic PL/SQL Example (continued)
l o
ce your changes.
3.rMake
a
M 4. Execute the task again after making the changes, and generate the after-changes report.
5. Compare the two executions and generate the analysis report. Using different execution
parameters, you can execute the following command:
EXEC dbms_sqlpa.execute_analysis_task(task_name => :tname,
execution_type => 'COMPARE PERFORMANCE');
Note: For more information about the DBMS_SQLPA package, see the Oracle Database PL/SQL
Packages and Types Reference Guide.
BEGIN
bl e
DBMS_SQLTUNE.CREATE_TUNING_TASK(
fe r a
spa_task_name => 'MYSPA',
ans
spa_compare_exec => 'MYCOMPEXEC'); n - t r
END; a no
h a s ฺ
r) uide
/
ฺ a
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Tuning Regressed
l
Zi SQL lic Statements
e l o
a rcreviewing
After the SQL Performance Analyzer report, you should tune any regressed SQL
Mstatements that are identified after comparing the SQL performance. If there are a large number of
SQL statements that appear to have regressed, try to identify the root cause and make system-level
changes to rectify the problem.
If only a few SQL statements have regressed, consider using the SQL Tuning Advisor to implement a
point solution for them. Create a SQL tuning task for the SQL Performance Analyzer execution by
using the DBMS_SQLTUNE.CREATE_TUNING_TASK function. The CREATE_TUNING_TASK
function has the following parameters:
• SPA_TASK_NAME: Name of the SQL Performance Analyzer task
• SPA_TASK_OWNER: Owner of the specified SQL Performance Analyzer task. If unspecified,
this parameter will default to the current user.
• SPA_COMPARE_EXEC: Execution name of the compare performance trial for the specified
SQL Performance Analyzer task. If unspecified, this parameter defaults to the most recent
execution of the COMPARE PERFORMANCE type for the given SQL Performance Analyzer task.
After tuning the regressed SQL statements, test your changes by using SQL Performance Analyzer.
Run a new SQL trial on the test system, followed by a second comparison (between this new SQL
trial and the first SQL trial) to validate your results. After SQL Performance Analyzer shows that
performance has stabilized, you can implement the changes.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Statement log
Plan history
Plan history
Plan
baseline Plan
GB
GB baseline
GB GB
GB SQL
HJ HJ … HJ
HJ HJ
GB
HJ … HJ profile
Repeatable HJ HJ HJ
HJ HJ
SQL
statement
bl e
Plan History fe r a
an s
Plan
baseline
n - t r
GB GB
…
GB
HJ
a no
HJ
HJ
HJ
HJ
h a s ฺ Automatic
r) uide
HJ
SQL Tuning
ฺ a task
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
SQL Plan Baseline: lic
Architecture
l o
ce Plan Management (SPM) feature introduces necessary infrastructure and services in
TherSQL
a
Msupport of plan maintenance and performance verification of new plans.
For SQL statements that are executed more than once, the optimizer maintains a history of plans for
individual SQL statements. The optimizer recognizes a repeatable SQL statement by maintaining a
statement log. A SQL statement is recognized as repeatable when it is parsed or executed again after
it has been logged. After a SQL statement is recognized as repeatable, various plans generated by the
optimizer are maintained as a plan history containing relevant information (such as SQL text, outline,
bind variables, and compilation environment) that is used by the optimizer to reproduce an execution
plan.
As an alternative or complement to the automatic recognition of repeatable SQL statements and the
creation of their plan history, manual seeding of plans for a set of SQL statements is also supported.
A plan history contains different plans generated by the optimizer for a SQL statement over time.
However, only some of the plans in the plan history may be accepted for use. For example, a new
plan generated by the optimizer is not normally used until it has been verified not to cause a
performance regression. Plan verification is done “out of the box” as part of Automatic SQL Tuning
running as an automated task in a maintenance window.
The statement log, plan history, and plan baselines are stored in the SQL Management Base (SMB),
which also contains SQL profiles. The SMB is part of the database dictionary and is stored in the
SYSAUX tablespace. The SMB has automatic space management (for example, periodic purging of
unused plans). You can configure the SMB to change the plan retention policy and set space size
limits.
Note: With Oracle Database 11g, if the database instance is up but the SYSAUX tablespace is
OFFLINE, the optimizer is unable to access SQL management objects. This can affect performance
e
on some of the SQL workload.
fe r abl
a n s
n - tr
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
Pl
load_plans_from_cursor_cache
lin
ba GB e
an se
Pl lin
load_plans_from_sqlset
1 e HJ
HJ
GB
HJ
HJ
GB ALTER_SQL_PLAN_BASELINE
HJ
2
HJ
*_STGTAB_BASELINE
ble
GB
fe r a
HJ 3
an s
HJ
Cursor
Staging
n - t r
cache n o table
Plan history a
s ฺ
h a
r) uide
ba
an se
Pl GB lin
4 e
ฺ a
HJ
ฺ c om ent G
on tud
HJ
DBA
a
@ is S
i l l e
l o ฺz se th
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Loading SQL
l
i Baselines
ZPlan lic
l o
e load SQL plan baselines as follows:
Yourc
can
a
M • On the fly capture: Uses automatic plan capture by setting the initialization parameter
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES to TRUE. This parameter is set to FALSE
by default. Setting it to TRUE turns on automatic recognition of repeatable SQL statements and
automatic creation of plan history for such statements. This is illustrated in the left graphic in the
slide, where you can see the first generated SQL plan automatically integrated into the original
SQL plan baseline.
• Bulk loading: Uses the DBMS_SPM package, which enables you to manually manage SQL plan
baselines. With this package, you can load SQL plans into a SQL plan baseline directly from the
cursor cache or from an existing SQL Tuning Set (STS). For a SQL statement to be loaded into a
SQL plan baseline from an STS, the SQL statement needs to store its SQL plan in the STS.
DBMS_SPM enables you to change the status of a baseline plan from accepted to not accepted
(and from not accepted to accepted). It also enables you to export baseline plans from a staging
table, which can then be used to load SQL plan baselines on other databases.
• Migrate from stored outlines: Use the DBMS_SPM.MIGRATE_STORED_OUTLINE function
to migrate stored outlines for one or more SQL statements to plan baselines in the SQL
management base (SMB). Additional information is provided later in this lesson.
Print report
Plan history
ba
an se
Automatic Pl lin
e
GB
SQL Tuning HJ
HJ
DBA GB
ble
HJ
>? fe r a
HJ
an s
n - t r
a no
h a s ฺ
SQL
Tuning ฺ a r) uide
Advisor
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Evolving SQL
l
ZiPlan Baselines
lic
l o
rcethe SQL plan baseline evolution phase, Oracle Database routinely evaluates the performance
During
a
Mof new plans and integrates plans with better performance into SQL plan baselines.
When the optimizer finds a new plan for a SQL statement, the plan is added to the plan history as a
nonaccepted plan. The plan is then verified for performance relative to the SQL plan baseline
performance. When it is verified that a nonaccepted plan does not cause a performance regression
(either manually or automatically), the plan is changed to an accepted plan and integrated into the
SQL plan baseline. Successful verification of a nonaccepted plan consists of comparing its
performance to that of one plan selected from the SQL plan baseline and ensuring that it delivers
better performance.
There are two ways to evolve SQL plan baselines:
• By using the DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE function. An invocation example
is shown in the slide. The function returns a report that tells you whether some of the existing
history plans were moved to the plan baseline. You can also specify specific plans in the history
to be tested.
• By running SQL Tuning Advisor: SQL plan baselines can be evolved by manually or
automatically tuning SQL statements using SQL Tuning Advisor. When SQL Tuning Advisor
finds a tuned plan and verifies its performance to be better than a plan chosen from the
corresponding SQL plan baseline, it makes a recommendation to accept a SQL profile. When
the SQL profile is accepted, the tuned plan is added to the corresponding SQL plan baseline.
Oracle Database 11g: New Features for Administrators 10 - 7
Viewing Important Baseline SQL Plan Attributes
Plan history
ba
an se
Pl lin
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
GB GB e
Enabled but HJ
Enabled and
HJ
not accepted HJ HJ
accepted
ble
SIGNATURE SQL_HANDLE SQL_TEXT PLAN_NAME ORIGIN ENA ACC FIX AUT
fe r a
--------- ------------ -------- ---------------- ------------ --- --- --- ---
ans
8.062E+18 SYS_SQL_6fe2 select.. SYS_SQL_PLAN_1ea AUTO-CAPTURE YES NO NO YES
n - t r
8.062E+18 SYS_SQL_6fe2 select.. SYS_SQL_PLAN_4be AUTO-CAPTURE YES YES NO YES
… a no
h a s ฺ
ฺ u ide
exec :cnt := dbms_spm.alter_sql_plan_baseline(sql_handler)=> 'SYS_SQL_37e0168b0…3efe',
a -
plan_name
c om ent G=> 'NO');
=> 'SYS_SQL_PLAN_8dfc352f359901ea',
attribute_name => 'ENABLED', ฺattribute_value
-
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Viewing Important
l
Zi Baselinelic SQL Plan Attributes
l o
e look at each plan’s attributes by using the DBA_SQL_PLAN_BASELINES view, as shown
Yourccan
a
Min the slide. You can then use the DBMS_SPM.ALTER_SQL_PLAN_BASELINE function to change
some of them. You can also remove plans or a complete plan history by using the
DBMS_SPM.DROP_SQL_PLAN_BASELINE function. The example shown in the slide changes the
ENABLED attribute of SYS_SQL_PLAN_8DFC352F359901EA to NO.
Additional information on the attributes is presented on the next page.
Note: The DBA_SQL_PLAN_BASELINES view contains additional columns that enable you to
determine when each plan was last used and whether a plan will be automatically purged.
• ORIGIN:
– AUTO-CAPTURE: Automatically captured
– MANUAL-LOAD: Manually evolved
– MANUAL-SQLTUNE: Automatically evolved by SQL Tuning
Advisor
– AUTO-SQLTUNE: Automatically evolved by Automatic SQL
Tuning a b le
r e
• ENABLED: Plan is enabled for use by optimizer a n sf
- tr
• ACCEPTED: Plan validated as a good plan non
s a
• FIXED: Optimizer considers only thosea
) h plans
eฺ
ฺ a r uid
co entm G
n ฺ
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Zi l
Important Baseline lic Plan Attributes
SQL
l o
rcea plan enters the plan history, it is associated with a number of important attributes:
When
a
M • SIGNATURE, SQL_HANDLE, SQL_TEXT, and PLAN_NAME are important identifiers for
search operations.
• ORIGIN allows you to determine whether the plan was automatically captured (AUTO-
CAPTURE), manually evolved (MANUAL-LOAD), automatically evolved by SQL Tuning
Advisor (MANUAL-SQLTUNE), or automatically evolved by Automatic SQL Tuning (AUTO-
SQLTUNE).
• ENABLED and ACCEPTED: The ENABLED attribute means that the plan is enabled for use by
the optimizer. If ENABLED is not set, the plan is not considered. The ACCEPTED attribute
means that the plan was validated as a good plan, either automatically by the system or manually
when the user changes it to ACCEPTED. When a plan changes to ACCEPTED, it will become not
ACCEPTED only when DBMS_SPM.ALTER_SQL_PLAN_BASELINE() is used to change its
status. An ACCEPTED plan can be temporarily disabled by removing the ENABLED setting. A
plan must be ENABLED and ACCEPTED for the optimizer to consider using it.
• FIXED means that the optimizer considers only those plans and not other plans. For example, if
you have 10 baseline plans and three of them are marked FIXED, the optimizer uses only the
best plan from these three, ignoring all the others. A SQL plan baseline is said to be FIXED if it
contains at least one enabled fixed plan. If new plans are added to a fixed SQL plan baseline,
these new plans cannot be used until they are manually declared as FIXED.
Plan history
Yes
Plan
No
baseline
GB
GB GB
GB
HJ HJ … HJ
Plan part HJ HJ
HJ
HJ
Yes of baseline?
HJ
ble
fe r a
ns
No
t r
- plana
n
Select baseline
o
s an
with lowest best-cost
r ) ha deฺ
GB
Yes
ฺa G
GB
>u
i
GB
No
GB
DBMS_XPLAN.DISPLAY(…,'BASIC +NOTE) HJ
co entm HJ HJ HJ
or HJ
n ฺ HJ HJ HJ
ao Stud
PLAN_TABLE(other_xml)
l @
le this
ฺ z i
e loCopyright u e
s2009,
a r c t o © Oracle. All rights reserved.
l e (m ense
Zi
SQL Plan Selection
l lic
l o
rceare using automatic plan capture, the first time that a SQL statement is recognized as
If you
a
Mrepeatable, its best-cost plan is added to the corresponding SQL plan baseline. That plan is then used
to execute the statement.
The optimizer uses a comparative plan selection policy when a plan baseline exists for a SQL
statement and the OPTIMIZER_USE_SQL_PLAN_BASELINES initialization parameter is set to
TRUE (default value). Each time a SQL statement is compiled, the optimizer first uses the traditional
cost-based search method to build a best-cost plan. Then it tries to find a matching plan in the SQL
plan baseline. If a match is found, it proceeds as usual. If no match is found, it first adds the new plan
to the plan history, then costs each of the accepted plans in the SQL plan baseline, and picks the one
with the lowest cost. The accepted plans are reproduced using the outline that is stored with each of
them. So the effect of having a SQL plan baseline for a SQL statement is that the optimizer always
selects one of the accepted plans in that SQL plan baseline.
With SQL Plan Management, the optimizer can produce a plan that could be either a best-cost plan
or a baseline plan. This information is dumped in the OTHER_XML column of the PLAN_TABLE
upon EXPLAIN PLAN.
optimizer using a stored outline is not stored in the SMB even if automatic plan capture has been
enabled for the session.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
HJ HJ HJ HJ
No plan No plan
regressions regressions
DBA
ble
fe r a
an s
DBA Plan history
ba
n - t r
GB
an s
Pl GB eline
a no
Well- GB HJ
h a
HJ
s ฺ
r) uide
tuned HJ HJ HJ
plan HJ
ฺ a
Well-tuned
om ent G
Baseline
plan
ฺ c plans
on tuDevelopment
staging table
Oracle Database 10g a d database
e @ s S
ฺ z ill t hi
eloCopyright e
u©s2009, Oracle. All rights reserved.
a r c t o
l e (m ense
Possible SQL
l
ZiPlan Manageability
lic Scenarios
l o
a ce
• rDatabase upgrade: Bulk SQL plan loading is especially useful when the system is being
M upgraded from an earlier version to Oracle Database 11g. For this, you can capture plans for a
SQL workload into a SQL Tuning Set (STS) before the upgrade, and then load these plans from
the STS into the SQL plan baseline immediately after the upgrade. This strategy can minimize
plan regressions resulting from the use of the new optimizer version.
• New application deployment: The deployment of a new application module means the
introduction of new SQL statements into the system. The software vendor can ship the
application software along with the appropriate SQL plan baselines for the new SQL being
introduced. Because of the plan baselines, the new SQL statements will initially run with the
plans that are known to give good performance under a standard test configuration. However, if
the customer system configuration is very different from the test configuration, the plan
baselines can be evolved over time to produce better performance.
In both scenarios, you can use the automatic SQL plan capture after manual loading to make sure that
only better plans will be used for your applications in the future.
Note: In all scenarios in this lesson, assume that OPTIMIZER_USE_SQL_PLAN_BASELINES is
set to TRUE.
HJ HJ
Regressing
statements No plan
regressions
After
change
O_F_E=11
ble
fe r a
optimizer_features_enable
ans
n - t r
GB GB GB
a no
HJ HJ HJ
h a s ฺ
HJ HJ HJ
ฺ a r) uide
Well-
tuned
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
SQL Performance
l
Zi Analyzer
lic and SQL Plan Baseline Scenario
l o
rce of the first method described in the previous slide is through the use of SQL Performance
A variation
a
MAnalyzer as follows:
1. You can capture pre–Oracle Database 11g plans in an STS and import them into Oracle
Database 11g.
2. Then set the OPTIMIZER_FEATURES_ENABLE initialization parameter to 10.2 to make the
optimizer behave as if this were a 10g Oracle database.
3. Next run SQL Performance Analyzer for the STS.
4. When that is complete, set the OPTIMIZER_FEATURES_ENABLE initialization parameter
back to 11.2 and rerun SQL Performance Analyzer for the STS.
SQL Performance Analyzer produces a report that lists a SQL statement whose plan has regressed
from 10g to 11g. For those SQL statements that are shown by SQL Performance Analyzer to incur
performance regression due to the new optimizer version, you can capture their plans using an STS
and then load them into the SMB.
This method represents the best form of the plan-seeding process because it helps prevent
performance regressions while preserving performance improvements upon database upgrade.
Plan verification
baseline baseline
GB GB
GB GB GB
HJ HJ
HJ HJ HJ
HJ HJ
HJ HJ HJ
OPTIMIZER_FEATURES_ENABLE=10.2.0.2 OPTIMIZER_FEATURES_ENABLE=11.1.0.1
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE
a no GB GB
GB
HJ
HJ
Well-
tuned
HJ
hHJa s ฺ HJ
HJ
HJ
HJ
HJ
HJ plans
ฺ a r) uide
ฺ c om ent G
Oracle Database 10g
a on tud OPTIMIZER_FEATURES_ENABLE=11.1.0.1
l l e@ is S OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Loading a SQL
l
Zi Plan Baseline
lic Automatically: Scenario
l o
rce upgrade scenario involves using the automatic SQL plan capture mechanism. In this case,
Another
a
Mset the OPTIMIZER_FEATURES_ENABLE initialization parameter to the pre–Oracle Database 11g
version value for an initial period of time such as a quarter, and execute your workload after upgrade
by using the automatic SQL plan capture.
During this initial time period, because of the OPTIMIZER_FEATURES_ENABLE parameter
setting, the optimizer is able to reproduce pre–Oracle Database 11g plans for a majority of the SQL
statements. Because automatic SQL plan capture is also enabled during this period, the pre–Oracle
Database 11g plans produced by the optimizer are captured as SQL plan baselines.
When the initial time period ends, you can remove the setting of
OPTIMIZER_FEATURES_ENABLE to take advantage of the new optimizer version while incurring
minimal or no plan regressions due to the plan baselines. Regressed plans will use the previous
optimizer version; nonregressed statements will benefit from the new optimizer version.
DBA_SQL_MANAGEMENT_CONFIG
ble
fe r a
53 an s
n - t r
a no
1% 10% 20% 50% h a s ฺ space
r ) i d e
m ฺa Gu
ฺ c o e n t
n
ao Stud
SQL> exec :cnt := dbms_spm.drop_sql_plan_baseline('SYS_SQL_37e0168b04e73efe');
l @
le this
ฺ z i
e loCopyright u e
s2009,
a r c t o © Oracle. All rights reserved.
l e (m ense
i l
Purging SQLZManagement lic Base Policy
l o
ce occupied by the SQL Management Base (SMB) is checked weekly against a defined limit.
Therspace
a
MA limit based on the percentage size of the SYSAUX tablespace is defined. By default, the space
budget limit for the SMB is set to 10 percent of SYSAUX size. However, you can configure SMB and
change the space budget to a value between 1 percent and 50 percent by using the
DBMS_SPM.CONFIGURE procedure.
If SMB space exceeds the defined percent limit, warnings are written to the alert log. Warnings are
generated weekly until the SMB space limit is increased, the size of SYSAUX is increased, or the size
of SMB is decreased by purging some of the SQL management objects (such as SQL plan baselines
or SQL profiles).
The space management of SQL plan baselines is done proactively using a weekly purging task. The
task runs as an automated task in the maintenance window. Any plan that has not been used for more
than 53 weeks is purged. However, you can configure SMB and change the unused plan retention
period to a value between 5 weeks and 523 weeks (a little more than 10 years). To do so, use the
DBMS_SPM.CONFIGURE procedure.
You can look at the current configuration settings for the SMB by examining the
DBA_SQL_MANAGEMENT_CONFIG view. In addition, you can manually purge the SMB by using
the DBMS_SPM.DROP_SQL_PLAN_BASELINE function (as shown in the example in the slide).
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
Enterprise Manager lic SQL Plan Baselines
and
l o
rcethe SQL Plan Control page by clicking SQL Plan Control in the Query Optimizer region of
Access
a
Mthe Server page.
Use the SQL Plan Control page to manage SQL profiles, SQL patches, and SQL plan baselines from
one location rather than separate locations in Enterprise Manager. You can also enable, disable, drop,
pack, unpack, load, and evolve selected baselines.
From this page, you can also configure the various SQL plan baseline settings.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Database Replay
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
l e (m ense
Why Use Database
l
Zi Replay? lic
e l o
a rcbusiness-critical
Large applications are complex and experience highly varying load and usage
Mpatterns. At the same time, these business systems are expected to provide certain service-level
guarantees in terms of response time, throughput, uptime, and availability. Often any change to a
system, such as upgrading the database or modifying the configuration, necessitates extensive testing
and validation before these changes can make it to the production system. To be confident before
moving to a production system, the database administrator (DBA) needs to expose a test system to a
workload very similar to the workload that is expected in the production environment. It is also
beneficial for the DBA to have an effective means of analyzing the impact of system-level changes
on overall SQL performance so that any tuning changes required can be performed before
production.
Note: Database Replay is part of the Oracle Real Application Testing option.
Clients/app servers
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
l e (m ense
Zi
The Big Picture
l lic
l o
rce Replay allows you to test the impact of a system change by replaying a real-world
Database
a
Mworkload on the test system before it is exposed to a production system. The production workload
(including transaction concurrency and dependency) of the database server is recorded over an
illustrative period of time (for example, a peak period). This recorded data is used to replay the
workload on a test system that has been appropriately configured. You gain a high degree of
confidence in the overall success of the database change by subjecting the database server in a test
system to a workload that is practically indistinguishable from a production workload.
Many Oracle customers have expressed strong interest in the change-assurance functionality offered
by Database Replay. The database administrator, or a user with special privileges granted by the
DBA, initiates the record-and-replay cycle and has full control over the entire procedure.
Capture directory
fe r a
ans
n - t r
a no
h a s ฺ
Database
backup ฺ a r) uide
ฺ c om ent G
Production
a on tud
database
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
System Architecture: c
liCapture
l o
cepage you see an illustration of a system that is being recorded. You should always record a
On rthis
a
Mworkload that spans an “interesting” period in a production system. Typically, the replay of the
recording is used to determine whether it is safe to upgrade to a new version of the RDBMS server. A
special recording infrastructure built into the RDBMS records data about all external client requests
while the production workload is running on the system. External requests are any SQL queries,
PL/SQL blocks, PL/SQL remote procedure calls, DML statements, DDL statements, Object
Navigation requests, or Oracle Call Interface (OCI) calls. During the recording, background jobs and,
in general, all internal clients continue their work without being recorded. The end product is a
workload recording containing all necessary information for replaying the workload as seen by the
RDBMS in the form of external requests.
The recording infrastructure imposes minimal performance overhead (extra CPU, memory, and
input/output) on the recording system. You should, however, plan to accommodate the additional
disk space needed for the actual workload recording.
RAC Note: Instances in a RAC environment have access to the common database files. However,
they do not need to share a common general-purpose file system. In such an environment, the
workload recording is written on each instance’s file system during recording. For preprocessing and
replay, all parts of the workload recording need to be manually copied into a single directory.
Capture directory
fe r a
ans
n - t r
a no
h a s ฺ
Database
backup ฺ a r) uide
ฺ c om ent G
Production
a on tud
database
l l e@ is S Preprocess
capture
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
System Architecture: c
liPreprocessing the Workload
l o
a ce
Therworkload capture data is preprocessed and new workload replay-specific metadata files are
Mcreated that are required for the replay of the given workload capture. Only new files are created; no
files are modified that were created during the workload capture. Because of this, you can run the
preprocess multiple times on the same capture directory (for example, when the procedure
encounters unexpected errors or is canceled).
External client connections are remapped at this stage. Any replay parameters that affect the replay
outcome can be modified.
Note: Because preprocessing the workload capture data can be relatively expensive, the best practice
is to perform that operation on a system other than the production database system.
Capture directory
fe r a
ans
n - t r
Test
system a no
with
h a s ฺ
Database
backup
changes
ฺ a r) uide
ฺ c om ent G
Test
a on tud
database
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
System Architecture: c
liReplay
l o
rcereplaying the workload on the replay system, be sure to do the following:
Before
a
M 1. Restore the replay database on a test system to match the capture database at the start of the
workload capture.
2. Make changes (such as performing an upgrade) to the test system as needed.
3. Copy the workload to the test system.
The workload recording is consumed by a special application called the replay driver, which sends
requests to the RDBMS on which the workload is replayed. The RDBMS on which the workload is
replayed is usually a test system. It is assumed that the database of the replay system is suitable for
the replay of the workload that was recorded. The internal RDBMS clients are not replayed. The
replay driver is a special client that consumes the workload recording and sends appropriate requests
to the test system to make it behave as if the external requests were sent by the clients used during
the recording of the workload (see previous example). The use of a special driver that acts as the sole
external client to the RDBMS enables the record-and-replay infrastructure to be client agnostic.
The replay driver consists of one or more clients that connect to the replay system and the replay
driver sends requests based on the workload capture. The replay driver equally distributes the
workload capture streams among all the replay clients based on the network bandwidth, CPU, and
memory capability.
Clients/app servers
Supported changes:
• Database upgrades, patches ble
• Schema, parameters
Production
fe r a
system
ans
• RAC nodes, interconnect
n - t r
• OS platforms, OS upgrades
a no
• CPU, memory h a s ฺ
Production
• Storage ฺ a u ide
r) database
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
Prechange Production licSystem
l o
rce Replay focuses on recording and replaying the workload that is directed to the RDBMS.
Database
a
MTherefore, recording the workload is done at the point indicated in the diagram in the slide.
Recording at the RDBMS in the software stack makes it possible to exchange anything below this
level and test the new setup using the record-and-replay functionality.
While replaying the workload, the RDBMS performs the actions observed during recording. In other
words, during the replay phase the RDBMS code is exercised in a way that is very similar to the way
it was exercised during the recording phase. This is achieved by re-creating all external client
requests to the RDBMS. External client requests include all the requests by all possible external
clients of the RDBMS.
• Supported:
– All SQL (DML, DDL, PL/SQL) with practically all types of
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
binds
– Full LOB functionality (cursor-based and direct OCI)
– Local transactions
– Logins and logoffs
– Session switching
– Limited PL/SQL RPCs e
• Limitations: r a bl
ns fe
– Direct path load of data from external files using utilities
r a
n - t
– Advanced replication streams o
– Non-PL/SQL-based Advanced Queuing an
(AQ)
s
– Flashback queries r ) ha deฺ
– m
Oracle Call Interface (OCI)–based ฺa object
G uinavigations
n ฺ co ent
– Non-SQL-based object
@ ao Stud
access
– ille
Distributed transactions
ฺz se th
is
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
Supported Workloads lic
l o
ce shows supported and nonsupported database operations.
Therslide
a
M The following types of client requests are not captured in a workload:
• Direct path load of data from external files using utilities such as SQL*Loader
• Advanced replication streams
• Non-PL/SQL-based Advanced Queuing (AQ)
• Flashback queries
• Oracle Call Interface (OCI)–based object navigations
• Non-SQL-based object access
• Distributed transactions (any distributed transactions that are captured will be replayed as local
transactions)
Note: SQL-based XML manipulations are also captured. The system only captures explicit SQL
statements (SQL statements issued by clients). Implicit calls generated by the database itself are not
captured. For example, auditing is implicit, like background processes activity is implicit.
• Database restart:
– Only way to guarantee authentic replay
— Startup restrict
— Capture will un-restrict
– May not be necessary depending on the workload
• A way to restore database for replay purposes:
– Physical restore (scn/time provided) e
– Logical restore of application data r a bl
– Flashback/snapshot standby
fe ns
- t r a
• Filters can be specified to capture subset of the workload.
n o n
• SYSDBA or SYSOPER privileges and appropriate OSaprivileges
s
ha deฺ
Overhead: r
ฺa Gui)
• Performance overhead for TPCC is o m
4.5%
• Memory overhead : 64 KB perosession n ฺc dent
@ a Stu
• Disk space
z i l l e t h is
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Zi l
Capture Considerations lic
l o
e the following tasks in the planning phase of the workload recording:
Yourc
perform
a
M • Check the database backup strategy, ensuring that the database can be restored to StartSCN
when the recording starts.
• Plan the capture period by selecting it based on the application and the peak periods. You can
use existing manageability features such as Automatic Workload Repository (AWR) and Active
Session History (ASH) to select an appropriate period based on workload history. The starting
time for capture should be carefully planned because it is recommended that you shut down and
restart the database before starting the capture.
• Specify the location of the workload capture data. You must set up a directory that is to be used
to store the workload capture data. You should provide ample disk space because the recording
stops if there is insufficient disk space. However, everything captured up to that point is usable
for replay.
• Define capture filters for user sessions that are not to be captured. You can specify a recording
filter to skip sessions that should not be captured.
• No new privileges or user roles are introduced with the Database Replay functionality. The
recording user and replay user must have either the SYSDBA or SYSOPER privilege. This is
because only a user having SYSOPER or SYSDBA can start up or shut down the database to start
the recording. Correct operating system (OS) privileges should also be assigned so that the user
is able to access the recording, replay directories, and manipulate the files under those
directories.
Oracle Database 11g: New Features for Administrators 11 - 11
Replay Considerations
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Synchronized replay:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
bl e
— >100%: Lower request rate
fe r a
• Workload scale-up during replay: ans
n - t r
no
– Replay captured session concurrently for specified
a
number of times.
h a s ฺ
a
– Only one session in each set of ฺidentical de sessions
r) uireplay
m nt G
ฺco updates.
will execute both queries and
on tude
a
@ is S
i l l e
l o ฺz se th
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Replay Options
l
Zi (continued)
lic
l o
ce THINK_TIME_SCALE parameter scales the elapsed time between two successive user
• rThe
a
M calls from the same session; it is interpreted as a percentage value. Use this parameter to
increase or decrease the replay speed. Setting this parameter to 0 will send user calls to the
database as fast as possible during replay. The default value is 100.
• The THINK_TIME_AUTO_CORRECT parameter corrects the think time (based on the
THINK_TIME_SCALE parameter) between calls, when user calls take longer to complete
during replay than during capture. Its value can be TRUE or FALSE.
Note: During workload capture, elapsed time is measured by user time and user think time. User
time is the elapsed time of a user call to the database. User think time is the elapsed time while the
user waits between issuing calls. During workload replay, elapsed time is measured by user time,
user think time, and synchronization time.
• The SCALE_UP_MULTIPLIER parameter defines the number of times the workload is scaled
up during replay. Each captured session will be replayed concurrently for as many times as
specified by this parameter. However, only one session in each set of identical replay sessions
will execute both queries and updates. The rest of the sessions will only execute queries.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
• Data divergence
– Number of rows compared for each call (queries, DML)
• Error divergence:
– New errors
– Mutated errors
– Errors that have disappeared ble
fe r a
• Performance: s
– Capture and Replay report - t r an
no n
– ADDM report a
s ฺ
h a
– ASH report for skew analysis
ฺ a r) uide
– AWR report com t G n ฺ e n
o
a Stu d
l l e@ is
ฺ z i t h
e loCopyright u e
s2009,
a r c t o © Oracle. All rights reserved.
l e (m ense
Zi
Replay Analysis
l lic
l o
e be some divergence of the replay compared to what was recorded. For example, when
rcmay
There
a
Mreplaying on a newer version of the RDBMS, a new algorithm may cause specific requests to be
faster, resulting in divergence appearing as a faster execution. This is considered a desirable
divergence. Another example of a divergence is when a SQL statement returns fewer rows during
replay than those returned during recording. This is clearly undesirable.
For data divergence, the result of an action can be considered as:
• The result set of SQL query
• An update to persistent database state
• A return code or error code
Performance divergence is useful in determining how new algorithms introduced in the replay
system may affect overall performance. There are numerous factors that can cause replay divergence.
Though some of them cannot be controlled, others can be mitigated. It is the task of the DBA to
understand the workload run-time operations and take the necessary actions to reduce the level of
record-and-replay divergence.
Online divergence should aid the decision to stop a replay that has diverged significantly. The results
of the replay before the divergence may still be useful, but further replay would not produce reliable
conclusions. Offline divergence reporting is used to determine how successful the replay was after
the replay has finished.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
Accessing Database ic
lReplay
l o
rce Manager provides you with a user interface to manage each component in the Database
Enterprise
a
MReplay process. The workflow and user interface applies to both Enterprise Manager Database
Control and Enterprise Manager Grid Control.
You access Database Replay on the “Software and Support” tab of Database Control.
On the Database Replay page, you can perform the following named tasks:
• Capture Workload
• Preprocess Capture Workload
• Replay Workload
• View Workload Capture History: Click this link to view or delete the history of all workload
captures.
• Active Capture and Replay: If a capture or replay is currently in progress, this table appears at
the bottom of the page even if there are no rows. To view the status of the capture or replay,
select the name and click View, or just click the Name link.
RAC Note: When an instance goes down during capture of a RAC system, the capture continues
normally and is not aborted. The sessions that died as a result of an instance going down will be
replayed up to the point at which the instance died. When a dead instance is repaired and comes up
again during capture, all new sessions are recorded normally. During replay, the death of instances is
not replayed.
• •
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
DBMS_WORKLOAD_CAPTURE DBMS_WORKLOAD_REPLAY
– START_CAPTURE – PROCESS_CAPTURE
– FINISH_CAPTURE – INITIALIZE_REPLAY
– ADD_FILTER – PREPARE_REPLAY
– DELETE_FILTER – START_REPLAY
– DELETE_CAPTURE_INFO – CANCEL_REPLAY
– GET_CAPTURE_INFO() – DELETE_REPLAY_INFO
a b le
– EXPORT_AWR – REMAP_CONNECTION sfe
r
n
– IMPORT_AWR() – EXPORT_AWR n-tra
– REPORT() – IMPORT_AWRa no
h a s ฺ
– GET_REPLAY_INFO
–ฺ a r) uide
ฺ c om– eCOMPARE_PERIOD_REPORT
n tG
REPORT
n d
ao Stu
l @
le this
ฺ z i
e loCopyright u e
s2009,
a r c t o © Oracle. All rights reserved.
l e (m ense
Packages and
l
Zi Procedures
lic
l o
e the EXECUTE privilege on the capture and replay packages to execute these packages.
Yourc
need
a
MThese privileges are usually assigned by the DBA.
Note: For further details about the DBMS_WORKLOAD packages, see the Oracle Database PL/SQL
Packages and Types Reference 11g.
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Database Replay:
l
Zi PL/SQL lic Example
l o
rceexample, the ADD_FILTER procedure adds a filter named sessfilt that will filter out all
In this
a
Msessions belonging to the user name JFV.
To start the workload capture, use the START_CAPTURE procedure. In this example, a capture
named june_peak is captured and stored in a directory named jun07. Because the duration
parameter is not specified, the workload capture continues until the FINISH_CAPTURE procedure
is called. At this point, you can run your workload.
To stop the workload capture, use the FINISH_CAPTURE procedure. This procedure finalizes the
workload capture and returns the database to a normal state.
You can now generate a capture report by using the REPORT function.
To preprocess a captured workload, use the PROCESS_CAPTURE procedure. In this example, the
captured workload stored in the jun07 directory is preprocessed.
When finished, you can start your replay clients.
To initialize replay data, use the INITIALIZE_REPLAY procedure. Initializing replay data loads
the necessary metadata into tables required by the workload replay. For example, captured
connection strings are loaded into a table where they can be remapped for replay. In this example, the
INITIALIZE_REPLAY procedure loads preprocessed workload data from the jun07 directory
into the database.
DECLARE
cap_id NUMBER;
ble
rep_id NUMBER;
fe r a
rep_rpt CLOB;
an s
BEGIN
n - t r
no
cap_id := DBMS_WORKLOAD_REPLAY.GET_REPLAY_INFO(dir => 'jun07');
/* Get the latest replay for that capture */
a
s ฺ
SELECT max(id) INTO rep_id
h a
FROM dba_workload_replays
WHERE capture_id = cap_id; ฺ a r) uide
c om ent G
rep_rpt := DBMS_WORKLOAD_REPLAY.REPORT(replay_id => rep_id,
ฺ
on tud
format => DBMS_WORKLOAD_REPLAY.TYPE_TEXT);
a
END;
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Database Replay:
l
Zi PL/SQL lic Example (continued)
l o
rce connections, use the REMAP_CONNECTION procedure. In this example, the connection
To remap
a
Mthat corresponds to the connection ID 101 will use the new connection string defined by the
replay_connection parameter.
To prepare workload replay on the replay system, use the PREPARE_REPLAY procedure. In this
example, the PREPARE_REPLAY procedure prepares the j_r replay to preserve the COMMIT order
in the workload capture.
To start a workload replay, use the START_REPLAY procedure. To stop a workload replay, use the
REPLAY_CANCEL procedure
To generate a workload replay report, use the REPORT function as shown in the slide.
Marc
le
oZ
i l l l
m a r c e
e ( icens
e
z i
to
l @
loฺ use
n
le this
ฺ
m
ao Stud
r )
co ent
s
ฺa Gui
ha deฺ
an
on - t r an
s
fe r a bl
e
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Workload
Accept profiles
SQL Tuning
Advisor 4rab
le
Automatic High load fe
Generatera n s
n -t
SQL profiles
o
2
s an
ADDM r ) ha deฺ
m ฺa Gui DBA
o
ฺc den t 3
o
a Stun Run SQL Tuning Advisor
e @ s
ฺ z ill t hi
eloCopyright e
u©s2009, Oracle. All rights reserved.
a r c t o
l e (m ense
SQL TuningZ
l
ini OracleliDatabase
c 10g
l o
rceDatabase 10g introduced SQL Tuning Advisor to help DBAs and application developers
Oracle
a
Mimprove the performance of SQL statements. The advisor targets the problem of poorly written SQL,
in which SQL statements have not been designed in the most efficient fashion. It also targets the
(more common) problem in which a SQL statement is performing poorly because the optimizer
generated a poor execution plan due to a lack of accurate and relevant data statistics. In all cases, the
advisor makes specific suggestions for speeding up SQL performance, but it leaves the responsibility
of implementing the recommendations to the user.
In addition to SQL Tuning Advisor, Oracle Database 10g has an automated process to identify high-
load SQL statements in your system. This is done by the Automatic Database Diagnostic Monitor
(ADDM), which automatically identifies high-load SQL statements that are good candidates for
tuning.
However, major issues still remain: Although it is true that ADDM identifies some SQL that should
be tuned, users must manually look at ADDM reports and run SQL Tuning Advisor on those reports
for tuning.
AWR
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
To
p
SQ
L
Workload Auto matic
1
ble
fe r a
ans
SQL Tuning n - t r
a no
s ฺ
R
a
ep
h
or
4
r) uide
ts
ฺ a
ฺ c om ent G
a on tud DBA
e @ s S
ฺ z ill t hi
eloCopyright e
u©s2009, Oracle. All rights reserved.
a r c t o
l e (m ense
Automatic SQL
l
Zi Tuning licin Oracle Database 11g
l o
rceDatabase 11g further automates the SQL Tuning process by identifying problematic SQL
Oracle
a
Mstatements, running SQL Tuning Advisor on them, and implementing the resulting SQL profile
recommendations to tune the statement without requiring user intervention. Automatic SQL Tuning
uses the AUTOTASK framework through a new task called “Automatic SQL Tuning” that runs
every night by default.
Here is a brief description of the automated SQL tuning process in Oracle Database 11g:
• Step 1: Based on the AWR Top SQL identification (SQLs that were top in four different time
periods: the past week, any day in the past week, any hour in the past week, or single response
time), Automatic SQL Tuning targets statements for automatic tuning.
• Steps 2 and 3: While the Automatic SQL Tuning task is executing during the maintenance
window, the previously identified SQL statements are automatically tuned by invoking SQL
Tuning Advisor. As a result, SQL profiles will be created for them if needed. However, before
making any decision, the new profile is carefully tested.
• Step 4: At any point in time, you can request a report about these automatic tuning activities.
You then have the option of checking the tuned SQL statements to validate or remove the
automatic SQL profiles that were generated.
The Oracle Tuning Pack includes the Automatic SQL Tuning feature.
AWR
Weekly Daily Hourly Avrg execution
Candidate list
ble
fe r a
1. Pull the top queries from the past week into four buckets:
y Top for the past week t r a ns
o n -
y Top for any day in the past week
a n
y Top in any single hour s
ha deฺ
y Top by average single execution r )
ฺa Gui
2. Combine four buckets intoฺc onem
o (assigning
n t weights).
n e
o
3. Cap at 150 queries perabucket.tud @ is S
i l l e
l o ฺz se th
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi SQL
Selecting Potential lic Statements for Tuning
l o
rceDatabase 11g analyzes the statistics in the AWR and generates a list of potential SQL
Oracle
a
Mstatements that are eligible for tuning. These statements include repeating high-load statements that
have a significant impact on the system. Only SQL statements that have an execution plan with a
high potential for improvement will be tuned. Recursive SQL and statements that have been tuned
recently (in the last month) are ignored, as are parallel queries, DMLs, DDLs, and SQL statements
with performance problems that are caused by concurrency issues.
The SQL statements that are selected as candidates are then ordered based on their performance
impact. The performance impact of a SQL statement is calculated by summing the CPU time and the
I/O times captured in the AWR for that SQL statement in the past week.
Pick
… candidate
Tune Test Accept Tune …
S1 P1 P1 S2
SQL
bl e
fe r a
One hour maximum (by default)
ans
n - t r
Maintenance
a no
window
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
i
MaintenanceZWindow
l c
liTimeline
l o
a ce
TherAutomatic SQL Tuning process takes place during the maintenance window. Furthermore, it
Mruns as part of a single AUTOTASK job on a single instance to avoid concurrency issues. This is
portrayed in the slide for one scenario.
In this scenario, at some time after the beginning of the maintenance window, AUTOTASK starts the
Automatic SQL Tuning job (SYS_AUTO_SQL_TUNING_TASK). The first thing that the job does is
to generate a list of candidate SQL for tuning, according to the AWR source. When the list is
complete, the job tunes each statement in order of importance, one after another, considering only
one statement at a time. In this scenario, it first tunes S1, which has a SQL profile recommendation
(P1) generated for it by SQL Tuning Advisor. After P1 has been successfully tested, it is accepted
and the job moves on to the next statement, S2.
By default, Automatic SQL Tuning runs for at most one hour during a maintenance window. You
can change this setting by using a call similar to the following:
DBMS_SQLTUNE.SET_TUNING_TASK_PARAMETER('SYS_AUTO_SQL_TUNING_TASK',
'TIME_LIMIT', 7200);
Note: The widths of boxes in the slide do not indicate relative execution times. Tuning and test
execution should be the most expensive processes by far, with all the others completing relatively
quickly.
Restructure
SQL SQL profile
Existing N 3X Y
benefit? Accept profile
Indexes profile?
N
bl e
Y
fe r a
3X N
ans
benefit?
n - t r
Ignore new profile
Stale
n o
stats
Y
s ฺa
h a
ฺ a r) profile
Replace
u ide
ฺ c om ent G
GATHER_STATS_JOB
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Automatic Tuning
l
Zi Process lic
l o
e list of candidate SQL statements already built and ordered, the statements are then tuned
rcthe
With
a
Musing SQL Tuning Advisor. During the tuning process, all the recommendation types are considered
and reported, but only SQL profiles can be implemented automatically (when the
ACCEPT_SQL_PROFILES task parameter is set to TRUE). Otherwise, only the recommendation to
create a SQL profile will be reported in the automatic SQL tuning reports.
In Oracle Database 11g, the performance improvement factor has to be at least three before a SQL
profile is implemented. As we have already mentioned, the Automatic SQL Tuning process
implements only SQL profile recommendations automatically. Other recommendations (to create
new indexes, refresh stale statistics, or restructure SQL statements) are generated as part of the SQL
tuning process but are not implemented. These are left for the DBA to review and implement
manually, as appropriate.
Here is a short description of the general tuning process:
Tuning is performed on a per-statement basis. Because only SQL profiles can be implemented, there
is no need to consider the effect of such recommendations on the workload as a whole. For each
statement (in order of importance), the tuning process carries out each of the following steps:
1. Tune the statement by using SQL Tuning Advisor. Look for a SQL profile and, if it is found,
verify that the base optimizer statistics are current for it.
thresholds here apply to the sum of CPU and I/O time, SQL profiles are not accepted when
there is degradation in either statistic. So the requirement is that there is a three-times
improvement in the sum of CPU and I/O time, with neither statistic becoming worse. In this
way, the statement runs faster than it would without the profile, even with contention in
CPU or I/O.
3. If stale or missing statistics are found, make this information available to
GATHER_STATS_JOB.
Automatic implementation of tuning recommendations is limited to SQL profiles because they have
a b le
fewer risks. It is easy for a DBA to revert the implementation.
s f er
Note: All SQL profiles are created in the standard EXACT mode. They are matched
- t r aandn tracked
according to the current value of the CURSOR_SHARING parameter. DBAs o arenresponsible for
n
setting CURSOR_SHARING appropriately for their workload. sa
ha deฺ
r )
ฺa Gui
m
co ent
n ฺ
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
• Autotask configuration:
– On/off switch
– Maintenance windows running tuning task
– CPU resource consumption of tuning task
• Task parameters:
– SQL profile implementation automatic/manual switch
a b le
– Global time limit for tuning task s f er
– Per-SQL time limit for tuning task - t r an
n o n
– Test-execute mode disabled to save time a
h a s ฺ
– Maximum number of SQL profilesrautomatically e
implemented per execution asmwell ฺa )asGoverall
uid
n ฺ co ent
– Task execution expiration
o
@ud
period
a St
z i l l e t h is
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Controlling the
l
Zi Automatic
lic SQL Tuning Task
l o
e set parameters for the Automatic SQL Tuning task by using the
Yourc
can
a
MDBMS_SQLTUNE.SET_TUNING_TASK_PARAMETER procedure. An example is presented on the
next page.
BEGIN
dbms_sqltune.set_tuning_task_parameter('SYS_AUTO_SQL_TUNING_TASK',
'LOCAL_TIME_LIMIT', 1400);
dbms_sqltune.set_tuning_task_parameter('SYS_AUTO_SQL_TUNING_TASK',
'ACCEPT_SQL_PROFILES', 'TRUE');
dbms_sqltune.set_tuning_task_parameter('SYS_AUTO_SQL_TUNING_TASK',
'MAX_SQL_PROFILES_PER_EXEC', 50);
ble
dbms_sqltune.set_tuning_task_parameter('SYS_AUTO_SQL_TUNING_TASK',
fe r a
'MAX_AUTO_SQL_PROFILES', 10002);
ans
END;
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Zi l
Example: Controlling c Automatic SQL Tuning Task
lithe
l o
rcisea PL/SQL control example for the Automatic SQL Tuning task:
Here
a
MBEGIN
dbms_sqltune.set_tuning_task_parameter('SYS_AUTO_SQL_TUNING_TASK',
'LOCAL_TIME_LIMIT', 1400);
dbms_sqltune.set_tuning_task_parameter('SYS_AUTO_SQL_TUNING_TASK',
'ACCEPT_SQL_PROFILES', 'TRUE');
dbms_sqltune.set_tuning_task_parameter('SYS_AUTO_SQL_TUNING_TASK',
'MAX_SQL_PROFILES_PER_EXEC', 50);
dbms_sqltune.set_tuning_task_parameter('SYS_AUTO_SQL_TUNING_TASK',
'MAX_AUTO_SQL_PROFILES', 10002);
END;
The last three parameters in this example are supported only for the Automatic SQL Tuning task.
You can also use parameters such as LOCAL_TIME_LIMIT, or TIME_LIMIT, which are valid
parameters for the traditional SQL tuning tasks. One important example is to disable test-execute
mode (to save time) and to use only execution plan costs to decide about the performance by using
the TEST_EXECUTE parameter.
In addition, you can control when the Automatic SQL Tuning task runs and the CPU resources that it
is allowed to use.
You can view the parameter values by querying DBA_ADVISOR_PARAMETERS.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Automatic SQL
l
Zi Tuning licTask
l o
rcealready been mentioned, Automatic SQL Tuning is implemented as an automated
As has
a
Mmaintenance task that is itself called Automatic SQL Tuning. You can see some high-level
information about the last runs of the Automatic SQL Tuning task by going to the Automated
Maintenance Tasks page: On your Database Control home page, click the Server tab and, when you
are on the Server page, click the Automated Maintenance Tasks link in the Tasks section.
On the Automated Maintenance Tasks page, you see the predefined tasks. You then access each task
by clicking the corresponding link to get more information about the task itself (illustrated in the
slide). When you click either the Automatic SQL Tuning link or the latest execution icon (the green
area on the timeline), you go to the Automatic SQL Tuning Result Summary page.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
ConfiguringZ i l
Automatic licSQL Tuning
l o
e configure various Automatic SQL Tuning parameters by using the Automatic SQL Tuning
Yourccan
a
MSettings page.
To get to that page, click the Configure button on the Automated Maintenance Tasks page. This takes
you to the Automated Maintenance Tasks Configuration page, where you can see the various
maintenance windows that are delivered with Oracle Database 11g.
By default, Automatic SQL Tuning executes on all predefined maintenance windows in the
MAINTENANCE_WINDOW_GROUP. You can disable it for specific days in the week. On this page,
you can also edit each Window to change its characteristics. You can do so by clicking Edit Window
Group.
To get to the Automatic SQL Tuning Settings page, click the Configure button on the line
corresponding to Automatic SQL Tuning in the Task Settings section.
On the Automatic SQL Tuning Settings page, you can specify the parameters shown in the slide. By
default, “Automatic Implementation of SQL Profiles” is deactivated.
Note: If you set STATISTICS_LEVEL to BASIC, turn off the AWR snapshots by using
DBMS_WORKLOAD_REPOSITORY, or if AWR retention is less than seven days, you also stop
Automatic SQL Tuning.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Automatic SQL
l
Zi Tuning licResult Summary
l o
rce the Automatic SQL Tuning Result Summary page contains various summary graphs so
In addition,
a
Mthat you can control the Automatic SQL Tuning task. An example is given in the slide. The first chart
in the Overall Task Statistics section shows you the breakdown by finding types for the designated
period of time. You can control the period of time for which you want the report to be generated by
selecting a value from the Time Period list. In the example, Customized is used; it shows you the
latest run. You can choose All to cover all executions of the task so far. Users can request it for any
time period over the past month, since that is the amount of time for which the advisor persists its
tuning history. You then generate the report by clicking View Report.
On the “Breakdown by Finding Type” chart, you can clearly see that only SQL profiles can be
implemented. Although many more profiles were recommended, not all of them were automatically
implemented for the reasons that we already explained. Similarly, recommendations for index
creation and other types are not implemented. However, the advisor keeps historical information
about all the recommendations if you want to implement them later.
In the Profile Effect Statistics section, you can see the Tuned SQL DB Time Benefit chart, which
shows you the before-and-after DB Time for implemented profiles and other recommendations.
MY_REPT
--------------------------------------------------------------------------------
GENERAL INFORMATION SECTION
ble
Tuning Task Name : SYS_AUTO_SQL_TUNING_TASK
fe r a
Tuning Task Owner
Workload Type
: SYS
: Automatic High-Load SQL Workload
ans
Scope : COMPREHENSIVE
n - t r
Global Time Limit(seconds)
Per-SQL Time Limit(seconds)
: 3600
: 1200
a no
…
h a s ฺ
Number of SQLs with Statistic Findings : 1
Number of SQLs with SQL profiles recommended : 2
ฺ a r) uide
Number of SQLs with SQL profiles implemented : 2
ฺ c om ent G
on tud
Number of SQLs with Index Findings : 1
Number of SQLs with Errors
… a
: 1
@ is S
i l l e
l o ฺz se th
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Using the PL/SQL
l
Zi Interface
lic to Generate Reports
l o
ce in the slide shows how to generate a text report to display all SQL statements that were
Therexample
a
Manalyzed in the most recent execution, including recommendations that were not implemented. All
sections of the report are included.
Depending on the sections that were included in the report, you can view information about the
automatic SQL tuning task in the following sections of the report:
• The general information section provides a high-level description of the automatic SQL tuning
task, including information about the inputs given for the report, the number of SQL statements
tuned during the maintenance, and the number of SQL profiles that were created.
• The summary section lists the SQL statements (by their SQL identifiers) that were tuned during
the maintenance window and the estimated benefit of each SQL profile, or their actual execution
statistics after test-executing the SQL statement with the SQL profile.
• The Tuning findings section gives you all findings and statistics that are associated with each
SQL statement, as well as whether profiles were accepted (and why).
• The Explain plans section shows the old and new explain plans used by each SQL statement
analyzed by SQL Tuning Advisor.
• The Errors section lists all errors encountered by the Automatic SQL Tuning task.
Note: Obtain the execution list by using the following command:
select execution_name,status,execution_start,execution_end
from dba_advisor_executions
where task_name='SYS_AUTO_SQL_TUNING_TASK';
Oracle Database 11g: New Features for Administrators 12 - 18
Automatic SQL Tuning Considerations
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Marc
le
oZ
i l l l
m a r c e
e ( icens
e
z i
to
l @
loฺ use
n
le this
ฺ
m
ao Stud
r )
co ent
s
ฺa Gui
ha deฺ
an
on - t r an
s
fe r a bl
e
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Intelligent Infrastructure
Enhancements
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
•
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
DBA_HIST_DB_CACHE_ADVICE
• DBA_HIST_DISPATCHER
• DBA_HIST_DYN_REMASTER_STATS
• DBA_HIST_IOSTAT_DETAIL
• DBA_HIST_SHARED_SERVER_SUMMARY
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Using New i l
ZAutomatic lic Workload Repository Views
e l o
a rcfollowing
The new AWR statistics views are available in Oracle Database 11g Release 2:
M • DBA_HIST_DB_CACHE_ADVICE: Displays historical predictions of the number of
physical reads for the cache size corresponding to each row
• DBA_HIST_DISPATCHER: Displays historical information for each dispatcher process
at the time of the snapshot
• DBA_HIST_DYN_REMASTER_STATS: Displays statistical information about the
dynamic remastering process
• DBA_HIST_IOSTAT_DETAIL: Displays historical I/O statistics aggregated by file type
and function
• DBA_HIST_SHARED_SERVER_SUMMARY: Displays historical information for shared
servers, such as shared server activity, common queues, and dispatcher queues
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Options
BaselineoDisplay lic
l
e for any defined baseline in the past is available in Oracle Database 11g. The baseline
The
a rcdata
M data may be displayed on the Performance page of Enterprise Manager. You have three
display options:
• Do not show baseline information.
• Show the information from a specified static baseline.
• Show the information from the system moving baseline.
Note: The system moving window baseline becomes valid after sufficient data has been
collected and the statistics calculation occurs. By default, the statistics calculation is scheduled
for every Saturday at midnight.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
CreatingoAWR
l
Zi Baselines
lic
l
e create two types of AWR baselines: single and repeating. The “Create Baseline:
You
a rccan
M Baseline Interval Type” page gives the following explanations.
The single type of baseline has a single and fixed time interval: for example, from Jan 1, 2007,
at 10:00 AM, to Jan 1, 2007, at 12:00 PM. The repeating type of baseline has a time interval
that repeats over a time period: for example, every Monday from 10:00 AM to 12:00 PM for
the year 2007.
To view the AWR Baseline page, click the AWR Baselines link on the Server tab of the
Database Instance page. On the Baseline page, click Create and follow the wizard to create
your baseline.
Note: Before you can set up AWR baseline metric thresholds for a particular baseline, you
must compute the baseline statistics. Select Schedule Statistics Computation from the actions
menu to compute the baseline statistics. There are several other actions available.
….. T4 T5 T6 ….. Tx Ty Tz
ble
BEGIN
fe r a
DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE (ans
o n -tr
start_time => to_date('21-JUN-2010','DD-MON-YYYY'),
end_time s an
=> to_date('21-SEP-2010','DD-MON-YYYY'),
baseline_name => 'FALL10', r ) ha deฺ
template_name => 'FALL10', m ฺa Gui
=> NULL ) ;nฺc
o ent
expiration
o d
END; @a Stu l le this
ฺ z i
e loCopyright u e
s2009,
a r c t o © Oracle. All rights reserved.
l e (m ense
GenerateoaZ i l
Baseline licTemplate for a Single Time Period
l
ce Database 11g you can create a template for how baselines are to be created for
In
a rOracle
M different time periods in the future, for predictable schedules. If any part of the period is in the
future, use the CREATE_BASELINE_TEMPLATE procedure.
For the baseline template, when the end time becomes a time in the past, a task using these
inputs automatically creates a baseline for the specified time period when the time comes. The
example creates a baseline template that creates a baseline when 0:0:0 21-Sep-2010 is in the
past.
Using time-based definitions in baseline creation does not require the start-snapshot and end-
snapshot identifiers. For the CREATE_BASELINE_TEMPLATE procedure, you can also now
specify an expiration duration for the baseline that is created from the template. The expiration
duration, specified in days, represents the number of days you want the baselines to be
maintained.
A value of NULL means that the baselines never expire.
To create a baseline over a period in the past, use the CREATE_BASELINE procedure (as in
Oracle Database 10g). The CREATE_BASELINE procedure has one new parameter:
expiration duration. Expiration duration has the same meaning as it does for
CREATE_BASELINE_TEMPLATE.
BEGIN
DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE (
day_of_week => 'SATURDAY',
hour_in_day => 6,
duration => 20,
start_time => to_date('21-JUN-2007','DD-MON-YYYY'),
end_time => to_date('21-JUN-2008','DD-MON-YYYY'),
a b le
baseline_name_prefix => 'SAT_MAINT_WIN'
s f er
template_name => 'SAT_MAINT_WIN',
- t r an
expiration => 90,
n on
dbid => NULL );
s a
END; )h a eฺ
ฺ a r uid
co entm G
n ฺ
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Creatingoa Z i l
Repeating licBaseline Template
l
e CREATE_BASELINE_TEMPLATE procedure to generate baseline templates that
Use
a rcthe
M automatically create baselines for a contiguous time period based on a repeating time schedule.
You can also specify whether you want the baseline to be automatically removed after a
specified expiration interval (expiration).
The example in the slide generates a template that creates a baseline for a period that
corresponds to each SATURDAY_MAINTENANCE_WINDOW for a year. The baseline is
created over a 20-hour period (duration) that starts at 6:00 AM (hour_in_day) each
Saturday (day_of_week). The baseline is named ‘SAT_MAINT_WIN’ with time
information appended to make the name unique. The template is named ‘SAT_MAINT_WIN’,
and each baseline will be kept for 90 days (expiration). This template is created for the
local database ( dbid => NULL ).
Use this baseline to compare the resources that are used each Saturday during the maintenance
window.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
Zi
BaselineoViews
l lic
l
e dictionary views supporting the AWR baselines have changed.
The
a rcdata
M DBA_HIST_BASELINE: Modified View
DBA_HIST_BASELINE has been modified to support the SYSTEM_MOVING_WINDOW
baseline and the baselines generated from templates. Additional information includes the date
created, time of last statistics calculation, and type of baseline.
DBA_HIST_BASELINE_DETAILS: New View
DBA_HIST_BASELINE_DETAILS displays information that allows you to determine the
validity of a given baseline, such as whether there was a shutdown during the baseline period
and the percentage of the baseline period that is covered by the snapshot data.
DBA_HIST_BASELINE_TEMPLATE: New View
DBA_HIST_BASELINE_TEMPLATE holds the baseline templates. This view provides the
information needed by MMON to determine when a baseline will be created from a template and
when the baseline should be removed.
For details, see Oracle Database Reference 11g.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Thresholds
DefiningoAlert lic Using Static Baseline
l
rceAWR baseline statistics are computed for a particular baseline, you can set metric
After
a
M thresholds specific to your baseline.
Compute baseline statistics directly from the Baselines page (as previously discussed). Then
go to the AWR Baseline Metric Thresholds page and select the type of metrics that you want
to set. When done, select a specific metric and click the icon in the Edit Thresholds column.
On the corresponding Edit AWR Baseline Metric Thresholds page, specify your thresholds in
the Thresholds Settings section, and then click Apply Thresholds.
You can specify thresholds based on the statistics computed for your baseline. In addition to
“Significance Level,” the other possibilities are “Percentage of Maximum” and “Fixed
Values.”
Note: After a threshold is set using Baseline Metric Thresholds, the previous threshold values
are forgotten forever and the statistics from the associated baseline are used to determine the
threshold values until they are cleared (by using the Baseline Metric Threshold UI or PL/SQL
interface).
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
l
Zi Manager
Using Enterprise lic to Quickly Configure Adaptive Thresholds
l o
rceDatabase 11g Enterprise Manager provides significant usability improvements in the
Oracle
a
Mselection of adaptive thresholds for database performance metrics, with full integration with
AWR baselines as the source for the metric statistics. Enterprise Manager offers a quick
configuration option in a one-click starter set of thresholds based on OLTP or Data Warehouse
workload profiles.
Make the selection of the appropriate workload profiles from the subsequent pop-up window.
By making this simple selection, the system automatically configures and evolves adaptive
thresholds based on the SYSTEM_MOVING_WINDOW baseline for the group of metrics that
best correspond to the chosen workload.
ble
10 p.m. – 2 a.m. Mon to Fri 6 a.m. – 2 a.m. Sat to Sun
fe r a
an s
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Maintenance
l
Zi Windowslic
l o
rceDatabase 10g introduced the execution of automated maintenance tasks during a
Oracle
a
M maintenance window. The automated tasks are statistics collection, segment advisor, and
Automatic SQL Tuning.
With Oracle Database 11g, the Automated Maintenance Tasks feature relies on the Resource
Manager being enabled during the maintenance windows. Thus the resource plan associated
with the window is automatically enabled when the window opens. The goal is to prevent
maintenance work from consuming excessive amounts of system resources. Each maintenance
window is associated with a resource plan that specifies how the resources will be allocated
during the window duration.
In Oracle Database 11g, WEEKNIGHT_WINDOW and WEEKEND_WINDOW (defined in Oracle
Database 10g) are replaced with daily maintenance windows. Automated tasks are assigned to
specific windows. All daily windows belong to MAINTENANCE_WINDOW_GROUP by default.
You may define other maintenance windows as well as change start times and durations for the
daily maintenance windows. Likewise, any maintenance windows that are deemed
unnecessary can be disabled or removed. The operations can be performed by using Enterprise
Manager or Scheduler interfaces.
NAME
--------------------------------
DEFAULT_MAINTENANCE_PLAN
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
Default Maintenance licPlan
l o
rcea maintenance window opens, the DEFAULT_MAINTENANCE_PLAN in the Resource
When
a
MManager is automatically set to control the amount of CPU used by the automated
maintenance tasks. To be able to give different priorities to each possible task during a
maintenance window, various consumer groups are assigned to
DEFAULT_MAINTENANCE_PLAN. The hierarchy between groups and plans is shown in the
slide.
For high-priority tasks:
• Optimizer Statistics Gathering automatic task is assigned to the
ORA$AUTOTASK_STATS_GROUP consumer group
• Segment Advisor automatic task is assigned to the ORA$AUTOTASK_SPACE_GROUP
consumer group
• Automatic SQL Tuning automatic task is assigned to the ORA$AUTOTASK_SQL_GROUP
consumer group
Note: If necessary, you can manually change the percentage of CPU resources allocated to the
various automated maintenance task consumer groups inside
ORA$AUTOTASK_HIGH_SUB_PLAN.
Run Job1 Run Job2 Run Job3 Run Job3 Run Job4
… with with with with with …
urgent urgent high medium medium
priority priority priority priority priority
urgent MMON
ble
Stats high
fe r a
Maintenance medium
an s
window
n - t r
ABP
Space
a no
h a s ฺ
SQL
ฺ a r) uide Job1 … Jobn
ฺ c om ent G
a on tud
DBA_AUTOTASK_TASK
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Automated i l
ZMaintenance lic Task Priorities
e l o
The
a rcAutomated Maintenance Tasks feature is implemented by Autotask Background Process
M (ABP). ABP functions as an intermediary between automated tasks and the Scheduler. Its main
purpose is to translate automated tasks into AUTOTASK jobs for execution by the Scheduler.
Just as important, ABP maintains a history of execution of all tasks. ABP stores its private
repository in the SYSAUX tablespace; you view the repository through
DBA_AUTOTASK_TASK.
ABP is started by MMON at the start of a maintenance window. There is only one ABP required
for all instances. The MMON process monitors ABP and restarts it if necessary.
ABP determines the list of jobs that need to be created for each maintenance task. This list is
ordered by priority: urgent, high, and medium. Within each priority group, jobs are arranged in
the preferred order of execution. ABP creates jobs in the following manner: all urgent-priority
jobs are created first, all high-priority jobs are created next, and all medium-priority jobs are
created last.
ABP assigns jobs to various Scheduler job classes. These job classes map the job to a
consumer group based on priority.
Note: With Oracle Database 11g, there is no job that is permanently associated with a specific
automated task. Therefore, it is not possible to use DBMS_SCHEDULER procedures to control
the behavior of automated tasks. Use the DBMS_AUTO_TASK_ADMIN procedures instead.
Oracle Database 11g: New Features for Administrators 13 - 22
Controlling Automatic Maintenance Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Controlling i l
ZAutomatic lic Maintenance Tasks
e l o
The
a rcAutomatic Maintenance Tasks feature determines when—and in what order—tasks are
M performed. As a DBA, you can control the following:
• If the maintenance window turns out to be inadequate for the maintenance workload,
adjust the duration and start time of the maintenance window.
• Control the resource plan that allocates resources to the automated maintenance tasks
during each window.
• Enable or disable individual tasks in some or all maintenance windows.
• In a RAC environment, shift maintenance work to one or more instances by mapping
maintenance work to a service. Enabling the service on a subset of instances shifts
maintenance work to these instances.
As shown in the slide, Enterprise Manager is the preferred way to control Automatic
Maintenance Tasks. However, you can also use the DBMS_AUTO_TASK_ADMIN package.
ble
fe r a
ans
OLTP DW/OLAP
n - t r
(Small random I/O) (Large sequential I/O)
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Important I/O
l
Zi Metrics licfor Oracle Databases
e l o
a rcfollowing
The provides a summary of the types of I/O issued by the Oracle Database
M processes.
The database I/O workload typically consists of small random I/O and large sequential I/O.
Small random I/O is more prevalent in an OLTP application environment in which each
foreground reads a data block into the buffer cache for updates and the changed blocks are
written in batches by the DBWn process. Large sequential I/O is common in an OLAP
application environment. The OLTP application performance depends on how fast a small I/O
is serviced, which depends on how fast the disk can spin and find the data. Large I/O
performance depends on the capacity of the I/O channel that connects the server to the storage
array; large I/O throughput is better when the capacity of the channel is larger.
IOPS (I/O per second): This metric represents the number of small random I/O that can be
serviced in a second. The IOPS rate mainly depends on how fast the disk media can spin. The
IOPS rate from a storage array can be increased either by adding more disk drives or by using
disk drives with a higher RPM (rotations per minute) rate.
MBPS (megabytes per second): The rate at which data can be transferred between the
computing server node and the storage array depends on the capacity of the I/O channel that is
used to transfer data. More data can be transferred through a wider pipe.
capacity of 128 MBPS. There are usually multiple disks in the NAS that can together provide
more than 128 MBPS. The channel resource becomes the limiting resource.
I/O latency: Latency is another important metric that is used in measuring the performance of
an I/O subsystem. Traditionally, latency is simply the time for the disk to access a particular
sector on the disk. But from the database point of view, latency represents all the time it takes
for a submitted I/O request to be serviced by the storage. In other words, it represents the
overhead before the first byte of a transfer arrives after an I/O request has been submitted. le
Latency values are more commonly used for small random I/O when tuning a system.eIfra
b
there
are too many I/O requests queued up against a disk, the latency increases as theawait n sftime in
-tr across
the queue increases. To improve the latency of I/O requests, data is usuallynstriped
o
a ndisk. A higher latency
multiple spindles so that all I/O requests to a file do not go to the same
s
usually indicates an overloaded system.
r ) ha deฺ
Other than the main resources mentioned above, there m are ui storage array components
ฺa alsoGother
that can affect I/O performance. Array vendors n ฺ co caching
provide e n t mechanisms to improve read
throughput, but their real benefit is questionable
d
ao inSatudatabase environment because Oracle
e@ s
Database uses caches and read-ahead
ฺ z ill mechanisms
t hi so that data is available directly from RAM
rather than from the disks. elo us e
a rc to
m e
i l l e ( icens
e loZ l
M arc
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
I/O Calibration
l
Zi and lEnterprise
ic Manager
l o
To
a ce
rdetermine the previously discussed I/O metrics, you can use the I/O Calibration tool from
M the Enterprise Manager Performance page or PL/SQL. I/O Calibration is a modified version of
the ORION tool and is based on the asynchronous I/O library. Because calibration requires
issuing enough I/O to saturate the storage system, any performance-critical sessions will be
negatively impacted. Thus, you should run I/O calibration only when there is little activity on
your system.
I/O Calibration takes approximately 10 minutes to run. You can launch an I/O Calibration task
directly from Enterprise Manager by clicking the Performance tab. On the Performance page,
you can click the I/O tab and then the I/O Calibration button.
On the I/O Calibration page, specify the approximate number of physical disks attached to
your database storage system as well as the maximum tolerable latency for a single-block I/O
request. Then, in the Schedule section of the I/O Calibration page, specify when to execute the
calibration operation. Click the Submit button to create a corresponding Scheduler job.
On the Scheduler Jobs page, you can see the amount of time it takes for the calibration task to
run. When finished, view the results of the calibration operation on the I/O Calibration page:
maximum I/O per second, maximum megabytes per second, and average actual latency
metrics.
num_disks=>1, -
max_latency=>10, -
max_iops=>:max_iops, -
max_mbps=>:max_mbps, -
actual_latency=>:actual_latency);
• MAX_PMBPS: Maximum megabytes per second of large I/O requests that can be sustained
by a single process
• LATENCY: Latency for data block read requests
Usage notes:
• Only users with the SYSDBA privilege can run this procedure.
• Only one calibration can run at a time. If another calibration is initiated at the same time,
it fails.
• For a RAC database, the workload is simultaneously generated from all instances. rab
le
• The latency time is computed only when the TIMED_STATISTICS initialization n s fe
parameter is set to TRUE (which is set when STATISTICS_LEVEL is-set
n trato TYPICAL
or ALL).
a no
a s
h deฺ
r )
ฺa Gui
m
co ent
n ฺ
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e l oZ l
M arc
V$IOSTAT_FUNCTION
AWR and EM
. a ble
fe r
ans
V$IOSTAT_FILE
n - t r
a no
h a s ฺ
V$IOSTAT_CONSUMER_GROUP ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
I/O Statistics:
l
Zi Overview
lic
l o
To
a ce a consistent set of statistics for all I/O issued from an Oracle instance, Oracle Database
rgive
M 11g introduces a set of virtual views that collect I/O statistics in three dimensions:
• RDBMS components: Components are grouped by their functionality into 12 categories
(shown in the slide).
• When Resource Management is enabled, I/O statistics are collected for all consumer
groups that are part of the currently enabled resource plan.
• I/O statistics are also collected for the individual files that have been opened.
Each dimension has statistics for read and write operations. Since read/write can occur in
single block or multiblock operations, they are separated into four different operations (as
shown in the slide). For each operation type, the number of corresponding requests and the
amount of megabytes are cumulated. In addition to these, the total I/O wait time in
milliseconds and the number of total waits are also cumulated for both component and
consumer group statistics.
For file statistics, total service time in microseconds is accumulated, in addition to statistics for
single block reads.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
c e loฺ use
a r to
m e
i l l e ( icens
e loZ l
M arc
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
I/O Statistics
l
Zi and Enterprise
lic Manager
l o
e retrieve I/O statistics directly on the Performance page in Enterprise Manager. On the
You
a rccan
M Performance page, click the I/O subtab located under the Average Active Session graph.
On the I/O subpage, you see a breakdown of I/O statistics on three possible dimensions: I/O
Function, I/O Type, and Consumer Group. Select one of the options to look at the
corresponding dimension graphs. The slide shows the two graphs corresponding to the I/O
function dimension:
• I/O Megabytes per Second (by RDBMS component)
• I/O Requests per Second (by RDBMS component)
Note: The “Others” RDBMS component category corresponds to everything that is not
directly issued from SQL (for example, PL/SQL and Java).
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
I/O Statistics
l
Zi and Enterprise
lic Manager (continued)
l o
rcethe I/O Function statistic graphs, you can drill down to a specific component by clicking
From
a
M that component. In the example in the slide, you drill down to the Buffer Cache Reads
component. This takes you to the “I/O Rates by I/O Function” page, where you can see three
important graphs for that particular component: MBPS, IOPS, and wait time.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Resource Zi l
Manager ic
lEnhancements
l o
rceDatabase Resource Manager (the Resource Manager) enables you to optimize resource
Oracle
a
M allocation among concurrent database sessions. The new features in Oracle Database 11g
Release 2 enable you to use the Resource Manager for database consolidation and server
consolidation.
Instance Caging
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
32 16 Total Number
Instance D of CPUs = 16
Instance D
24 12 Instance C
Instance C Instance B
16 Total Number 8
of CPUs = 16
Instance B
ble
8 4 Instance A
fe r a
Instance A
ans
n - t r
a no
Over-provisioning approach: Partitioning
h a s approach:
ฺ has a
With all four instances active, r
Each ) instance
i d e
one instance can get m ฺa Gnumber
dedicated u of CPUs.
c o n t
8/(8+8+8+8)=25% of CPU.
a onฺ tude
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
InstanceoCaging
l
Zi Exampleslic
l
a rce
Over-provisioning approach: When a server is over-provisioned, the database instances can
Mimpact each other’s performance. However, instance caging limits their impact and helps to
provide predictable performance. In the example on the left, where all four instances have
CPU_COUNT set to 8, the maximum percentage of CPU that a database instance can consume
at any point in time is its own limit divided by the sum of the limits for all active databases. In
this example, one instance will be able to consume 8 / (8 + 8 + 8 + 8) = 25% of the CPU. If
only two instances are active, one instance will be able to consume 8 / (8 + 8) = 50% of the
CPU.
Partitioning approach: Instance caging can partition the CPU resources by ensuring that the
sum of all CPU limits does not exceed the total number of CPUs. In the example on the right,
if four database instances share a 16-CPU server, their limits can be set to 8, 4, 2, and 2. By
dedicating CPU resources to a database instance, partitioning provides two advantages:
• One database instance’s CPU load cannot affect another instance’s CPU load.
• Each database instance’s CPU resources is fixed, leading to more predictable
performance.
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
EnablingoInstance lic
Caging
l
e configure instance caging as follows:
You
a rccan
M • The CPU_COUNT parameter specifies the maximum (the limit), not actual amount of
CPU the database instance can use at any time.
• The Resource Manager limits the amount of CPU that the database instance consumes.
Because instance caging is simple to configure and does not require any new software to be
licensed or installed, it is an excellent alternative to other server consolidation tools, such as
virtualization and OS workload managers.
By default, the CPU Resource Manager assumes that the database instance can use all CPUs
on a server. To enable instance caging, any resource plan with CPU directives can be used.
Note: For case studies, see the Oracle White Paper: Database Instance Caging: A Simple
Approach to Server Consolidation.
l e (m ense
Monitoring i l
ZInstance licCaging
l o
rce
IfaCPU_COUNT has not been set, no value is returned by the first query in the slide.
M If no rows are returned by the second query in the slide, the Resource Management is off or
the Resource Manager is on, but not managing CPU. If a row is returned, it indicates the plan
being used.
Instance caging limits the CPU consumption of the foreground processes by throttling them. A
foreground process is throttled when it is waiting on the “resmgr:cpu quantum” wait event.
You can monitor the amount of throttling in two ways:
• The V$RSRCMGRMETRIC_HISTORY view shows the amount of CPU consumption and
throttling for each minute in the past hour. For each consumer group, the
CPU_CONSUMED_TIME parameter specifies the number of milliseconds of CPU was
consumed and the CPU_WAIT_TIME parameter specifies the number of milliseconds that
its processes were throttled.
• The V$RSRC_CONSUMER_GROUP view shows the amount of CPU consumption and
throttling since CPU Resource Management was enabled. CONSUMED_CPU_TIME and
CPU_WAIT_TIME measure time in milliseconds.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Zi l
Resource Manager: c
liChanges to DBMS_RESOURCE_MANAGER
e l o
The
a rcDBMS_RESOURCE_MANAGER PL/SQL interface has some deprecated and new
M parameters. For example, you should no longer use CPU_Pn parameters of the
CREATE_PLAN_DIRECTIVE procedure, but replace them by MGMT_Pn parameters. Use the
new SWITCH_FOR_CALL parameter instead of SWITCH_TIME_IN_CALL parameter of the
CREATE_PLAN_DIRECTIVE procedure. For more information refer to the Oracle Database
Administrator’s Guide.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Resource Zi l
Manager: c Enterprise Manager Interface
liNew
l o
rceEnterprise Manager, you can access the Resource Manager section from the Server
Using
a
M page.
The Resource Manager section is organized in the same way as the Database Resource
Manager. Clicking the Getting Started link takes you to the “Getting Started with Database
Resource Manager” page, which provides a brief description of each step as well as the links
to the corresponding pages.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Resource
l
Zi Created
Plans lic by Default
l o
rceyou create an Oracle 11g database, the Resource Plans (shown in the slide) are created
When
a
M by default. However, none of these plans are active by default.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Default Plan Zi l lic
l o
e shows the properties of DEFAULT_PLAN. Note that there are no limits for its
The
a rcslide
Mthresholds. As you can see, Oracle Database 11g introduces two new I/O limits that you can
define as thresholds in a Resource Plan.
BEGIN
dbms_resource_manager.clear_pending_area();
dbms_resource_manager.create_pending_area();
ble
dbms_resource_manager.create_plan(plan=>'TESTJFV',comment =>'',… );
dbms_resource_manager.create_plan_directive( fe r a
plan => 'TESTJFV',
ans
group_or_subplan => 'OTHER_GROUPS',
n - t r
comment => '',
a no
mgmt_p1 => 60, mgmt_p2 => NULL, mgmt_p3 => NULL, mgmt_p4 => NULL,
h a s ฺ
r) uide
mgmt_p5 => NULL, mgmt_p6 => NULL, mgmt_p7 => NULL, mgmt_p8 => NULL ,
parallel_degree_limit_p1 => NULL ,
ฺ a
switch_io_reqs => 20000 ,
ฺ c om ent G
switch_io_megabytes => 5000000, …);
a on tud
dbms_resource_manager.submit_pending_area();
END;
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
I/O Resource
l
Zi Limit Thresholds
lic
l o
rceyou create a Resource Plan directive, you can specify the I/O resource limits. The
When
a
M example in the slide shows how to do this in both Enterprise Manager and PL/SQL.
You can specify the following two arguments:
• switch_io_reqs: Specifies the number of I/O requests that a session can issue before
an action is taken. Default is NULL, which means unlimited.
• switch_io_megabytes: Specifies the amount of I/O (in MB) that a session can issue
before an action is taken. Default is NULL, which means unlimited.
ble
fe r a
ans
n - t r
a no
h a s ฺ
ฺ a r) uide
ฺ c om ent G
a on tud
l l e@ is S
i
ฺz se th
l o
a rce Copyright
t o u© 2009, Oracle. All rights reserved.
l e (m ense
Resource Zi l
Manager ic
lStatistics
l o
e also look at the Resource Manager Statistics page, which displays statistics for only
You
a rccan
M the current active plan.
ble
fe r a
ans
n - t r
o
s an
r ) ha deฺ
m ฺa Gui
n ฺ co ent
@ ao Stud
z i l le this
ฺ
loCopyright e
s2009,
r c e o u© Oracle. All rights reserved.
a t
l e (m ense
i l lic
el oZ
Marc
Marc
le
oZ
i l l l
m a r c e
e ( icens
e
z i
to
l @
loฺ use
n
le this
ฺ
m
ao Stud
r )
co ent
s
ฺa Gui
ha deฺ
an
on - t r an
s
fe r a bl
e