Professional Documents
Culture Documents
Principal Consultant
Product Technology
Services
Oracle Corporation
Oracle 10g
Database
Oracle Database 10g Goals
Easiest to Manage
Oracle Grid Computing
Application Server
Storage Grid Database Grid Grid
Grid
Control
Low cost
Highest quality of service
Rapidly adjusts to meet business needs
Unified management
Oracle Grid Computing
Application Server
Storage Grid Database Grid Grid
Grid
Control
Low cost
Highest quality of service
Rapidly adjusts to meet business needs
Unified management
Automatic Storage
Management (ASM) Storage Grid
Grid
Control
Low cost
Highest quality of service
Rapidly adjusts to meet business needs
Unified management
Database Server Grid –
Real Application Clusters Database Grid
Software Data
Maintenance 6% Loading 6%
Ongoing System
Management 55%
Install 6%
Create & Configure
12 %
Software Maintenance
6% Load Data 6%
Install 6%
Create & Configure
12 %
Software Maintenance
6% Load Data 6%
Install 6%
Create & Configure
12 %
Software Maintenance
6% Load Data 6%
System Resource
Management
Backup & Recovery
Management
CPU Utilization
Tapes, MTTR Memory Pools
Disaster Recovery Processes
Database Space
Database Backup & Recovery
Management Management
Management
Control
Intelligent
Infrastructure
Intelligent Infrastructure
Automatic Workload
Repository
Advisory – “Data Warehouse” of the
Infrastructure Database
– Code instrumentation
Server-generated Alert Infrastructure
Automatic Maintenance
Tasks
Automatic Maintenance Task – Pre-packaged, resource
Infrastructure controlled
Automatic Workload Repository Server-generated Alerts
– Push vs. Pull, Just-in-time,
Out-of-the-box
Advisory Infrastructure
– Integrated, uniformity
Automatic Database
Diagnostic Monitor (ADDM)
Performance expert in a box
Integrate all components
Application & SQL
together
Management Automatically provides
database-wide performance
Storage
Management
System Resource
Management
diagnostic, including RAC
Provides impact and benefit
analysis
Space
Backup & Recovery
Management Database Management Provides Information vs. raw
Management data
Intelligent Infrastructure Runs proactively
Real-time results using the
Time Model
ADDM’s Architecture
Snapshots in
Instrument database code
Automatic Workload paths to produce Time &
Repository Wait Model
Classification Tree is based
Automatic Diagnostic
Self-Diagnostic Engine
Engine on decades of Oracle
performance tuning
expertise
Pinpoint root cause and
non-problem areas
Active Session History –
High-load IO / CPU snapshot of session activity
RAC issues
SQL issues every second
Runs proactively & manually
System Network +
SQL
Sizing DB config
Advisor Advice Advice
Performance Diagnostic: Before and Now
Before
Examine system utilization Oracle10g
Look at wait events 2. Review ADDM
Observe latch contention recommendations
See wait on shared pool and library cache latch 3. ADDM recommends
Review v$sysstat (difficult) use of cursor_sharing
See “parse time elapsed” > “parse time cpu” and #hard
parses greater than normal
Identify SQL by..
Identifying sessions with many hard parses and trace
them, or
Reviewing v$sql for many statements with same hash
plan (difficult)
9. Examine objects accessed and review SQL
10. Identify “hard parse” issue by observing the SQL contains
literals
11. Enable cursor sharing
Database Home Page
ADDM Findings
ADDM Recommendations
Application and SQL
Management Key to efficient SQL execution:
Oracle Cost-based
Optimizer
Proven Technology
– Over 10 years of production
Application & SQL
Management usage
– Adopted by all top-tier
Storage applications vendors
System Resource
Management Management Sophisticated functionality
– Automatically-gathered
object and system (CPU, IO,
Backup & Recovery Space Caching) statistics
Management Database Management
– Comprehensive set of
Management
access paths, adaptive
Intelligent Infrastructure search strategy
– Cost-based transformations
– Automatic allocation of
memory and parallelism
– Versioned optimizer statistics
Remaining Challenges
How to quickly find optimal plans for complex
queries?
– Sub-optimal plans caused by correlations, complex
predicate selectivity
What is “bad” SQL?
How to work-around ‘bad’ SQL in packaged
applications?
How to ‘globally’ optimize an entire application’s SQL
statements?
– Adding an index may help one statement, but what is the
impact on the rest of the application
Automatic Tuning Optimizer
Packaged Customizable
Apps Apps
Identify ‘bad’ SQL
High-load SQL – Automatic workload
capture
– Automatic identification
of high-load SQL
– Top N highest
resource-consuming
SQL Statements
Automatic Tuning Optimizer
Packaged Customizable
Apps Apps
Automatic SQL Tuning
High-load SQL – Learn from past
executions
Automatic Tuning Optimizer
– Dynamic sampling,
Auto SQL
Tuning partial execution
techniques
– Profile the SQL
Packaged
statement to feedback
Apps to optimizer
+
SQL
– No change to SQL text
Profile
Well-tuned SQL
Automatic Tuning Optimizer
Packaged Customizable
Apps Apps
Customizable
Apps
+
SQL
Advice
Well-tuned SQL
Automatic Tuning Optimizer
Packaged Customizable
Apps Apps
SQL Access Advisor
High-load SQL – Advise on access paths
Automatic Tuning Optimizer
– Indexes, Materialized
Views, Indexes on
Access
Advisor Materialized Views
– Consider entire
workload
Customizable – Consider Impact on
Apps insert/update/delete
+
Indexes &
MVs
Well-tuned SQL
Automatic Tuning Optimizer
Packaged Customizable
Apps Apps
Complete SQL
High-load SQL
Management
Automatic Tuning Optimizer – Automated workload
Auto SQL Auto SQL Access capture, identification of
Tuning Analysis Advisor high-load SQL
– Automatic SQL Tuning
– Automatic SQL Analysis
Packaged Customizable Customizable
Apps Apps Apps
– SQL Access Advisor
+ + +
SQL SQL Indexes &
Profile Advice MVs
Well-tuned SQL
SQL Tuning: Before and Now
Scenario: Bad SQL in Packaged Applications
Before Oracle10g
2. Examine system utilization
2. Review ADDM
3. Look at wait events recommendations
4. See wait on DB scattered read
3. Follow link to run
5. Determine scope – system wide, module-dependent, user- Automatic SQL tuning
dependent?
4. Accept SQL Profile
6. Identify SQL by (difficult)
recommendations from
Identifying sessions with high DB scattered read waits and
SQL Tuning
trace them, or
Reviewing Top Sessions in OEM
7. Get explain plan
8. Examine objects accessed (size/cardinality)
9. Review SQL statistics and/or compare to object statistics (v$sql)
(difficult)
10. Identify the problem
11. Contact packaged app vendor
12. Produce test case for vendor
13. Vendor produces patch/upgrade
14. Patch/upgrade installed in customer’s next maintenance cycle
System Resource Management
Oracle 9i
Application & SQL
Resource Manager
Management
controls and prioritizes
Storage System Resource CPU usage
Management Management
Automatic SQL
Space
Memory Tuning
Backup & Recovery
Management Database Management
Management
Intelligent Infrastructure
Automatic Shared Memory
Tuning
Automatically adapts
Online Large Batch Buffer Cache to workload changes
Users Buffer Cache Jobs Maximizes memory
utilization
Large Pool
Single Parameter
Large Pool
makes it easier to
SQL Cache SQL Cache use
Java Pool Java Pool SGA Helps eliminate out
of memory errors
PGA Can help improve
sort sort performance
SGA Memory Management: Before and Now
Scenario: Out-of-memory Errors (ORA-4031)
Before Oracle10g
(This space is intentionally left
3. Launch Buffer Pool Advisor blank – No manual steps needed
with Automatic Shared Memory
4. Examine output; check if Buffer Pool is over allocated Tuning)
5. If so, reduce size of Buffer Pool
6. Launch Shared Pool Advisor
7. Examine output; check if Shared Pool is under allocated
8. If so, increase size of Shared Pool
Automatic Space Management
Oracle9i
Eliminates external space
Application & SQL
Management
fragmentations
– Locally Managed
Storage
Management
System Resource
Management
Tablespace
Eliminates space allocation
contention
Backup & Recovery Space
Management Database Management – Automatic Segment
Management
Space Management
Intelligent Infrastructure
Proactive Space Management
Segment running
out of space Automatically monitor,
capture space usage at
space allocation time -
efficient
Advise and predict
Server-
Capacity space growth trend,
Generated
Planning
Alerts fragmentation
“Just-in-Time” Alerts on
90
80
70
60
space pressure
50
40
30
20
10
0
1st Qtr 2nd Qtr 3rd Qtr 4th Qtr
Proactive Space Management
Segment running Fragmented
out of space Segment Online Segment Shrink
– Reclaim space from
internal
fragmentation
– Improve performance
Server- Online
Capacity – In-place shrinking of
Generated Segment
Planning tables
Alerts Shrink
– Wait on DML
90
operations
80
70
60
50
40
30
20
10
0
1st Qtr 2nd Qtr 3rd Qtr 4th Qtr
Space Management : Before and Now
Scenario: Reclaim Wasted Space
Before Oracle10G
3. Launch Segment Advisor to
Check to see which objects in the tablespace have pockets advise on which object(s) to
of wasted space due to deletion: shrink
1. Create a script that looks at DBA_TABLES view to 4. Accept the recommendations
compare the total space allocated for each object to shrink the objects online
(BLOCKS * DB_BLOCK_SIZE) in a tablespace to the and in-place
estimated space used by the object (AVG_ROW_LEN
* NUM_ROWS)
(assumes objects have been analyzed)
2. Review script output and identify target objects for
reorganization
3. Identify/Create “scratch” tablespace
4. For each object to be reorganized, use the Enterprise
Manager Reorg wizard to recreate each object along with its
dependencies
Automatic Backup & Recovery
Before Oracle10g
(Tablespace Point-in-time Recovery)
3. Single Command
4. Prepare an auxiliary instance by first creating an Oracle Recovery:
password file FLASHBACK TABLE
5. Create parameter file for auxiliary instance <table_name> TO
6. Start auxiliary instance in NOMOUNT mode using SQL*Plus BEFORE DROP ;
7. Using RMAN interface to perform TSPITR
8. Using RMAN, connect to target database and bring
tablespace in question online
9. Shutdown the auxiliary instance
10. Delete auxiliary instance data files, control files, and redo
log files
Automatic Storage Management
TODAY ASM
Tables Tables
Tablespace Tablespace
0010 0010 0010 0010 0010
Files 0010 0010 0010 0010 0010
Files
File System File System ASM
Logical Vols Logical Vols
Disks Disk Group
ASM Instance
Non–RAC Oracle
DB Instance
Database
Server
Pool of Storage
Disk Group
ASM Instance
• Lightweight instance
- Few processes
- No database to mount, metadata tripled mirrored in ASM
diskgroup
• Initialization Parameters
INSTANCE_TYPE = OSM
OSM_POWER_LIMIT = 11
OSM_DISKSTRING = '/dev/rdsk/*s2', '/dev/rdsk/c1*'
OSM_DISKGROUPS = dgroupA, dgroupB
LARGE_POOL_SIZE = 8MB
Database and ASM Instance Interaction
Server
DATABASE (1A) OPEN ASM
(1) Database opens file (1B) Extent Map
(2A) READ
(2) Database Reads file
(3C) Extent Map
Operating System
ASM Architecture
ASM Instance
Non–RAC Oracle
DB Instance
Database
Server
Pool of Storage
Disk Group
ASM Architecture
Clustered
Servers
Clustered
Pool of Storage
Disk Group
ASM Architecture
ASM Instance ASM Instance
Clustered
Servers
Clustered
Pool of Storage
Disk Group Disk Group
ASM is NOT!
Database Space
Backup & Recovery
Management Management
Management
Intelligent
Infrastructure
Where DBA’s spend their time
Install 6%
Create & Configure
12 %
Software Maintenance
6% Load Data 6%
Dis Compare/Diff
Software
Configurations
co
ve Grid Control a l yze
r An Change Tracking
Hardware
Configurations Reference
Configurations
Install/Clone Oracle.com
io n Liv
i s Policy eL
Configure o v ink Product Updates
Pr Manager
Patch Patches
Product
Secure
Configuration
Oracle Database 10g
Simplified Creation & Configuration
½ COST
Fast Lightweight
Install
Efficient
Data Load
Enterprise
Configuration Self-Managing Database
Management
Oracle 10g : Twice as
Manageable as Oracle9i
16 13
10 10
Number of Steps
12
6 6
8
4
4
4
2 2 2 2
1 Oracle9i
Oracle 10g
0
Performance SQL Tuning Resource Space Backup & Storage
Diagnostic Management Management Recovery Management
(Memory)
Result Summary
Oracle 10g required 44% less time and 47% fewer steps
than Oracle9i.
So what does
the DBA do
now :-)
DBA of the Future Does MORE
For customers
Less Administration Cost
Less Capital Expenditure
Less Failures
Management APIs
Services Framework
Event Services
– No need to purchase
additional software
Cluster Control/Recovery APIs
– Easy to install, manage
High quality and functionality Automatic Storage Management
across all platforms
Messaging and Locking
Large number of nodes
Common event and Membership
management api’s
Connectivity
– Multi-tier HA & minimal
MTTR
Hardware/OS Kernel
Support for third-party
clusterware
RAC Enterprise Manager
Integration
Service Consumer Page
Shows alerts for SLA violations
Cluster Page
Cluster Database Page
Performance Page
RAC for Everyone –
Server Provisioning
– Provision software to many systems at once
– Clone, store and distribute “known good” configurations
– Automate patch and update management
Enterprise
Manager
Software
Inventory
RAC for Everyone –
Server Provisioning
– Provision software to many systems at once
– Clone, store and distribute “known good” configurations
– Automate patch and update management
Enterprise
Manager
Software
Inventory
Enterprise Grid – Workload
Management
Hands-free allocation and re-allocation of
servers to services based on rules
– Automated routing of service requests to
appropriate server with lowest load
– On server failure, automated re-allocation of
surviving servers to services
Works across all platforms
Enterprise Grid – Workload
Management
Order Entry Spare Supply Chain
End of Quarter
Enterprise Grid – Workload
Management
Order Entry Spare Supply Chain
Server Fails
Enterprise Grid – Cluster
Failure
Order Entry Supply Chain
CLUSNODE-1
CLUSNODE-2
CLUSNODE-3
CLUSNODE-4
Priority Thresholds
High 0.5/0.75
Med 0.5/1.00
Low 1.0/1.5
High 1.0/1.5
Low 3.0/5.0
Step 1 – Check Node
Applications NAME=ora.clusnode-1.LISTENER_clusnode-1.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on clusnode-1
NAME=ora.clusnode-1.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE
Step 2 – Define Database and
Instances
srvctl add database
-d ORACLE
-o $ORACLE_HOME
–s $ORACLE_HOME/dbs/ORACLE_spfile
srvctl add instance -d ORACLE
-i RAC01 -n clusnode-1
srvctl add instance -d ORACLE
-i RAC02 -n clusnode-2
srvctl add instance -d ORACLE
-i RAC03 -n clusnode-3
srvctl add instance -d ORACLE
-i RAC04 -n clusnode-4
Step 3 – Define Services
TNS + ERP=(DESCRIPTION=(LOAD_BALANCE=on)
…
TAF (CONNECT_DATA=(SERVICE_NAME=ERP))
Basic (FAILOVER_MODE=(BACKUP=ERP)(TYPE=SELECT)
(METHOD=BASIC)(RETRIES=180)(DELAY =5)))
TNS + ERP=(DESCRIPTION=(LOAD_BALANCE=on)
…
TAF (CONNECT_DATA=(SERVICE_NAME=ERP))
Pre- (FAILOVER_MODE=(BACKUP=ERP_PRECONNECT)(TYPE=SESSION)
Connect (METHOD=PRECONNECT)(RETRIES=180)(DELAY =5)))
ERP_PRECONNECT=(DESCRIPTION=(LOAD_BALANCE=on)
…
(CONNECT_DATA=(SERVICE_NAME=ERP_PRECONNECT))
(FAILOVER_MODE=(BACKUP=ERP)(TYPE=SESSION)
(METHOD=BASIC)(RETRIES=180)(DELAY =5)))
Example - Setting Service
Priorities
rem Create the consumer groups
execute DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA;
execute
DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP
(CONSUMER_GROUP => 'HIGH_PRIORITY',
COMMENT => 'High priority group');
execute
DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP
(CONSUMER_GROUP => 'STANDARD_PRIORITY',
COMMENT => 'Standard priority group');
execute
DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP
(CONSUMER_GROUP => 'LOW_PRIORITY',
COMMENT => 'Low priority group');
Example - Setting Service
Priorities
rem Create the service to consumer group mapping
execute
DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING
(ATTRIBUTE => DBMS_RESOURCE_MANAGER.SERVICE_NAME,
VALUE =>'ERP',CONSUMER_GROUP =>'HIGH_PRIORITY');
execute
DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING
(ATTRIBUTE => DBMS_RESOURCE_MANAGER.SERVICE_NAME,
VALUE=>'CRM',CONSUMER_GROUP => 'STANDARD_PRIORITY');
execute
DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING
(ATTRIBUTE =>DBMS_RESOURCE_MANAGER.SERVICE_NAME,
VALUE=>'SS',CONSUMER_GROUP => 'STANDARD_PRIORITY');
execute
DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING
(ATTRIBUTE => DBMS_RESOURCE_MANAGER.SERVICE_NAME,
VALUE=>'HOT',CONSUMER_GROUP => 'HIGH_PRIORITY');
execute
DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING
(ATTRIBUTE =>DBMS_RESOURCE_MANAGER.SERVICE_NAME,
VALUE =>'STD',CONSUMER_GROUP => 'LOW_PRIORITY');
execute dbms_resource_manager.submit_pending_area;
End-to-End Integration
Load Balancing
Dynamic load balancing
Oracle 10g Clusterware with Oracle Application
Server 10g
Multiple SLA's satisfied on
iAS
shared hardware
Self monitoring services
RAC – Automatic Workload
Repository (AWR)
measures end to end
ASM – Resource manager
End-to-End Integration
Synchronized Recovery
End to end recovery without
Oracle 10g Clusterware human intervention
– < 8 second recovery time
for database
iAS – Immediate recovery for
mid-tiers
< 4 seconds from 15
minutes Self
RAC Correcting
Self verifying
ASM Self diagnosing
Self correcting
End-to-End Integration
Disaster Recovery
Oracle 10g Clusterware
iAS
Data Guard Broker
Production central point of control
RAC
System
Changes
Planned
Downtime
Data
Changes
Commercial Grids and Availability
Computer
Failures
Unplanned Disk Based Recovery
Downtime Data
Failures
Trade cheap disk space
for expensive downtime
System
Changes
Planned
Downtime
Data
Changes
New World:
Disk Based Data Recovery
Disk economics are close to
tape
1980’s - 200 MB
Disk is better than tape
– Random access to any data
We rearchitected our recovery
1000x increase strategy to take advantage of
these economics
– Random access allows us to
backup and recover just the
changes to the database
Backup and Recovery goes from
hours to minutes
2000’s - 200 GB
Resiliency using Low Cost Storage
System
Changes Site Failure
Planned
Downtime
Data
Changes Four Failure Types
Data Mirroring with ASM
ASM mirrors data across
inexpensive modular
storage arrays
Automatically remirrors
when disk or array fails
Designed to tolerate
failures
System
Changes Site Failure
Planned
Downtime
Data
Changes
Flashback Time Navigation
Flashback Query
– Query all data at point in time
Select * from Emp AS OF ‘2:00 P.M.’
where …
System
Changes Site Failure
Planned
Downtime
Data
Changes
Oracle End-to-end Data Validation
Blocks validated and
Protection info added to block
Oracle H.A.R.D. – Hardware Assisted
A.S.M. Resilient Data
Volume Manager – Prevents corruption introduced in
IO path between DB and storage
Operating System Initially introduced in Oracle9iR2
Host Bus Adapter 10g HARD provides
– Better checks
SAN & – All file types & block sizes checked
Virtualization DB, log, archive, backup, etc.
–A.S.M. enables HARD without
SAN Interface using RAW devices
Supported by major storage vendors
Storage Device
10110010
10110000
11101001
SQL> ALTER DATABASE ENABLE BLOCK CHANGE
TRACKING;
System
Changes Site Failure
Planned
Downtime
Data
Changes
Data Guard 10g New Features
General new features
– Real Time Apply
– Flashback Database Integration
SQL Apply new features
– Zero Downtime Instantiation
– Rolling Upgrades
– Additional Datatypes
No Delay!
Flashback Flashback
Log Log
Primary: No reinstantiation
after failover!
Dramatic Advances
in Ease of Use
Data Guard
Site Failure
Protection
Flash
Recovery
Area
Flashback Corruption
Human Error Protection
Combine the
Protection
Features to
ASM Mirroring Achieve Any Level
Storage Failure
of Data Protection
Protection
No Cost System Changes
Computer Goal
Failures
Unplanned
Allow any change to
Downtime the system with no
Data
Failures downtime
CPU
– Add/remove CPUs on SMP online
Cluster Nodes
– Add/remove cluster nodes online
– No data movement needed
Memory
– Grow and shrink shared memory
and buffer cache online
– Auto tuning of memory online
Disk
– Add/remove disks online
– Automatically rebalance
– Move datafiles
Rolling Patch Upgrade using RAC
Oracle
Clients A Clients Patch Patch
B A B
B
1 2 Upgrades
Operating
Initial RAC Configuration Clients on A, Patch B
System
Upgrades
A
A B
B Patch A
A B
4 3 Hardware
Upgrades
Major
Version X Version X X X+1 Release
1 2 Upgrades
Initial SQL Apply Config Upgrade node B to X+1
Computer Goal
Failures Competitive pressures
Unplanned demand continual change
Downtime
Data Need to change data with
Failures no interruption to the
application
– location, format, indexing,
System or even definition
Changes
Planned
Downtime Online Redefinition
Data Evolution without Interruption
Changes
Online Redefinition Enhancements
Data Guard
– Declarative
– Model Driven UML
HTTP Listener
Programming Language: PL/SQL
– PL/SQL, SQL, HTML
Deployment Architecture: Database
– RDBMS
135
HTML DB: How it Works
Browser Based
No Deployment Needed
Team Based Development
HTML DB Browser
HTML DB in a Nutshell
PL/SQL SQL
A new compiler is
available for PL/SQL
compilation
Transparent to user
PL/SQL is significantly
faster than prior
releases
Ability to change full
interpreted compiled
code to full native
compiled code
PL/SQL Performance
Set Timing ON
SELECT fib_sum(30) FROM dual;
Oracle
FIB_SUM(30) Database 10g
-----------
832040
Elapsed: 00:00:04.82
Set Timing ON
SELECT fib_sum(30) FROM dual;
FIB_SUM(30) Oracle9i R2
-----------
832040
Elapsed: 00:00:08.36
Regular Expression Support
Performance improvements
Terabyte size LOBs
New DBMS_LOB.GET_STORAGE_LIMIT
function
OCI now supports LOBs greater than 4GB
Oracle 10g –
The High Performance Platform for XML
Cache# 1
Session 1.1
....
Session 1.m
Cache# n ....
Cache Manager
Session n.m
JDBC Fast Connection
Failover
Database Database
instance instance
in a cache in a cache
Java DB New Features