sábado, 23 de mayo de 2015

Oracle Database Tuning: Mi tabla Mágica.!!!

Este fin de semana vamos a realizar un poco de magia.

Pero para realizar magia necesitamos a un mago, así que vamos a crear una cuenta común y corriente en nuestra base de de datos.

login as: root
root@10.0.0.1's password:
Last login: Mon May 25 18:29:22 2015
[root@dbvisit01 ~]# su - oracle
[oracle@dbvisit01 ~]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Mon May 25 18:36:34 2015
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> create user mago identified by magia;

User created.

Ahora sí, tenemos a mi mago dentro de la base de datos. Sin embargo, es necesario que le brinde algunos permisos adicionales de sistema, como que pueda crear procedimientos, funciones, llamar a algunas funciones del esquema "SYS" y no más.

SQL> grant create session to mago;

Grant succeeded.

SQL> alter user mago quota unlimited on users;

User altered.

SQL> grant create table to mago;

Grant succeeded.

Vamos a conectarnos con nuestro mago virtual y vamos a crear dos tablas idénticas, sólo que una de ellas será mágica.

SQL> connect mago/magia
Connected.
SQL> create table tabla_normal( orden number, nombre varchar2(10));

Table created.

SQL> create table tabla_magica( orden number, nombre varchar2(10));

Table created.

Vamos a agregar tan sólo 3 registros a cada una de las tablas.

SQL> insert into tabla_normal values(&secuencia, '&nombre');
Enter value for secuencia: 1
Enter value for nombre: EVA
old   1: insert into tabla_normal values(&secuencia, '&nombre')
new   1: insert into tabla_normal values(1, 'EVA')

1 row created.

SQL> /
Enter value for secuencia: 2
Enter value for nombre: ADAN
old   1: insert into tabla_normal values(&secuencia, '&nombre')
new   1: insert into tabla_normal values(2, 'ADAN')

1 row created.

SQL> /
Enter value for secuencia: 3
Enter value for nombre: PARAISO
old   1: insert into tabla_normal values(&secuencia, '&nombre')
new   1: insert into tabla_normal values(3, 'PARAISO')

1 row created.

SQL> commit;

Commit complete.

SQL>

SQL> insert into tabla_magica values(&secuencia, '&nombre');
Enter value for secuencia: 1
Enter value for nombre: EVA
old   1: insert into tabla_magica values(&secuencia, '&nombre')
new   1: insert into tabla_magica values(1, 'EVA')

1 row created.

SQL> /
Enter value for secuencia: 2
Enter value for nombre: ADAN
old   1: insert into tabla_magica values(&secuencia, '&nombre')
new   1: insert into tabla_magica values(2, 'ADAN')

1 row created.

SQL> /
Enter value for secuencia: 3
Enter value for nombre: PARAISO
old   1: insert into tabla_magica values(&secuencia, '&nombre')
new   1: insert into tabla_magica values(3, 'PARAISO')

1 row created.

SQL> commit;

Commit complete.

Ahora vamos a crear una función, que reciba como parámetro un valor numérico y espere un segundo antes de continuar con la siguiente ejecución. Para esto hemos brindado previamente el privilegio CREATE PROCEDURE y hemos dado permisos de ejecución sobre dbms_lock.

SQL> create or replace function un_segundo_espera ( val in number)
return number as
begin
dbms_lock.sleep(1);
return val;
end un_segundo_espera;
/

Recordemos, que nuestras tablas tienen una estructura de dos columnas únicamente.
SQL> set timing on

SQL> desc tabla_normal
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ORDEN                                              NUMBER
 NOMBRE                                             VARCHAR2(10)

Utilicemos la función para desplegar el valor de la columna "ORDEN" en la tabla normal, con la espera de 1 segundo entre tuplas.

SQL> select un_segundo_espera(orden) from tabla_normal;

UN_SEGUNDO_ESPERA(ORDEN)
------------------------
                       1
                       2
                       3

