[ 2017-10-23 ]

Cómo utilizar SQLHC para análizar un SQL - Ejemplo práctico


En el post anterior: "Que es SQL Tuning Health-Check (SQLHC)?" hablamos sobre la herramienta SQLHC para analizar y mejorar consultas SQL.       
Ahora vamos a ver un ejemplo de como utilizar esta herramienta sobre una consulta real, y como ver e interpretar los resultados obtenidos.
Para nuestro ejemplo vamos a utilizar una base de datos 12cR1 en la cual creamos un esquema “demo” y una tabla “T1”
A continuación las sentencias utilizadas para la creación de la tabla que utilizaremos en la consulta de nuestro ejemplo:

[oracle@server01 dbs]$ sqlplus demo/demo

SQL> create table t1 ( c1 int, c2 int, c3 char(10) );
Table created.

SQL> begin
     for i in 1 .. 100000
       loop
         insert into t1 values ( i, dbms_random.value(1,500), dbms_random.string('L', 10) );
         end loop;
         commit;
     end;
    /

PL/SQL procedure successfully completed.

[ 2017-10-20 ]

Novedades Oracle Database Cloud Service - Octubre 2017

October 2017

FeatureDescription
Aug 2017 RU patch available for Release 12.2 single-instance databases
The August 2017 Release Update (RU) is now available to patch existing Database Cloud Service database deployments running Oracle Database Release 12.2 and hosting a single-instance database or an Oracle Data Guard configuration of single-instance databases, provided that you use a command-line utility to apply the patch. See these topics in Using Oracle Database Cloud Service:
Jul 2017 PSU and BP patches available for Release 11.2 and 12.1 single-instance databases
The July 2017 Patch Set Update (PSU) and Bundle Patch (BP) are now available to patch existing Database Cloud Service database deployments running Oracle Database Release 11.2 or 12.1 and hosting a single-instance database or an Oracle Data Guard configuration of single-instance databases, provided that you use a command-line utility to apply the patch. See these topics in Using Oracle Database Cloud Service:


[ 2017-10-19 ]

Oracle Critical Patch Update Advisory - October 2017


October 17, 2017

Oracle Critical Patch Update for October 2017

The Critical Patch Update for October 2017 was released on October 17th, 2017.
Oracle strongly recommends applying the patches as soon as possible.

If you are new to this process, please review Oracle's Security Fixing Policies and the Critical Patch Update Advisory. After reviewing these resources, if you are unable to determine if you require a software update, or how to apply it, please contact Oracle Support.

The Critical Patch Update Advisory is the starting point for relevant information. It includes the list of products affected, pointers to obtain the patches, a summary of the security vulnerabilities for each product suite, and links to other important documents. Supported products that are not listed in the "Affected Products and Components" section of the advisory do not require new patches to be applied.

Also, it is essential to review the Critical Patch Update supporting documentation referenced in the Advisory before applying patches, as this is where you can find important pertinent information. Critical Patch Update Advisories are available at the following location:

[ 2017-10-15 ]

Oracle Developer Tour Argentina (Evento Gratuito)

Evento que se celebrará a la hora, en la fecha y ubicación siguientes:
Lunes, 13 de noviembre de 2017 a las 08:00 
- hasta -
Martes, 14 de noviembre de 2017 a las 18:00 (ART)
Universidad Tecnológica Nacional - Facultad Regional Córdoba
Ciudad Universitaria, Maestro M. Lopez esq. Cruz Roja
Lugar: Auditorio UTN
Córdoba
Argentina

Ver mapa 

[ 2017-10-12 ]

Que es SQL Tuning Health-Check (SQLHC)?


SQL Tuning Health-Check, también conocido como SQLHC, es una herramienta de tuning SQL basada en scripts y desarrollada por Oracle Server Technologies Center of Expertise. Es un subconjunto de los SQL  utilizados por SQLTXPLAIN (SQLT), otra herramienta desarrollada por Carlos Sierra y que Oracle utiliza para diagnosticar sentencias SQL con bajo rendimiento.
SQLHC se utiliza fundamentalmente  para analizar y verificar el entorno en el cual se ejecuta una sentencia SQL en particular, verificando distintos factores como  ser, estadísticas de optimizador(CBO), metadatos de objetos, parámetros de configuración y demás elementos que pueden influir en la performance  de la sentencia SQL que está siendo analizada.
El objetivo principal es permitir que los usuarios puedan detectar y evitar los problemas previsibles,  que puedan afectar el rendimiento en la ejecución de un SQL,  garantizando de esta manera un entorno de ejecución lo más óptimo posible para un determinado query SQL.

