Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Menus
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 384
This tab requires
Diagnostic & Tuning
Pack licenses
Enterprise Manager Express
Manual configuration of the HTTP port for EM Express
In init.ora/spfile (default setting):
dispatchers=(PROTOCOL=TCP)(SERVICE=sample XDB)
Check on which port EM Express is configured:
SQL> select DBMS_XDB_CONFIG.getHTTPport() from dual;
SQL> select DBMS_XDB_CONFIG.getHTTPSport() from dual;
Set a new port:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 385
Set a new port:
SQL> exec DBMS_XDB.setHTTPport(5500);
SQL> exec DBMS_XDB.setHTTPSport(8080);
Now access the EM Express homepage in the browser:
http://database-hostname:port/em
http://localhost:5500/em
The configuration will have to be done for the CDB and every single
PDB on different ports
Enterprise Manager Cloud Control 12c
Plug-in "Enterprise Manager For Oracle Database (DB)
12.1.0.3" already released via EM Self-Update
Supports Oracle Database 12.1.0.1
Discovers CDBs and PDBs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 386
Enterprise Manager Cloud Control 12c
Discovered Oracle Database 12c targets:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 387
Policy
enforced
redaction of
sensitive data
Redacting Sensitive Data
Mask Application Data Dynamically
Call Center
Operator
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 388
Soc. Sec. #
115-69-3428
DOB
11/06/71
PIN
5623
sensitive data
Payroll
Processing
052-51-2147
XXX-XX-2147
Redaction
Supported Transformations
Stored Data
Redacted Results
10/09/1992 Full
Partial
01/01/2001
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 389
052-51-2147
tim.lee@acme.com [hidden]@acme.com
4451-2172-9841-4368
4943-6344-0547-0110
RegExp
Random
Redaction
Policy based with conditional enforcement
DBMS_REDACT.ADD_POLICY(
policy_name => 'Redact Customer PII',
object_schema => 'CALLCENTER',
object_name => 'CUSTOMERS',
column_name => 'DOB',
expression =>
'SYS_CONTEXT(''USERENV'',''CLIENT_IDENTIFIER'')
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 390
'SYS_CONTEXT(''USERENV'',''CLIENT_IDENTIFIER'')
!=''SUPERVISOR04''',
function_type => DBMS_REDACT.FULL);
Redaction decisions can be based on runtime conditions
Database environment User, role, session, client IP, auth type
Context from applications App user, app role, app identifier, APEX V() and NV() functions
Context from Label Security User session label
Redaction
Application transparency
Supports commonly used Oracle Database data types
Maintains the data type and optionally the formatting
Does not alter the data in database caches, buffers, or
storage
Redacts only for display
Works with views and does not alter the query plan
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 391
Works with views and does not alter the query plan
Typically requires zero application code or configuration
changes
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 392
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Performance Checklist
Prepare
Plan Stability
O Adjust maintenance windows
O Configure statistics retention
O Configure incremental statistics
O Adjust memory and optimizer parameters
O Configure AWR, ASH and ADDM
O Preserve and transport execution plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 393
Test Performance
Optimize
Performance
O General test guidelines
O Real Application Testing
O Performance New Features
Enable Features
O System Statistics
O Automatic Tuning Advisor
Things to do right after upgrade
Adjust default maintenance windows
SQL> select CLIENT_NAME, STATUS from DBA_AUTOTASK_CLIENT;
Default weekday windows run from 10pm to 2am (4 hours)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 394
Default weekday windows run from 10pm to 2am (4 hours)
Default weekend windows run from 6am to 2am (20 hours)
Resource Manager is active
Adjust windows to fit your business needs
SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE(
'MONDAY_WINDOW','REPEAT_INTERVAL',
'freq=daily;byday=MON;byhour=05;byminute=0; bysecond=0');
SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE(
'MONDAY_WINDOW','DURATION',numtodsinterval(2,'hour'));
SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE(
'MONDAY_WINDOW','REPEAT_INTERVAL',
'freq=daily;byday=MON;byhour=05;byminute=0; bysecond=0');
SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE(
'MONDAY_WINDOW','DURATION',numtodsinterval(2,'hour'));
Things to do right after upgrade
Configure statistics retention period
By default object statistics will be kept for 31 days
Data gets stored in SYSAUX tablespace
Check the current space consumption:
SQL> select SPACE_USAGE_KBYTES/1024 MB from
V$SYSAUX_OCCUPANTS where OCCUPANT_NAME='SM/OPTSTAT';
Check the current setting:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 395
Check the current setting:
SQL> select DBMS_STATS.GET_STATS_HISTORY_RETENTION
from DUAL;
Adjust the current setting (here: 10 days):
SQL> exec
DBMS_STATS.ALTER_STATS_HISTORY_RETENTION(10);
Things to do right after upgrade
Configure incremental statistics collection
Valid and useful for selected partitioned tables
Set it for selected tables only:
SQL>
Gather statistics for touched partition(s) ONLY
Stats for that table must be gathered with GRANULARITY
exec DBMS_STATS.
SET_TABLE_PREFS('SH','SALES','INCREMENTAL','TRUE');
exec DBMS_STATS.
SET_TABLE_PREFS('SH','SALES','INCREMENTAL','TRUE');
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 396
Stats for that table must be gathered with GRANULARITY
parameter set to AUTO
Result: Faster runtime for stats collection on partitioned tables
Global setting:
SQL>
exec DBMS_STATS.SET_GLOBAL_PREFS('INCREMENTAL','TRUE'); exec DBMS_STATS.SET_GLOBAL_PREFS('INCREMENTAL','TRUE');
Things to do right after upgrade
Incremental stats
Sales Table Sales Table
May 18 May 18
th th
2008 2008
May 19 May 19
th th
2008 2008
May 20 May 20
th th
2008 2008
Sales Table Sales Table Sales Table Sales Table
May 18 May 18
th th
2008 2008
May 19 May 19
th th
2008 2008
May 20 May 20
th th
2008 2008
Partition level stats are
gathered & synopsis created
O
Global stats generated by
aggregating partition level
statistics and synopsis
O
O
Global stats generated by
aggregating the original partition
synopsis with the new one
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 397
Sysaux Tablespace
May 22 May 22
nd nd
2008 2008
May 23 May 23
rd rd
2008 2008
May 21 May 21
st st
2008 2008
May 22 May 22
nd nd
2008 2008
May 23 May 23
rd rd
2008 2008
May 21 May 21
st st
2008 2008
May 24
th
2008
A new partition is
added to the table
& data is Loaded
O
Gather partition statistics for new partition
O
O
Retrieve synopsis for each of the
other partitions from SYSAUX
Things to do right after upgrade
Configure Automatic Shared Memory Management
Especially important if Pluggable Database will be used
SGA_TARGET
In addition DB_CACHE_SIZE, SHARED_POOL_SIZE etc will
define minimum values which won't be underrun
If resize operations (done by MMAN) happen to frequent
"_MEMORY_BROKER_STAT_INTERVAL"=900 should be set
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 398
"_MEMORY_BROKER_STAT_INTERVAL"=900 should be set
default is 30 (seconds)
PGA_AGGREGATE_TARGET
MEMORY_TARGET should only
be used only for ASM and in
smaller environments with
very constant load
Parameter Information Oracle 12c
PGA_AGGREGATE_LIMIT
Values: integer [ K | M | G ]
Default: >2GB and 200% of PGA_AGGREGATE_TARGET and 3MB x
PROCESSES it will not exceed 120% of physical memory SGA
size. Setting it to 0 will mean "no limit"
Example:
SGA_TARGET=20G
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 399
SGA_TARGET=20G
PGA_AGGREGATE_TARGET=20G
PROCESSES=1200
Physical memory: 64G
Verification/calculation:
Min Limit: >2GB? Yes
3MB x PROCESSES = 3.6G
200% of PGA_AGGREGATE_TARGET = 40G
g 120% of physical memory SGA size = 76.8G 20G = 56.8G? Yes
Parameter Information Oracle 11.2/12c
_MEMORY_IMM_MODE_WITHOUT_AUTOSGA
Values: TRUE | FALSE
Purpose:
Switching this parameter to FALSE will prevent the SGA from doing
resize operations even though neither SGA_TARGET nor
MEMORY_TARGET are set.
Explanation:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 400
A generic enhancement in 11.2.0.1 was made to allow IMMEDIATE
mode requests even when SGA_TARGET (or MEMORY_TARGET) is not
set. This enhancement has been introduced to prevent ORA-4031
errors due to shared pool pressure.
Feature can be turned off:
alter system set "_memory_imm_mode_without_autosga"=FALSE;
Further information: Note:1269139.1
Parameter Information Oracle 11.2/12c
OPTIMIZER_MODE
Values: ALL_ROWS | FIRST_ROWS |
FIRST_ROWS_[1|10|100|1000]
Note:
Obsolete settings (will be ignored):
optimizer_mode=choose
optimizer_mode=rule
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 401
optimizer_mode=rule
Only the /*+RULE */ hint will still work
Parameter Information Oracle 11.2/12c
OPTIMIZER_DYNAMIC_SAMPLING
If statistics are not available it controls whether dynamic stats will
be gathered, and the sample size
Default: 2
Values: 0-11
0: Switches off dynamic sampling
2: Check at max the first 64 blocks to generate stats on the fly
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 402
2: Check at max the first 64 blocks to generate stats on the fly
11: NEW SETTING
Use dynamic statistics automatically when the Optimizer deems it
Verifies cardinality and implements a time limit for the estimate
Results persist as Shareable Statistics
Parameter Information Oracle 11.2/12c
OPTIMIZER_DYNAMIC_SAMPLING
O
r
a
c
l
e
D
a
t
a
b
a
s
e
1
2
c
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 403
P
a
g
e
2
4
8
S
Q
L
T
u
n
i
n
g
G
u
i
d
e
BEGIN
SYS.DBMS_SQLTUNE.CREATE_SQLSET(
sqlset_name=>'SPM_STS',description=>'10.2 plans');
END;
/
DECLARE
stscur dbms_sqltune.sqlset_cursor;
BEGIN
BEGIN
SYS.DBMS_SQLTUNE.CREATE_SQLSET(
sqlset_name=>'SPM_STS',description=>'10.2 plans');
END;
/
DECLARE
stscur dbms_sqltune.sqlset_cursor;
BEGIN
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 423
BEGIN
OPEN stscur FOR
SELECT VALUE(P) FROM TABLE(dbms_sqltune.select_cursor_cache(
'parsing_schema_name<>''SYS''',null,null,null,null,1,null,'ALL')) P;
-->> Populate the SQL Tuning Set
dbms_sqltune.load_sqlset(sqlset_name=>'SPM_STS',populate_cursor=>stscur);
END;
/
SQL> variable cnt number
SQL> exec :cnt := DBMS_SPM.LOAD_PLANS_FROM_SQLSET(sqlset_name=>'SPM_STS');
BEGIN
OPEN stscur FOR
SELECT VALUE(P) FROM TABLE(dbms_sqltune.select_cursor_cache(
'parsing_schema_name<>''SYS''',null,null,null,null,1,null,'ALL')) P;
-->> Populate the SQL Tuning Set
dbms_sqltune.load_sqlset(sqlset_name=>'SPM_STS',populate_cursor=>stscur);
END;
/
SQL> variable cnt number
SQL> exec :cnt := DBMS_SPM.LOAD_PLANS_FROM_SQLSET(sqlset_name=>'SPM_STS');
SQL Plan Management - New Application
New application (module) gets delivered
exp imp
expdp impdp
O O
@Vendor
DBMS_SPM.CREATE_STGTAB_BASELINE
Staging
Table
@Customer
Staging
Table
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 424
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
DBMS_SPM.PACK_STGTAB_BASELINE
DBMS_SPM.UNPACK_STGTAB_BASELINE
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
SQL Plan Management - Transport
Transporting SQL Plan Management baselines between
test and production databases
@Test System:
Create a staging table using
DBMS_SPM.CREATE_STGTAB_BASELINE
Pack the required baselines into the staging table using
DBMS_SPM.PACK_STGTAB_BASELINE
Export the staging table into a dump file using Data Pump Export
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 425
Export the staging table into a dump file using Data Pump Export
and transport it to the destination system
@Production System:
Import the dump file into the destination database
Unpack the SQL Plan Baselines from the staging table into
the SQL Management Base of the target system
DBMS_SPM.UNPACK_STGTAB_BASELINE
SQL Plan Management
White Paper:
http://www.oracle.com/technetwork/database/focus-areas/bi-
datawarehousing/twp-sql-plan-management-11gr2-133099.pdf
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 426
MOS Notes:
Note:456518.1 SQL Plan Management Example
Note:789888.1 How to load plans from AWR into SPM
Note:801033.1 How to move 10.2 plans into 11g SPM
Performance Checklist
Prepare
Plan Stability
- Adjust maintenance windows
- Configure statistics retention
- Configure incremental statistics
- Adjust memory and optimizer parameters
- Configure AWR, ASH and ADDM
- Preserve and transport execution plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 427
Test Performance
Optimize
Performance
O General Test Guidelines
O Real Application Testing
O Performance New Features
Enable Features
O System Statistics
O Automatic Tuning Advisor
General Test Guidelines
1. Test the Upgrade
Is it successful?
How long does it take?
2. Test Post-Upgrade Functionality
Will your applications run correctly?
3. Test Post-Upgrade Performance
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 428
Time important queries, reports, and batch jobs
Managing Optimizer/CBO stats during upgrade: Note:465787.1
Tune your init.ora parameters, OS parameters
Use real life loads!
Real Application Testing
SQL Performance Analyzer
Database Replay
Real Application Testing
Goal:
Record and replay a real workload to see how a system performs
Platform independent
Find regressions and changing plans before the upgrade
Do consistent performance evaluations upon application changes
Licensable database pack "Real Application Testing"
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 429
= Available since Oracle Database 11.1.0.6
= Available also with patch sets Oracle Database 10.2.0.4/5
Consists of:
Database Replay
DBMS_WORKLOAD_CAPTURE and DBMS_WORKLOAD_REPLAY
SQL Performance Analyzer
DBMS_SPA
Replay actual production database workload in test environment
Identify, analyze and fix potential instabilities before making changes to
production
Capture Workload in Production
Capture full production workload with real load, timing & concurrency
characteristics
Move the captured workload to test system
Database Replay
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 430
Move the captured workload to test system
Replay Workload in Test
Make the desired changes in test system
Replay workload with full production characteristics
Honor commit ordering
Analyze & Report
Errors
Data divergence
Performance divergence
Database Replay: Supported Changes
Changes
Unsupported
Changes Supported
Client Client
Client
Middle Tier
Use a tool such as Oracle
Application Testing Suite
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 431
Changes Supported
Database Upgrades, Patches
Schema, Parameters
RAC nodes, Interconnect
OS Platforms, OS Upgrades
CPU, Memory
Storage
Etc.
Storage
Recording of
External Client
Requests
Shared Server support from Oracle Database Release 11.2
Step 1: Workload Capture
Production System
File System
Client Client
Client
Middle Tier
All external client requests
captured in binary files
System background and internal
activity excluded
Minimal overhead
Avoids function call when possible
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 432
File 1
File 2
File n
Storage
Buffered I/O
Independent of client protocol
Can capture on 9.2.0.8 and replay
on 11g
Capture load for interesting time
period, e.g., peak workload,
month-end processing, etc.
Step 2: Process Workload Files
File 1
File 2
Test System
Setup test system
Application data should be same
as production system as of
capture start time
Use RMAN, Snapshot Standby,
imp/exp, Data Pump, etc. to
create test system
Make change: upgrade db and/or
OS, change storage, migrate
platforms, etc.
File 1
File 2
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 433
File n
Metadata
Replay Files
platforms, etc.
Processing transforms captured
data into replayable format
Once processed, workload can be
replayed many times
For RAC copy all capture files to
single location for processing
File n
Capture Files
File 1
File 2
Replay Clients
File N
Metadata
Replay Files
Server Server Server
Same number of user
connections
Replay Client
Multithreaded OCI Client
Drives multiple captured
processes
Scalable Architecture
Interprets capture into
sequence of OCI calls
Functional replay
Background
Commit Order Synchronization
Sequence Replay
Step 4: Analysis & Reporting
Error Divergence: For each call error divergence is reported
New: Error encountered during replay not seen during capture
Not Found: Error encountered during capture not seen during
replay
Mutated: Different error produced in replay than during capture
Data Divergence
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 435
Replay: Number of rows returned by each call are compared and
divergences reported
User: Application level validation scripts
Performance Reporting
Capture and Replay Report: Provides high-level performance
information
ADDM Report: Provides in-depth performance analysis
AWR, ASH Report: Facilitates comparative or skew analysis
Consolidated Database Replays
Allows workload
captured on
different databases
to be consolidated
for replay
Works for
Validating consolidation strategies
SALES
HR
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 436
Works for
manually
consolidated
databases or
Pluggable
Databases
ERP
CRM
SQL Performance Analyzer
Production
Test
Clients/
Middle Tier
Oracle
No clients/middle tier necessary
SQL Performance Analyzer - Overview
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 437
Capture SQLs
Oracle
Database
Transport SQLs
Re-execute SQLs
SPA in Enterprise Manager 12c
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 438
SPA for upgrades from 10g/11g
Setup
Upgrade
R2
10.2.0.3
11.2.0.3
STS
Evaluate, compare and tune
over and over again!
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 439
SQL Performance Analyzer
STS
Capture SQLs
into a STS
Load STS
over and over again!
Resulting Reports
Example: Report showing regressed statements and plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 440
Performance Checklist
Prepare
Plan Stability
- Adjust maintenance windows
- Configure statistics retention
- Configure incremental statistics
- Adjust memory and optimizer parameters
- Configure AWR, ASH and ADDM
- Preserve and transport execution plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 441
Test Performance
Optimize
Performance
- SQL Performance Analyzer
- Database Replay
O Performance New Features
Enable Features
O System Statistics
O Automatic Tuning Advisor
Gather Workload Statistics
Gather system statistics during a regular workload period
otherwise inappropriate values for the CBO will be used:
SQL> select pname NAME, pval1 VALUE, pval2 INFO
from aux_stats$;
SQL> select pname NAME, pval1 VALUE, pval2 INFO
from aux_stats$;
SQL> EXECUTE dbms_stats.gather_system_stats('start');
<< Run it for several hours on a workload does not generate overhead!!! >>
SQL> EXECUTE dbms_stats.gather_system_stats('stop');
SQL> EXECUTE dbms_stats.gather_system_stats('start');
<< Run it for several hours on a workload does not generate overhead!!! >>
SQL> EXECUTE dbms_stats.gather_system_stats('stop');
Best Practice
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 442
from aux_stats$;
NAME VALUE INFO
-------------------- ---------- ------------------------------
STATUS COMPLETED
DSTART 04-03-2011 12:30
DSTOP 05-03-2011 12:30
FLAGS 1
CPUSPEEDNW 2498,65
IOSEEKTIM 11,405
IOTFRSPEED 25595,605
...
from aux_stats$;
NAME VALUE INFO
-------------------- ---------- ------------------------------
STATUS COMPLETED
DSTART 04-03-2011 12:30
DSTOP 05-03-2011 12:30
FLAGS 1
CPUSPEEDNW 2498,65
IOSEEKTIM 11,405
IOTFRSPEED 25595,605
...
Gather Workload Statistics
Calibrate I/O (Orion): Example
SET SERVEROUTPUT ON
DECLARE lat INTEGER;
iops INTEGER;
mbps INTEGER;
BEGIN
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (28, 10, iops, mbps, lat);
DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
DBMS_OUTPUT.PUT_LINE ('max_mbps = ' || mbps);
SET SERVEROUTPUT ON
DECLARE lat INTEGER;
iops INTEGER;
mbps INTEGER;
BEGIN
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (28, 10, iops, mbps, lat);
DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
DBMS_OUTPUT.PUT_LINE ('max_mbps = ' || mbps);
INFO INFO
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 443
This is a requirement for AUTODOP (automatic degree of parallelism in 11.2.0.2) in
addition PARALLEL_DEGREE_POLICY must be set to AUTO
Delete system stats and revert to the default values:
end;
/
end;
/
SQL> EXECUTE dbms_stats.delete_system_stats; SQL> EXECUTE dbms_stats.delete_system_stats;
Workload Stats: Further Information
See the Performance Tuning Guide for all stats:
http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/stats.htm#PFGRF94743
See also:
13.4.1.2 Multiblock Read Count
If you gather workload statistics, then the mbrc value gathered as part of the
workload statistics is used to estimate the cost of a full table scan. However,
during the gathering process of workload statistics, Oracle Database may
not gather the mbrc and mreadtim values if no table scans are performed
during serial workloads, as is often the case with OLTP systems. However,
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 444
during serial workloads, as is often the case with OLTP systems. However,
full table scans occur frequently on DSS systems but may run parallel and
bypass the buffer cache. In such cases, Oracle Database still gathers the
sreadtim value because the database performs index lookup using the
buffer cache.
If Oracle Database cannot gather or validate gathered mbrc or mreadtim
values, but has gathered sreadtim and cpuspeed values, then the
database uses only the sreadtim and cpuspeed values for costing. In this
case, the optimizer uses the value of the initialization parameter
DB_FILE_MULTIBLOCK_READ_COUNT to cost a full table scan.
However, if DB_FILE_MULTIBLOCK_READ_COUNT is not set or is set to 0
(zero), then the optimizer uses a value of 8 for costing.
Post Upgrade: Fixed Table Stats
Create fixed table statistics some days after the upgrade
has been completed:
Fixed objects (X$ tables) are usually undocumented and they are
not tagged by the Automatic Statistics Gathering job
Findings:
MMON may cause too much CPU load if fixed objects stats
Best Practice