Antes de migrar de 10g a 11g o 12c, tome en cuenta las siguientes consideraciones. No es tan sencillo como simplemente cambiar de motor de base de datos, se necesita hacer consideraciones a nivel del aplicativo.
2. Agenda
Optimizador de consultas en Oracle Database, ( Optimización basada en
REGLA ó COSTO )
El parseo de instrucciones SQL en el motor de base de datos
Compartiendo eficazmente de planes de ejecución en la base de datos
Interpretación adecuada de los “Explain Plan” generados por la base de
datos
Consideraciones para el uso adecuado de Índices basado en optimización
por "Costo“
Diseño y manejo de concurrencia a nivel de la base de datos.
Concepto de AU ( Allocation Unit )
Buenas prácticas generales de afinamiento.
Weblogic Server 12c, Nuevo Servidor de Aplicaciones
6. Limit the Scope
• Where is the problem?
– Application (SQL)
– Instance
– Operating system
7. Setting the Priority
• Choose the problem that has the greatest impact:
– Analyze system performance in terms of work done (CPU or
service time) versus time spent waiting for work (wait time).
– Determine which component consumes the greatest amount of
time.
– Drill down to tune that component, if appropriate.
8. Oracle Architecture & Features
Concepto
Convencional:
Arquitectura Oracle
Instance y Database
Perspectiva física y
lógica
12. Considerations for SQL statements
Sensitive writing
Driving Table ( Pivote )
Clause: Where
13. Considerations for SQL statements
Table a = 20.000 rows
Table b = 25.000.000 rows
Order in clause FROM ?
1. FROM a, b
2. FROM b, a
14. Considerations for SQL statements
Table a = 20.000 rows
Table b = 25.000.000 rows
Table c = 10.000.000 rows
Order in clause FROM ?
1. FROM a, b, c
2. FROM b, c, a
3. FROM c, a, b
A ----- C
B ----- C
15. You Probably Do Not Need
to Use Bind Variables
Tom Kyte, Worst Practices
For Developers and DBAs Alike
16. El rendimiento no es una preocupación !!!
SQL>
SQL>
2
3
4
5
6
7
8
9
10
set timing on
begin
for i in 1 .. 100000
loop
execute immediate
'insert into t (x,y)
values ( ' || i ||
', ''x'' )';
end loop;
end;
/
SQL>
SQL>
2
3
4
5
6
7
8
9
10
set timing on
begin
for i in 1 .. 100000
loop
execute immediate
'insert into t (x,y)
values ( :i, ''x'' )'
using i;
end loop;
end;
/
17. Processing a DML Statement
Database
2
Data files
Control files
Redo log files
1
Server
process
UPDATE
employees ...
4
User
process
3
SGA
Database
buffer cache
Redo log
buffer
Shared pool
19. Reading an Execution Plan
0
1
TABLE ACCESS BY
INDEX ROWID
of DEPARTMENTS
2
INDEX FULL SCAN
DEPT_ID_PK
3
SELECT STATEMENT
MERGE JOIN
4
5
SORT JOIN
FULL TABLE SCAN
of EMPLOYEES
20. Selectivity
– Selectivity represents a fraction of rows from a row source.
• Selectivity affects the estimates of I/O cost.
• Selectivity affects the sort cost.
– Selectivity lies in a value range from 0.0 to 1.0.
– When statistics are available, the estimator uses them to
estimate selectivity.
– When statistics are not available the estimator uses default
values or dynamic sampling.
– With histograms on columns that contain skewed data, the
results are good selectivity estimates.
21. Cardinality and Cost
– Cardinality represents the number of rows in
a row source.
– Cost represents the units of work or
resource that are used.
22. Changing Optimizer Behavior
• The optimizer is influenced by:
–
–
–
–
–
–
–
SQL statement construction
Hints
Statistics
Data structure
System parameters
Session parameters
SQL Plan Management options
23. Using Hints
• Hints
– Are directives (suggestions) to the optimizer
– Require changing the code
SELECT /*+ INDEXto test specific access */ …
– Are useful (tablename indexname) paths
– Must be maintained through upgrades
– _optimizer_ignore_hints enables all
embedded SQL hints to be ignored
24. Optimizer Statistics
• The optimizer depends on various statistics to
determine an optimal execution plan for an SQL
statement.
– Some statistics are gathered at various times and are
controlled by statistic preferences.
• Object statistics
• Dictionary statistics
– Other statistics are only gathered manually.
• Statistics on fixed objects
• Operating system statistics
25. Extended Statistics
• Optimizer needs additional statistics in some cases.
– Multicolumn statistics for related columns (column groups)
• Collect statistics over a group of columns
• For complex predicates
• For equality predicates only
– Expression statistics for function-based indexes
• Collect statistics over an expression
• For expressions used in predicates
• Creates a virtual column
26. Controlling the Behavior of the Optimizer with
Parameters
• Optimizer behavior can be controlled using the
following initialization parameters:
–
–
–
–
–
CURSOR_SHARING = EXACT
DB_FILE_MULTIBLOCK_READ_COUNT = 8,16
OPTIMIZER_INDEX_CACHING = 0
OPTIMIZER_INDEX_COST_ADJ = 100
PGA_AGGREGATE_TARGET = nn MB/GB
– Optimizer underscore parameters:
• OPTIMIZER_FEATURES_ENABLE = Actual Version
• OPTIMIZER_MODE = ALL_ROWS
27. Optimizer with Parameters: Cursor_Sharing
Les facilito esta nota de Tom Kyte ( ASKTOM)
https://blogs.oracle.com/optimizer/entry/explain_adaptive_cursor_sharing_behavior_with
_cursor_sharing_similar_and_force
Aquí clarifica bastante el tema del uso de cursor_sharing para sus valores. La nota esta
en MOS es correcto, pero no esta obsoleto en 11g
También les paso esta otra nota de Morgan, ( otro viejo amigo ), que explica lo mismo y
que el valor esta aún disponible en 11.2.0.4
http://www.morganslibrary.org/reference/cursor_sharing.html
28. Enabling Query Optimizer Features
– The optimizer behavior can be set to prior
releases of the database.
– The OPTIMIZER_FEATURES_ENABLE
initialization parameter can be set to values of
different database releases (such as 8.1.7 or
12.1.0).
– Example:
OPTIMIZER_FEATURES_ENABLE=‘9.2.0';
29. Influencing the Optimizer Approach
•
The optimizer approach is to evaluate based on one of the following:
– Best throughput (default)
– Fastest response
•
The OPTIMIZER_MODE parameter can be set to change the approach:
– ALL_ROWS (default)
– FIRST_ROWS[_n]
•
The OPTIMIZER_MODE can be set at various levels
– System – ALTER SYSTEM SET…
– Session – ALTER SESSION SET…
– Statement – hint - /*+ FIRST_ROWS_10 */
30. Hash Joins
• A hash join is executed as follows:
– Both tables are split into as many partitions as
required, using a full table scan.
– For each partition pair, a hash table is built in
memory on the smallest partition.
– The other partition is used to probe the hash
table.
31. Sort-Merge Joins
• A sort-merge join is executed as follows:
1. The rows from each row source are sorted on
the join predicate columns.
2. The two sorted row sources are then merged
and returned as the resulting row source.
32. Join Performance
• Each join method works best in certain situations.
– Nested join
• Small tables
• Indexes on join columns
– Hash joins
• Large tables
• A large and small table
• A large portion of the table is selected for the join
– Merge-sort
• Non-equijoin
• Row sources are already sorted
33. How the Query Optimizer Chooses
Execution Plans for Joins
• The query optimizer determines:
–
–
–
–
–
Row sources
Type of join
Join method
Cost of execution plans
Other costs such as:
• I/O
• CPU time
• DB_FILE_MULTIBLOCK_READ_COUNT
– Hints specified
37. Optimizer effects on indexes
• Query returned more than 5%
– FTS for rule
• Invalid entries aprox 20%
– FTS for rule
• Query without index
– FTS for rule
• Table or Index without statistics
– FTS for rule
38. Nueva Plataforma de Tecnología
• 5 Pilares de la nube
•
IaaS
Infraestructura-as-a-Service (IaaS),•
que da a los usuarios acceso a los
componentes de la infraestructura
en una plataforma de Cloud, tales
como los sistemas operativos y
software de otro sistema
•
Base
de
datos-as-a-Service
(DBaaS), que ofrece a los usuarios
el acceso a bases de datos que se
ejecutan en una plataforma de
computación en nube
•
Platform-as-a-Service (PaaS), que
ofrece a los usuarios el acceso a
entornos
de
desarrollo
y
despliegue que se ejecutan en una
plataforma de Cloud
•
Software-as-a-Service (SaaS), que
ofrece a los usuarios acceso a las
soluciones que se ejecutan en una
plataforma de computación en
nube
DBaaS
PaaS
SaaS
MWaaS
Middleware-as-a-Service (MWaaS)
Ofrece un entorno completo que
consta de todos los servicios
necesarios para implementar y
ejecutar una aplicación de clase
empresarial.
40. Oracle Weblogic Server 12c
La más moderna versión de su servidor de aplicaciones Oracle
WebLogic Server 12c, es la pieza central de Cloud Application
Foundation y de Fusion Middleware, y esta especialmente diseñada
para desplegar sistemas de información convencionales, así como
de ingeniería y entornos en la nube.
41. Oracle Weblogic Server 12c
Está creada sobre tecnologías basadas en estándares
para cuestiones de portabilidad, eficiencia y facilidad de
integración.
42. Administración WebLogic Server
Cloud Management – Nuevo en Enterprise Manager Cloud Control 12c
WebLogic Server 12c
• Monitoreo de Rendimiento y
Diagnóstico
• Administración de Configuraciones
• Aprovisionamiento de Dominios y
Java EE App
• Integración con MOS & Support
Workbench
Administración en la Nube
• Self Service
• Medición y devoluciones de cargo
• Consolidation Planner
43. Oracle Weblogic Server 12c: Con OEM 12c
Oracle Forms 11gR2 ahora
puede ser monitorizado
desde RUEI ofreciéndonos
información de las páginas
visitadas por los usuarios,
cuánto tiempo permanecen
en ellas, etc.
44. Oracle Weblogic Server 12c: F&R Servicies
• Oracle Forms & Reports 12c, como parte de Fusion
Middleware. Integración con SOA, Coherence, Social.
Posiblemente liberado para finales del Y13, principios
de Y14
• A partir de la versión 13c de FMW, Reports ya no
formará parte del kit de desarrollo aplicativo. Oracle
Forms 13c y Oracle BI Publisher, es la combinación
para las futuras versiones.
45. Cuál es el Presente y Futuro de Forms & Reports ?
–
–
–
–
–
–
–
–
Oracle Forms 6i and Oracle Reports 6i will be de-supported effective 01/31/05.
Oracle Forms 9iAS R2, April 2002
Oracle Forms 10g 9.0.4, December 2003
Oracle Forms 10gR2, January 2005
Oracle Forms 11g , January 2011
Oracle announced that Oracle Forms & Reports does not go from 2017
March 2012, Oracle has no plan to discontinue support of Oracle Forms. Furthermore, a new
version of Forms, Oracle Forms 12c, is planned for delivery as a component of Oracle
Fusion Middleware 12c.
The last major changes to Oracle Reports were in the 10g release. Since then, there have
been limited new features added to the product in Oracle Reports 11gR1 and 11gR2.
Development efforts for Oracle Reports since 10g have been focused on stability and bug
fixes. We are planning to release Oracle Reports 12c as part of Oracle Fusion Middleware
12c.However, Oracle’s strategic reporting solution is now BI Publisher.
46. Recommendations for Oracle Customers Looking to
Migrate from Forms and Reports
– In some cases, there may exist a business driver to move existing
applications from Oracle Forms to a different technology choice. For
example, Oracle Forms may no longer be the ideal fit for the application
requirements, or you may be adopting a strategy to consolidate
disparate or heterogeneous development environments
– Oracle JDeveloper 11g with Oracle ADF is the tool of choice for
building applications on Fusion Middleware. However, given the
architectural difference between Java EE and Oracle Forms, Oracle
has no plans to offer a complete migration solution that attempts to
automatically migrate applications built with these tools to Java EE.
50. Oracle Weblogic Server 12c: Principales novedades
– Java EE 6 y Java SE 7
– Mejor productividad del desarrollador ( Jrockit, FastSwap,
Coherence )
– Implementación y administración simplificados con la virtualización
– Integración de la Gestión de Tráfico
– Alta Disponibilidad y Recuperación de Desastres
– Rendimiento mejorado
– Actualización sin problemas
51. WebLogic Server en Exalogic
Más rápido en nuestros sistemas – Nuevo en WebLogic Server 12c
Web
Requests/Sec.
JMS
Messages/sec.
Enterprise Java
Operations/Sec.
49,460
836,520
1,979,940
10X
78,840
Conventional Hardware
Exalogic
5X
5X
401,070
Conventional Hardware
Exalogic
9,560
Conventional Hardware
Exalogic
53. Oracle Weblogic Server 12c: Mejoras con Java EE 6
Java Classes*
Lines of Code*
Lines of XML*
25%
50%
80%
Less
Less
Less
• Less XML, Less Code
• Java Server Faces 2.0
• Java Servlets 3.0
• Java Persistence 2.0
• Enterprise Java Beans 3.1
& Interceptors 1.1
* Ejemplo
• Simplification, Productivity
• Managed Beans 1.0
• Bean Validation 1.0
• JAX-WS 2.2
basado en una aplicación construída para JavaOne
• Modernization
• Context & Dependency
Injection 1.0
• Bean Validation 1.0
• Java API for RESTful
Web Services
54. Weblogic Server 12c: Java SE 7: Más limpio, código
más fácil de mantener
• Oracle WebLogic Server 12c
soporta Java SE 7 ( y Java SE 6)
•
•
•
•
Optimización de lenguaje Java
Cliente/Servidor
Internacionalización
Capa de conexión segura SSL/TLS
(Transport Security Layer es el sucesor
para SSL )1.2 en JSSE (Java Secure
Socket Extension)
• Java VM concurrentes
In the area of management we've also delivered very significant enhancement to Oracle enterprise manage. Oracle enterprise manager is Oracle’s strategic technology for managing all of Oracle software and enterprise manager provides a management pack for managing WebLogic Server environments. And enterprise manager cloud control 12c has delivered enhancements to that which extend the benefits of using enterprise manager for managing WebLogic Server deployments, including cloud infrastructures. And these capabilities range from the ability to monitor very large-scale deployments of hundreds of servers and many WebLogic Server domains to doing deep drill-down performance analysis to managing configurations which are deployed across those domains and unique provisioning and now maintenance capabilities which greatly simplify the process of installing software on your server farms and maintaining that software all through a single pane of glass. So their unique capabilities for managing WebLogic Server infrastructures that can grow to a very significant scale.
Main point: we’ve made significant investment to deliver Extreme Performance with WebLogic on Exalogic.Script: Not only does Oracle WebLogic continue to lead on the industry standard benchmarks on conventional hardware, on Exalogic our engineered system, we have done specific architectural enhancements to WebLogic leveraging the high speed Infiniband network fabric that ties together the compute, storage, switch infrastructure of Exaloigc with performance results that go above and beyond what is achievable on conventional hardware. This is not just due to higher speed networking - though at 4X more bandwidth standard Ethernet and 10X better latency, it certainly helps. What changes the game is how WebLogic Server has been architected to take advantage of the additional bandwidth through something called parallel muxers and I/O enhancements (namely something called Scatter/Gather I/O) and also has been engineered to recognize the Exalogic hardware processors and local solid state storage to perform with results you see on this slide. Web applications can handle 10X requests/second, JMS applications can handle 5X messages/sec and SpecJ like complex applications see about 5X operations/second better than what is possible on conventional hardware. Bottom line: Not only is WebLogic on Exalogic superfast, again you need significantly less hardware to run the same workload which translates to significant savings.EL 1.0 multiple for Web: 3.4EL 1.0 multiple for JMS: 1.6EL 1.0 multiple for Enterprise Java: 2.2------------In the area of performance optimizations we delivered a performance optimizations and WebLogic Server 12c through capabilities like session affinity in the active GridLink for RAC technology. We delivered optimizations for running JMS on Exalogic hardware and other optimizations which extend WebLogic Server performance leadership and there is just some indicators here that suggest how much performance benefit you can actually realize by running on WebLogic Server and in particular running your WebLogic Server applications on the Exalogic engineered systems.
So what is all this mean for you we've got a number of new standards defined Java EE6 that enable that require less work for you building XML that require less code development. The APIs make it simpler to build your applications and make you more productive and in building applications and you can use modern techniques like contexts and dependency injection for accessing components throughout your application for example using a JSF to access managed beans and other resources in your applications. We tested this out building a sample application that was implemented both using Java EE5 standards and Java EE6 standards and in a sample application we found that using Java E6 you require 25% fewer classes in your at 50% less lines of code in about 80% less lines of XML. So this all means there's less code and XML to you to write and enables you to focus on building the business logic that your applications require.
Language enhancements:Strings in SwitchChanges to literalsMulti Catch, precise rethrowDiamond operatorTry with resources-----------------Getting back to standards WebLogic Server is and always has been standards-based another important development in the area standard support is Java SE many of you are aware I'm sure we announced Java SE7 this past summer. Java SE7 provides for new improvements to provide improved supports a new capabilities for building out applications optimizations within the Java language itself and WebLogic Server 12c supports both Java SE7 and Java SE6 so you as developers get the best of both worlds. For those of you who are very interested in taking advantage of the latest Java EE technologies you can use Java EE7 to build your WebLogic Server applications. I know NetBeans has picked up support for SE7 as well, they were very quickly to do that. I think Eclipse has picked up support for this as well. And I’m pretty sure that will be rolling into our enterprise pack shortly. Our goal is always to and make sure that developers have access to latest technologies as well as the option to use the more mature got Java EE6 technologies which we are also supporting so you get your choice of which JDK you want to use. We support, Java SE7 and SE6 both on the client and on the server Java SE7 provides new Internet internationalization support which we think are going to be important for those of you developing particularly abroad in Asia or in Europe. There are also some significant enhancements maybe as developers are not going to be terribly interested in the that there's some important developments in SSL such as SSL TLS 1.2 that are supported directly in JSSE within the JDK which were taking advantage of and WebLogic Servers were trying to leverage some of the new capabilities that are being delivered at the JDK level. So I’ve heard that TLS, the transport security layer is the successor to SSL, given some of the issues with it in the industry. That's right and for our customer's in financial services institutions or government agencies which have the most demanding security requirements we seeing lot of requirements to support the latest encryption technologies for the WebLogic Server applications. Now what about SE7 in particular, you mentioned some language changes? I think the probably the most notable one was something derived from project Coin, the term was coined to refer to a small change, or a number of features here and there which were delivered and they thought might be useful to various developers. It turns out that there's a diversity little developer enhancements which are actually in some total being considered fairly interesting and you now and in my experience in talking with developers there’s a fair amount of interest in getting their hands on Java EE7 to see what they can do and how we can make use of it.