0% found this document useful (0 votes)
107 views39 pages

SIG Wed 1345 Oracle 12c Database Performance and Recomendations PDF

Uploaded by

fakewizdom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views39 pages

SIG Wed 1345 Oracle 12c Database Performance and Recomendations PDF

Uploaded by

fakewizdom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Oracle 12c Database Performance and

Recommendations

David Simpson - IT Specialist – IBM Corporation


[email protected]

© 2014 IBM Corporation


Copyright and Trademark Information

For IBM – can be found at http://www.ibm.com/legal/us/en/copytrade.shtml


For Oracle – can be found at http://www.oracle.com/us/legal/index.html

© 2014 IBM Corporation


Linux is Linux ….
Oracle on System z (64bit) is very similar code as other 64bit Linux distributions.

Usually we see < 1% cpu overhead of running Oracle under z/VM.


– Gain enhanced performance reporting with z/VM.
– Allows for overcommit of processors (IFLs) and virtual memory.

Staying current with Oracle releases, Linux support packs, z/VM releases, hardware provides
some of the greatest non programmable performance gains as well as security compliance.

“Fit for Purpose” - databases and virtualization workloads vs. highly parallelized workloads.
– Oracle workloads gain high cpu utilizations and availability.
– System z processors have high clock speeds & cache

Many compiler enhancements with Oracle R12.1 on System z.

3 © 2014 IBM Corporation


Running Database Workloads on System z

4 © 2014 IBM Corporation


Oracle Testing 11.2.0.4 -> 12.1.0.1 - CPU Intensive Test
18.9% improvement in response time (cpu intensive test – concurrency)
Oracle 11.2.0.4
Running Parallel Processes: 32
real 0m12.01s
user 0m0.20s
sys 0m0.13s

Running Parallel Processes: 64


real 0m23.84s
user 0m0.40s
sys 0m0.26s

Oracle 12.1.0.1
Running Parallel Processes: 32
real 0m10.12s
user 0m0.16s
sys 0m0.14s

Running Parallel Processes: 64


real 0m20.05s
5user 0m0.34s © 2014 IBM Corporation
sys 0m0.27s
11.2.0.4 -> 12.1.0.1 - I/O Test
- Test: With Oracle I/O Calibrate (high I/O)
- Not much change between releases (for this particular I/O test)

Oracle 11.2.0.4 Oracle 12.1.0.1


max_iops = 332989 max_iops = 333576
latency = 0 latency = 0
max_mbps = 3109 max_mbps = 3116

6 © 2014 IBM Corporation


Oracle 12c – JIT Compiler Improvements
- New in Oracle 12.1.0.1 – JIT Compiler for Java Stored Procedures
versus interpreted.
Oracle 11.2.0.4 Oracle 12.1.0.1
alter session set java_jit_enabled=true; alter session set java_jit_enabled=true;
ERROR: ORA-02097: parameter cannot be -- Force compile
modified because specified value is invalid select dbms_java.compile_method
('JITDemo', 'factorial', '(J)J') from dual;
var time_compiled NUMBER;
var time_interpreted NUMBER; var time_compiled NUMBER;
exec :time_compiled := factorial(20); var time_interpreted NUMBER;
exec :time_compiled := factorial(20);
alter session set java_jit_enabled=false;
exec :time_interpreted := factorial(20); alter session set java_jit_enabled=false;
exec :time_interpreted := factorial(20);

INTERP_TIME_MS JIT_TIME_MS INTERP_TIME_MS JIT_TIME_MS


7 2893 2856 4148
© 2014 IBM Corporation
182
Help Desk Reporting System Test 11.2.0.3 -> 12.1.0.1

Oracle 11.2.0.4 12.1.0.1


1000 Concurrent Reports: 43:44.96 37:16.91
Report Time (mm:ss)

- DB with High Concurrency / Hot Data blocks


- 4.7 % Improvement from 11.2.0.3 -> 12.1.0.1 with Linux Large Pages
8
- 12.6 % Improvement with Linux Large Pages
© 2014 IBM Corporation
Help Desk System Test Summary

Embedded Function Call was being called multiple times per row…
– Modified Index to be more compact – PCTFREE 0 (columns were non update)
– Consolidated 2 sql checks to 1 to help reduce contention
– Reduced cpu consumption by 41% with just these 2 changes

Linux Large Pages recommended for Large databases with SGA > 10GB
with many user sessions, for both memory stability and performance (10%)

9 © 2014 IBM Corporation


11.2.0.4 -> 12.1.0.1 Banking Transaction Test

- Team started with 200 banking transactions per second (tps) on 2 IFLs
- 15.3% improvement with 12c from 9685 to 11676 banking transactions
per second, after upgrade to Oracle 12c (no other changes made).
- Reduced “concurrency” observed from 11.2.0.4 to 12.1.0.1
- Target tps was 10,000 tps -> achieved 12739 with 12 IFLs