Elapsed: 00:00:03.02

Como pueden ver, el tiempo de ejecución es de 3 segundos, para 3 registros.

Volvamos a ejecutar la consulta.

SQL> /

UN_SEGUNDO_ESPERA(ORDEN)
------------------------
                       1
                       2
                       3

Elapsed: 00:00:03.00

Vamos consistentes con los tiempos de ejecución.

Ahora hagamos la misma consulta con la tabla mágica.

SQL> select un_segundo_espera(orden) from tabla_magica;

UN_SEGUNDO_ESPERA(ORDEN)
------------------------
                       1
                       2
                       3

Elapsed: 00:00:00.00

Que pasó.? Como es que la ejecución en la tabla mágica dura 0 segundos.?

Alguien esta haciendo trampa.!!!

Bueno la verdad no estamos haciendo trampa. ES MAGIA.!!!

Desde la versión de base de datos Oracle 11gR2, existe la característica que permite enviar a memoria, resultados generados sobre tablas de la base de datos. Esta característica se habilita utilizando la instrucción result_cache con el parámetro "mode force".

SQL> alter table tabla_magica result_cache ( mode force);

Table altered.

Elapsed: 00:00:00.03

Cuando la consulta es ejecutada por primera vez, vamos a experimentar un retardo de 2 veces el tiempo normal de ejecución. Esto es necesario para popular los registros en memoria.

SQL> select un_segundo_espera(orden) from tabla_magica;

UN_SEGUNDO_ESPERA(ORDEN)
------------------------
                       1
                       2
                       3

Elapsed: 00:00:06.02

Pero una vez hechos públicos los resultados en memoria, no existe tiempo de ejecución a nivel de la base de datos, para cada una de las consultas posteriores.

SQL> select un_segundo_espera(orden) from tabla_magica;

UN_SEGUNDO_ESPERA(ORDEN)
------------------------
                       1
                       2
                       3

Elapsed: 00:00:00.00

Vamos otra vez, para ver si es cierto.

SQL> /

UN_SEGUNDO_ESPERA(ORDEN)
------------------------
                       1
                       2
                       3

Elapsed: 00:00:00.00

Y si me salgo del SQL*Plus o la aplicación, se mantienen los datos en memoria.?

Veamos la prueba, para estar más seguros.

[oracle@dbvisit01 ~]$ sqlplus mago/magia

SQL*Plus: Release 12.1.0.2.0 Production on Mon May 25 19:01:20 2015
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Last Successful login time: Mon May 25 2015 18:53:10 -06:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select * from cat;

TABLE_NAME                     TABLE_TYPE
------------------------------ -----------
TABLA_NORMAL                   TABLE
TABLA_MAGICA                   TABLE

SQL> set timing on

Ejecutemos la consulta llamando a la función.

SQL> select un_segundo_espera(orden) from tabla_magica;

UN_SEGUNDO_ESPERA(ORDEN)
------------------------
                       1
                       2
                       3

Elapsed: 00:00:00.00

Que pasa si la base de datos se reinicia o si limpiamos el cache de resultados de la instancia de la base de datos.?

Pues, sería como si volviéramos a empezar. La primera ejecución deberá primero hacer públicos el resultado de mi consulta antes de obtener los mismos tiempos de respuesta.

Con la siguiente instrucción podemos eliminar los datos hechos públicos en el cache de memoria.

SQL> exec dbms_result_cache.flush;

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.05

Ejecutamos por primera vez la consulta con el resultado de los 6 segundos en el tiempo de ejecución.

SQL>  select un_segundo_espera(orden) from tabla_magica;

UN_SEGUNDO_ESPERA(ORDEN)
------------------------
                       1
                       2
                       3

Elapsed: 00:00:06.02

Para la segunda ejecución y las siguientes, el beneficio de nuestro acto de "MAGIA", se podrá ver.

SQL> select un_segundo_espera(orden) from tabla_magica;

UN_SEGUNDO_ESPERA(ORDEN)
------------------------
                       1
                       2
                       3