Este utilitario es totalmente gratuito (FREE), pero debemos tener en cuenta que de acuerdo a las opciones que tenemos licenciadas en nuestra base de datos target, vamos a poder obtener menor o mayor información como resultado de la ejecución del script. Al ejecutar la herramienta tendremos que especificar alguna de las diferentes opciones de licenciamiento:

Oracle Pack License (Tuning, Diagnostics or None) [T|D|N] (required)
·         Tuning Pack (T)
·         Diagnostic Pack (D)
·         None (N) ninguna de las opciones disponibles.

En el caso de no pasar este parámetro (licenciamiento) durante la ejecución, nos lo será requerido de forma mandatoria:

SQL>@sqlhc 0j7vkwyr0a2st
Parameter 1:
Oracle Pack License (Tuning, Diagnostics or None) [T|D|N] (required)

[ 2017-10-06 ]

Novedades Oracle Database Cloud Service - Septiembre 2017

September 2017

FeatureDescription
Universal Credits subscription model
Database Cloud Service now supports the Universal Credits subscription model. In the Universal Credits subscription model, you commit to pay a certain amount up front monthly or annually for a bundle of services. Under this model, you can use any combination of the services such as Oracle Database Cloud Service and Oracle Java Cloud Service in your bundle whenever you need them. For information, see Selecting a Payment Plan in Getting Started with Oracle Cloud.
Create database deployments on Oracle Cloud Infrastructure
Database Cloud Service now supports database deployments on Oracle Cloud Infrastructure in addition to Oracle Cloud Infrastructure Classic. If your account has access to Oracle Cloud Infrastructure regions, you can select one of these regions when creating certain types of database deployments. For more information, see About Database Deployments in Oracle Cloud Infrastructure in Using Oracle Database Cloud Service.
QuickStart templates available to create deployments easily
For new customers with a Universal Credits subscription Database Cloud Service provides three QuickStart templates that create database deployments of commonly used configurations. You simply pick a template and give the deployment a name. Database Cloud Service then uses an Oracle Cloud Stack Manager template to provide all the other configuration information. For details, see Creating a QuickStart Database Deployment in Using Oracle Database Cloud Service.
Leverage existing licenses when creating database deployments
For new customers with a Universal Credits subscription Database Cloud Service provides a “Bring your own license” feature you can use when creating database deployments. If you have existing perpetual licenses to Oracle Database, you can use one when creating a database deployment to establish the right to use Oracle Database. Then, your Cloud account will be charged a lesser amount for the new deployment because the right to use Oracle Database is covered by your perpetual license agreement.
Cloud tooling update available for deployments hosting Oracle RAC databases
The 17.3.5 update to cloud tooling is available to apply to existing Database Cloud Servicedatabase deployments that host Oracle RAC databases. To apply this update, use the tag 1735 when following the instructions Updating the Cloud Tooling by Using the raccli Utility in Using Oracle Database Cloud Service.
Linux OS security patching
You can apply Linux OS security patches to compute nodes hosting Database Cloud Service database deployments. See Applying Linux OS Security Patches in Using Oracle Database Cloud Service.

[ 2017-10-03 ]

Obteniendo un "transaction ID" en nuestra propia sesión

En el siguiente post vamos a ver como obtener el ID de una transacción(XID) activa en nuestra propia sessión en la base de datos.
El "Transaction ID"(XID) esta conformado por los siguientes datos: 
  • nro. de Undo Segment     
  • nro. de Slot 
  • nro. de SEQ.
Para obtener este identificador, vamos a utilizar el procedure
local_transaction_id  del package dbms_transaction (dbms_transaction.local_transaction_id)
  
Voy a ejemplificar el uso de este procedimiento utilizando una tabla creada para el caso, llamada T1, sobre la cual  luego voy a abrir una transacción (insert).


SQL> create table t1 (c1 number, c2 varchar2(20));

Table created

Una vez creada la tabla, podemos verificar si hay transacciones activas utilizando el procedure. Vemos que aún no hay ninguna en nuestra sesión:

SQL> select dbms_transaction.local_transaction_id from dual;

LOCAL_TRANSACTION_ID
--------------------------------------------------------------------------------