10 © 2014 IBM Corporation


Banking Test Oracle Parameters
*._fastpin_enable=1 enable AWR – “consistent gets from cache (fastpath)”
*._ash_size=34077216 Helped remove ASH alert log messages.
*.aq_tm_processes = 0
*.audit_trail='NONE‘ for test wanted to avoid any audit overhead
*.db_file_multiblock_read_count = 1 app was doing a lot of full tablescans on a lookup table
(Normally we do not recommend changing)
*.resource_manager_plan='‘
#
*.db_cache_advice='OFF‘ Turned off AWR Stats once memory settings were optimized
*.statistics_level='BASIC‘ Can save 5-10% performance but you then have no perf data
*.trace_enabled = FALSE
*.use_large_pages='only'
#
*.max_dump_file_size=5M Limit dump files
*.parallel_max_servers = 0
*.parallel_min_servers = 0
*.replication_dependency_tracking = FALSE Reduce any overhead as not replicating

11 © 2014 IBM Corporation


Benefits of Multitenant Databases for SAAS Cloud
Consolidating many databases into an Oracle 12c multitenant architecture
provides a new SaaS Cloud model option for database consolidation.

Multitenant provides the following benefits:


– Previous schema consolidation issues (RMAN, Security) have been addressed.
– One set of “infrastructure” i.e. Oracle redo logs, UNDO.
– Cloning a database is quicker and easier.
– Unplug/Plug database options provides lower downtime for database patching.

Things to consider for grouping Multitenant databases:


– Downtime of projects all contained in the CDB i.e. Oracle patching
– Character sets
12 – Memory/cpu and process parameters © 2014 IBM Corporation
Working with Multitenant Databases
CDB is the multitenant container database and PDB – is the pluggable database.
Local user ids are specific to the pluggable DB only.

13 © 2014 IBM Corporation


Connecting to Pluggable Database
Application users connect to the database as before…

Application users do not have access to other Pluggable databases in the CDB.

14 © 2014 IBM Corporation


Oracle init Parameters for Pluggable Databases
Parameters that are modifiable for a pluggable DB can be queried from
v$system_parameter

To change a parameter for all containers in the CDB including spfile you can run:

15 © 2014 IBM Corporation


Performance of Multitenant Databases

Performance of a pluggable and a non-pluggable database about the same.

DB Name & Test 10 Total Trans User avg Sys avg I/O wait
Minutes (swingbench) utilization % utilization % avg %

test5_1_pdb +
test5_2_pdb 3,658,385 88.7 5.2 4.8
test3 + test4 (non
pluggable) 3,647,106 89.9 5.4 2.8

16 © 2014 IBM Corporation


Cloud Control 12c with Multitenant Databases
EM 12c (with 12.1.0.3 Database Plug-in supports Pluggable Databases)
Can use 12.1.0.2 cloud control with the 12.1.0.3 DB plugin. (12.1.0.5 is the latest)

17 © 2014 IBM Corporation


Cloning Multitenant pluggable Databases

Currently cloning requires the pluggable


database be opened in read-only mode.

System resources cpu, memory and disk


storage can be consumed quickly.

Ability to dynamically add cpu and storage with


Virtual environments and ASM is a great
compliment.

Snapshots can help with speed of clones and


amount of storage with “deltas” of main copy.

18 © 2014 IBM Corporation


12c Oracle Flex ASM
Linux can run out memory for some of the following reasons:
– PGA growth
– Linux page tables
– Increase (spike) in the number of user processes
– Memory leaks

Linux out of memory killer (OOM) can kill any non root Linux process, sometimes the ASM
Instance processes can get killed.

Linux out of memory killer (OOM) can kill any non root Linux process, a lot times it’s the ASM
Instance processes can get killed.

FlexASM allows for a database instance using ASM – to be relocated to another ASM
Instance in the cluster.
19 © 2014 IBM Corporation
Oracle CPU Improvements (11.2.0.2 -> 11.2.0.3)
Oracle’s VKTM process uses slightly less CPU minutes
– (about 0.08 vs. 0.09 with 11.2.0.2)

Great improvements with ora_dia0 process.


– (about 0.07 sec cpu/minute vs. 0.28 with 11.2.0.2)

Only Install the database modules that are needed


– DB installed with NO options
The "gettimeofday" function is called 300 times every 15 seconds.

– DB installed with all options : (java, xml, Text, spatial, APEX, etc ....... )
The "gettimeofday" function is called 1500 times every 15 seconds.
© 2014 IBM Corporation
20
Changing the database blocksize in a RAC environment

Changing the database blocksizes 8K ► 4K Changing the database blocksizes 8K ► 4 K


10%
6% 5%