Elapsed: 00:00:00.00

Oracle SQL Magic: The Vanishing One Second Waits.

In this video Chris uses performance black magic to make a query that should take three seconds execute instantly. Watch the video to find out how you can use the same technique to reduce the execution time of your queries.


Daniel Burrus: Five Things Every College Graduate Must Know


This is the time of year when many students are graduating and faced with a major transition in life. It’s a prime time to think about the future—about the things you want to accomplish and the kind of person you want to become. As I look back on what I feel is a life well lived, I wanted to share a few insights that I hope you might find helpful.
You Are Writing Your Autobiography In Real Time – Make It A Great Story

Google, Huawei & Microsoft in the Internet of Things.


Source: thehackernews.com

Internet of Things is the future, and every big tech companies are trying to become an integral part of this upcoming trend. Keeping this in mind, Google is developing an operating system for connecting all devices via the Internet. Google is expected to launch a new Android-based operating system that would be lightweight enough to run on low-power devices connected to the "Internet of Things" (IoT), reported The Information. 

Google's Brillo OS for Internet Of Things 

The OS is dubbed "Brillo," and the news outlet claims the company is likely to release the new operating system under the Android brand next weekend at Google I/O, the company's annual conference for software developers. The connected OS, which may require as little as 32 or 64 MB of RAM to run, could be used on everything from major smart home appliances such as refrigerators, TVs to smaller tech such as garden monitors, light bulbs, door locks and sensors.

According to The Information, the search engine giant wants to design their own IoT communications schemes instead relying on the hardware vendors for IoT operating systems. Google will also offer Brillo for free to OEMs

Among IoT operating system and other things, Google is also expected to unveil some new features at Google I/O in San Francisco at the end of this month.

The major things among them include: 
  • A New Photo-Sharing Service. 
  • Next Google Android OS, dubbed 'Android M.' 
  • A New voice commands to access Android devices. 
Internet-Connected devices on Rise 

An analysed carried out by Gartner suggests that the number of Internet-connected devices will rise to 26 Billion in number by the year 2020 from 900 Million in 2009, making most of the "dumb" objects into smart devices that could communicate with each other.

Huawei launched LiteOS

Not alone Google, many tech companies have been making big bets on the Internet of Things. Just two days ago, Chinese telecommunication giant Huawei launched LiteOS, an operating system with just 10 KB in size designed for running connected appliances and machines.

Microsoft Releasing Windows 10 IoT

Moreover, reports suggest that Microsoft is releasing a version of Windows 10 called Windows 10 IoT Core that is meant to run on ultrasound machines, ATMs, and wearables. Also earlier this month, Samsung announced the Artik line of hardware that is designed for IoT devices with open software and Samsung hardware.

Data Integration Using Oracle Data Integrator

Data Integration Using Oracle Data Integrator

Demo session on Saturday, 30 May at 8:00 AM IST

attendee.gototraining.com•This training program is designed to prepare the students for Oracle Data Integration Developer track. This training program teaches student how to use Oracle Data Integrator

Registration link : https://attendee.gototraining.com/r/1323062499598297857

For complete details contact at mohit.dhawral@bispsolutions.com or VISIT www.bispsolutions.com

My Oracle Support How to use the Proactive Analysis Center (PAC) (Doc ID 1634073.2)

The Proactive Analysis Center (PAC) portal has replaced the proactive hardware services portal previously accessed via the My Oracle Support portal when clicking "Proactive Hardware Services".

Proactive Analysis Center (PAC) is a single, holistic system health reporting solution for proactive and reactive services accessible through the My Oracle Support (MOS) portal. PACs system health reports have become a cornerstone in improving overall system availability and can help to:
  • Quickly identify at risk systems with vulnerabilities
  • Manage risk through tracking/improving Operational Risk Index (ORI)
  • Decrease operational cost by managing downtime that can be scheduled by customer
  • Reduce service request and potentially the time to resolve issues

NOTE: You can access this feature in My Oracle Support if you have a Hardware SI and explorer files have been uploaded

Error en Oracle DataPump: ORA-39166: Object SYS.AUD$ was not found.

Tienes problemas a la hora de importar la auditoria de la base de datos, para reducir el monto del espacio ocupado hasta el momento, utilizando EXPDP.?

No te preocupes, es una restricción no un error. No es que la tabla no exista. 

No podemos exportar ninguno de los siguientes esquemas con DataPump:
  • SYS, 
  • ORDSYS, 
  • EXFSYS, 
  • MDSYS, 
  • DMSYS, 
  • CTXSYS, 
  • ORDPLUGINS, 
  • LBACSYS, 
  • XDB, 
  • SI_INFORMTN_SCHEMA, 
  • DIP, 
  • DBSNMP y 
  • WMSYS.
Aún cuando en "The Utilities Guide" indique que la restricción es solo para FULL EXPORT, esto aplica en la actualidad para todas las modalidades de DATAPUMP.

Versiones afectadas: Version 10.2.0.3 o superior.

Soporte: Nota Doc ID 553402.1 de MOS ( My Oracle Support )

[oracle@oracle dmp]$ expdp consultoria_dba/abcd1234 dumpfile=auditoria.dmp tables=SYS.AUD$