Impact in %
4% 0%
-5%
2% -10%
-15%
0% -20%
-2% 1 -25%
-30%
-4% -35%
-40%
-6% -45%
-50%
-8%
Estd Interconnect traffic (KB)
transactional throughput GCS/GES messages sent/received
wait class: Cluster Global Cache blocks served/received
wait class: Commit CR Blocks recv
Comparing environment using 4KB database blocks instead of 8KB
– improves the throughput about 4%
– contention based on cluster events is reduced by more than 4%

Cluster events
– Locking: one node has to wait until the other node releases a lock, lock size is database page!
– Waits for datablocks, smaller blocks reduce the load on the Interconnect approximately by the half

© 2014 IBM Corporation


Choose the Best Oracle Audit Options

Problem: substantial additional CPU load depending on where the


data is being stored

Details see: Oracle Database Auditing: Performance Guidelines

Investigate if creating an OS audit file is an option for your


organization (audit_trail oracle parameter = OS or NONE)

OS 1.39% -> DB, Extended 15.79%

© 2014 IBM Corporation


Oracle RMAN Backup Compression

Backup Compression Backup Time Compression Size % Compression /


Source DB - 1.29 GB Input MB/s

‘Basic’ 10gR2 02:48 (168 s) 278.95 MB 78.9 %


(BZIP2) Compression 7.89 MB/s
‘High’ 11gR2 08:41 (521 s) 224.82 MB 83.0 %
(BZIP2) Compression 2.54 MB/s
‘Medium’ 01:08 (68 s) 295.53 MB 77.6 %
(ZLIB) Compression 19.46 MB/s
‘Low’ 00:28 (28 s) 357.03 MB 73.0 %
(LZO) Compression 47.26 MB/s

- RMAN Command -> CONFIGURE COMPRESSION ALGORITHM ‘Low‘


- Oracle Advanced Compression Feature required for Low, Medium, High
- Very High CPU observed with BZIP2
© 2014 IBM Corporation
23
Oracle Optimizer Hints
Oracle calculates the cpu cost for a sql query plan with:
– number cores (cpu_count)
– optimizer_mode (all_rows, first_rows etc) and
– the number of rows and bytes in table.
Before updating System Statistics After updating System Statistics

© 2014 IBM Corporation


24
Oracle Optimize – Running Statics

exec DBMS_STATS.GATHER_SYSTEM_STATS('NOWORKLOAD');
z9:
SNAME PNAME PVAL1
------------------------------ ------------------------------ ----------
SYSSTATS_MAIN CPUSPEEDNW 533
Linux bogomips per cpu: 6510.00

z196:
SNAME PNAME PVAL1
------------------------------ ------------------------------ ----------
SYSSTATS_MAIN CPUSPEEDNW 2335
Linux bogomips per cpu: 14367.00

zEC12:
SNAME PNAME PVAL1
------------------------------ ------------------------------ ----------
SYSSTATS_MAIN CPUSPEEDNW 2613
Linux bogomips per cpu: 18115.00

Should be done for every hardware upgrade on an idle system


© 2014 IBM Corporation
25
Locking Table Statistics for Large Tables
DBMS_STATS.UNLOCK_TABLE_STATS(ownname => ‘USERS', tabname => ‘XXX');

DBMS_STATS.GATHER_TABLE_STATS(ownname => 'USERS ', tabname => ' XXX',


estimate_percent=>1, cascade =>TRUE, degree =>4);

DBMS_STATS.LOCK_TABLE_STATS(ownname => ‘USERS', tabname => ‘XXX');

Reduces Unnecessary
Statistics Collection

© 2014 IBM Corporation


26
Collect Oracle AWR Data

Instance Efficiency Percentages


Buffer Nowait %: 99.97 Redo NoWait %: 100.00

Buffer Hit% = 98.89 Buffer Hit %: 98.89 In-memory Sort %: 100.00


Library Hit %: 70.53 Soft Parse %: 26.01
Execute to Parse %: 28.44 Latch Hit %: 99.96
Parse CPU to Parse Elapsd %: 30.81 % Non-Parse CPU: 89.14
Oracle SGA Buffer Pool Advisory
P Size for Est (M) Size Factor Buffers for Estimate Est Phys Read Factor Estimated Physical Reads
• Predicts 29 (of 87)
D 256 0.64 16,080 1.11 97,368,882
million block reads
D 288 0.72 18,090 1.11 96,868,286
D 320 0.80 20,100 1.08 94,323,210
could be eliminated
D 352 0.88 22,110 1.05 91,776,695
over 30 minute period
D 384 0.96 24,120 1.02 89,228,794
by adding 240 MB of
D 400 1.00 25,125 1.00 87,480,193
buffer pool cache:
D 416 1.04 26,130 0.98 85,731,549
D 448 1.12 28,140 0.94 82,232,582
• 2,000 read IOs
D 480 1.20 30,150 0.90 78,731,330
/second
D 512 1.28 32,160 0.86 75,225,110
• 16,000 blocks
D 544 1.36 34,170 0.82 71,715,825
/second
D 576 1.44 36,180 0.78 68,209,778
D 608 1.52 38,190 0.72 63,357,042 • 125 MB/second
27D 640 1.60 40,200 0.67 58,494,659 © 2014 IBM Corporation
27 • A 33% savings
Log Buffer Size & Redo Log File Size

Oracle10gR2+ best to let Oracle automatically set the optimal log_buffer size. (i.e. leave unset
in the init.ora).
Check AWR Report - ideally log switches every 15 – 20 minutes.
If log switches more frequent you should increase size of logs.
If using fast_start_mttr_target then can use:
select optimal_logfile_size from v$instance_recovery;

Data DG FRA DG
ERP DB
BI DB
HR DB

© 2014 IBM Corporation


28
Oracle Resource Manager-
(resmgr:cpu quantum Wait Event)

1) Modify Oracle Initialization parameter - resource_manager_plan = ‘’

2) Additionally You need disable the Maintenance Window Resource Plan

select window_name,RESOURCE_PLAN
from DBA_SCHEDULER_WINDOWS;

WINDOW_NAME RESOURCE_PLAN
------------------------------ ------------------------------
MONDAY_WINDOW DEFAULT_MAINTENANCE_PLAN

execute dbms_scheduler.set_attribute( ‘MONDAY_WINDOW','RESOURCE_PLAN','');

WINDOW_NAME RESOURCE_PLAN
------------------------------ ------------------------------
MONDAY_WINDOW © 2014 IBM Corporation
29
Performance Management Strategies – Linux on System z
Performance problems usually come in 2 main areas :
– Database wide problems (problems which affect all users and sql queries)
– Query specific problems (problems which affect only one, or few, queries)

Query specific issues – many of the Oracle supplied query diagnostic tools work well.
Oracle Enterprise Manager 12c (12.1.0.2 / 12.1.0.3 contains capabilities for 12c databases)
– Linux on System z agents are deployed from centralized OMS server.

EM 12c - performance drilldowns:

30 © 2014 IBM Corporation


Performance Triage & Resolution

31 Source: Getting Optimal Performance from Oracle E-Business Suite - Samer Barakat OOW 2013 © 2014 IBM Corporation
Oracle Performance Diagnostics
Snapshots (take snaps before & after test):
– exec DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT;

AWR Report (@?/rdbms/admin/awrrpt.sql)


– Workload Repository Report – Top events to start

ADDM report (@?/rdbms/admin/addmrpt.sql)


– Oracle provided recommendations for further analysis

ASH Report (use particularly for concurrency issues)


– @?/rdbms/admin/ashrpt.sql

SQR Report (With sqlid get the explain plan)


– @?/rdbms/admin/awrsqrpt.sql
32 © 2014 IBM Corporation
Oracle Performance Diagnostics
Sample ADDM Report…

33 © 2014 IBM Corporation


Oracle Performance Diagnostics
Sample ASH Report:

34 © 2014 IBM Corporation


Oracle Performance Diagnostics
Sample SQR Report…specify same AWR parameters as well as SQLID

35 © 2014 IBM Corporation


Oracle’s Remote Diagnostic Agent (RDA) Reports – Note: 314422.1

RDA HTML Menu

Summarized
Errors

Performance
Reports

© 2014 IBM Corporation


36
Oracle OS Watcher Reports – Problem Avoidance

© 2014 IBM Corporation


37
References
White Papers / Presentations:
– Oracle Database on Linux on System z - Disk I/O Connectivity Study
– Oracle Real Application Clusters on Linux on IBM System z: Set up and network performance tuning
– Performance of an Oracle 10g R2 Database Import Environment
– Using the Linux cpuplugd Daemon to manage CPU and memory resources from z/VM Linux guests
– Oracle Database Auditing: Performance Guidelines
– Analyzing BI Oracle Workloads Performance Tuning Results – Real Customer Examples
– Oracle RAC Networking Alternatives on Linux on System z and Red Hat 6 Oracle DB Support

Redbooks:
sg248159 - 12c Experiences http://www.redbooks.ibm.com/redpieces/abstracts/sg248159.html?Open
sg248104 - 11gR2 Experiences http://www.redbooks.ibm.com/abstracts/sg248104.html?Open

Cookbook for Linux & z/VM:


http://www.redbooks.ibm.com/redpieces/abstracts/sg248147.html?Open

zSeries Oracle SIG Conference Presentations:


38
http://zseriesoraclesig.org © 2014 IBM Corporation
Open Microphone
(Suggestions / Questions)

© 2014 IBM Corporation

You might also like