Export: Release 11.2.0.1.0 - Production on Fri May 22 18:43:19 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
Starting "CONSULTORIA_DBA"."SYS_EXPORT_TABLE_01": consultoria_dba/******** dumpfile=auditoria.dmp tables=SYS.AUD$

Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
ORA-39166: Object SYS.AUD$ was not found.
ORA-31655: no data or metadata objects selected for job
Job "CONSULTORIA_DBA"."SYS_EXPORT_TABLE_01" completed with 2 error(s) at 18:43:22

La solución:
Emplear el clásico utilitario de exportación EXP.

[oracle@oracle dmp]$ exp consultoria_dba/abcd1234 file=/opt/oracle/respaldos/dmp/auditoria.dmp tables=SYS.AUD$

Congratulations James Czuprynski, Oracle Database Upgrade, Migration & Transformation. Tips & Techniques


@jczuprynski Congratulations on this great achievement. @oracleace @OracleLatam Presente en Costa Rica #OTNTOUR 2015

A practical roadmap for database upgrade, migration, and transformation

This Oracle Press guide provides best practices for migrating between different operating systems and platforms, transforming existing databases to use different storage or enterprise systems, and upgrading databases from one release to the next. Based on the expert authors’ real-world experience, Oracle Database Upgrade, Migration & Transformation Tips & Techniques will help you choose the best migration path for your project and develop an effective methodology. Code examples and detailed checklists are included in this comprehensive resource.
  • Leverage the features of Oracle Data Guard to migrate an Oracle Database
  • Use Oracle Recovery Manager, transportable tablespace sets, and transportable database toolsets to migrate between platforms
  • Migrate databases with export/import
  • Use Oracle GoldenGate for zero or near-zero downtime migrations
  • Take advantage of the Cross-Platform Transportable Tablespace Set utility
  • Migrate to new storage platforms using the features of Oracle Automatic Storage Management
  • Upgrade to Oracle Database 12c with the Database Upgrade Assistant tool
  • Move seamlessly to Oracle's engineered systems
  • Migrate to the cloud

viernes, 22 de mayo de 2015

ODTUG ADF/Forms Webinars May & June 2015

ODTUG Webinars
ADF/Forms Webinars
ODTUG has two great upcoming Ask Me Anything webinars that we think might be of interest to you. These aren’t your run-of-the-mill webinars; they will be controlled by the viewers. Prepare to get all of your questions answered during these two Ask Me Anything sessions from top-level Oracle experts.
Our webinar calendar is constantly evolving! Check back frequently as more webinars will be added to the schedule.

Tuesday, May 26, 2015 12:00 PM - 1:00 PM EDT

Oracle Development and Mobile Tools AMAShay Shmeltzer, Oracle Corporation
During this "Ask Me Anything" session, Shay Shmeltzer, director of product management for Oracle’s development and mobile tools, will answer your questions about Oracle ADF, Oracle MAF, and Oracle's new Mobile and Developer Cloud Services. Shay has been working with Oracle development tools for over 20 years. He is a frequent presenter at conferences and often shares his expertise at http://blogs.oracle.com/shayand on Twitter at @jdevshay.


Monday, June 8, 2015 1:00 PM - 2:00 PM EDT
Ask Michael Anything: Finally Some Oracle Forms Answers!Michael Ferrante, Oracle Corporation

When is Forms 12c coming out? Is Forms dead? Will Forms ever run without a Java applet? Will we be able to run Forms on Chrome? How can I deploy my form to mobile devices?

The list of pressing questions about Oracle Forms seems endless, but we will get you some answers!

Join our free webinar hosted by Michael Ferrante, the Oracle Forms project manager himself. He has dedicated an hour of his time to put our fears to rest. Register early; only the first 100 people will be able to ask questions.


Other ADF Webinars:

Thursday, June 4, 2015 12:00 PM - 1:00 PM EDT

Oracle ADF and Java Team Development in the Cloud: Why and HowDana Singleterry, Oracle Corporation
Modern application life-cycle management – including continuous integration, automated testing, requirement tracking, and more – can improve the quality of the application your team produces. But the cost and complexities associated with setting up a DevOps infrastructure and process could become a stumbling block. A cloud-based solution might just be the right answer for your needs. In this session, we’ll share our experience with cloud-based DevOps. We’ll explain what to look for in such a solution, what is the impact on your daily operation, and what type of benefits you can get from such an environment. We’ll also include a demo that shows how Oracle is leveraging cloud-based DevOps to improve internal software development.


Kscope15 Register
Register for Kscope15 by June 9 to save $300 with the Advanced Rate! 
How do I become a member of ODTUG? Click here for details!
ODTUG Online Education

MICROSOFT ONECLIP PERMITE COPIAR Y PEGAR ENTRE EL PC Y TU DISPOSITIVO MÓVIL

ROBERTO ADEVA, para cincodias.com

Microsoft vuelve a sorprender creando una nueva aplicación bastante interesante y muy sencilla de utilizar que aunque de momento está en fase beta pero se ha filtrado el APK de la aplicación para que todo el que quiera pueda probarla.

Parece que el nombre definitivo es Microsoft OneClip y se trata de un servicio de sincronización de contenido entre el PC y los dispositivos móviles que aprovecha el servicio de almacenamiento en la nube. Este nuevo proyecto de Microsoft, que todavía no ha sido anunciado oficialmente va a estar disponible para PC, Android, iOS y Windows Phone.
OneClip no es ni más ni menos que un servicio de portapapeles que permite realizar esas acciones tan comunes decopiar y pegar contenido entre distintos dispositivos. Su funcionamiento es muy simple, ya que después de instalar la aplicación en el PC y en el dispositivo móvil correspondiente y emparejarlos a través de un código, cualquier contenido que sea copiado en el portapapeles del PC, ya setexto, enlaces, capturas de pantalla, etc, se sincronizará automáticamente en los dispositivos móviles, smartphones o tablets, y estará accesibles desde ellos para realizar nuevas acciones como enviarlo por email o compartirlo en las redes sociales.

Los contenidos copiados desde el pc, ya sean texto, fotos o capturas de pantalla a pesar de poderse ver desde el menú lateral, copiar o borrar, no son guardados en ningún momento en el PC, ya que únicamente son vistas previas y por lo tanto no ocupan espacio de almacenamiento.

OneClip se integra perfectamente en Windows 8 y aunque se espera que su presentación oficial sea en un periodo corto de tiempo, aquí os dejamos un enlace a la descarga de los archivos para instalar la aplicación y poder comenzar a probarla.