miércoles, 26 de febrero de 2014

Analizando sentencias con SQL Profile activo en Oracle

Si queremos analizar la performance de una sentencia SQL que tiene un SQL profile habilitado (Oracle 10g o posterior) sin afectar al resto de los usuarios del sistema, ¿cómo hacemos para ver el plan de ejecución original de la sentencia si no se usara el SQL profile?.
Asumiendo que lo vamos a hacer un tiempo después de tener el SQL profile activo y por lo tanto no está presente en la SGA (V$SQL) ni en el repositorio de AWR.

No es necesario deshabilitar ni borrar el SQL profile existente, se puede cambiar el parámetro SQLTUNE_CATEGORY a nivel de sesión para que no se use el SQL profile activo:
SQL> alter session set sqltune_category='OTRA';
Los SQL profile se crean en una categoría (por defecto 'default'), y se usan si la categoría de la sesión (este parámetro) coincide con la del SQL profile creado. Para ver el plan de ejecución original de la sentencia sin usar el SQL profile activo, alcanza con asignar un string cualquiera a la categoría de la sesión actual.

A continuación vemos un ejemplo completo de este comportamiento, incluyendo la creación de un SQL profile sobre una sentencia para forzar el uso de un índice, y luego cambiar este parámetro para ver el plan original, usando Oracle Enterprise Edition 11.2.0.2.

Uso el script coe_xfr_sql_profile.sql provisto por Oracle en el utilitario SQLT (ver nota de soporte 215187.1)  para crear un SQL profile a partir de los hints de una sentencia previamente ejecutada. Esta es la forma más simple de crear un SQL profile para ilustrar con un ejemplo reproducible el cambio de parámetro, aunque el caso queda un tanto artificial. Hay mucha documentación sobre las formas de crear SQL Profiles, pero no es el foco de este post.
De todas formas, este procedimiento es muy útil para troubleshooting de performance, por lo que es interesante tenerlo presente, aunque en este caso solo sea para ilustrar.

Primero creo una tabla, un índice, y ejecuto una consulta que lo usa:
oracle@oraculo:~> sqlplus / as sysdba SQL*Plus: Release 11.2.0.2.0 Production on Mié Feb 26 14:55:15 2014 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, Real Application Clusters and Automatic Storage Management options 14:56:08 SQL> alter session set current_schema=PRU; Session altered. 14:56:46 SQL> create table pp(n number, c varchar2(100)); Table created. 14:57:03 SQL> insert into pp select rownum, object_id from dba_objects where rownum < 100; 99 rows created. 14:57:33 SQL> create index pp_idx on pp(n); Index created. 14:57:52 SQL> select * from pp where n=1; N C ---------- --------------------------------------------------------------------------------- 1 28 14:59:17 SQL> select * from table(dbms_xplan.display_cursor); PLAN_TABLE_OUTPUT -------------------------------------------------------------------------------------------- SQL_ID 86svufrd72xqg, child number 0 ------------------------------------- select * from pp where n=1 Plan hash value: 2830885032 -------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | | | 1 (100)| | | 1 | TABLE ACCESS BY INDEX ROWID| PP | 1 | 65 | 1 (0)| 00:00:01 | |* 2 | INDEX RANGE SCAN | PP_IDX | 1 | | 1 (0)| 00:00:01 | -------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("N"=1) Note ----- - dynamic sampling used for this statement (level=2) 23 rows selected.
Ya tenemos nuestra tabla PP con un índice sobre la columna N, y la consulta que lo usa.
Ahora creamos otra consulta que hace un full scan sobre la tabla, y es a la que luego vamos a asignarle un SQL profile para que use el índice:
14:59:22 SQL> select /*+ full(pp)*/ * from pp where n=1; N C ---------- ----------------------------------------------------------------------------------- 1 28 14:59:37 SQL> select * from table(dbms_xplan.display_cursor); PLAN_TABLE_OUTPUT ---------------------------------------------------------------------------------------------- SQL_ID btpjqgv0u0stb, child number 0 ------------------------------------- select /*+ full(pp)*/ * from pp where n=1 Plan hash value: 2338859486 -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | | | 3 (100)| | |* 1 | TABLE ACCESS FULL| PP | 1 | 65 | 3 (0)| 00:00:01 | -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("N"=1) Note ----- - dynamic sampling used for this statement (level=2) 22 rows selected. 15:02:10 SQL> col sql_text for a45 15:02:10 SQL> select sql_id, plan_hash_value, executions, sql_text from v$sql where sql_id in ('btpjqgv0u0stb','86svufrd72xqg'); SQL_ID PLAN_HASH_VALUE EXECUTIONS SQL_TEXT ------------- --------------- ---------- --------------------------------------------- btpjqgv0u0stb 2338859486 1 select /*+ full(pp)*/ * from pp where n=1 86svufrd72xqg 2830885032 1 select * from pp where n=1
Vemos los SQL_ID de ambas consultas, junto con el plan de ejecución usado.
Ahora usamos el script coe_xfr_sql_profile.sql para crear un SQL profile a la consulta lenta (btpjqgv0u0stb) y que use el plan de la otra (2830885032). Estos son los parámetros que se le deben ingresar al script:
SQL> sta coe_xfr_sql_profile.sql Parameter 1: SQL_ID (required) Enter value for 1: btpjqgv0u0stb PLAN_HASH_VALUE AVG_ET_SECS --------------- ----------- 2338859486 ,004 Parameter 2: PLAN_HASH_VALUE (required) Enter value for 2: 2830885032 Values passed to coe_xfr_sql_profile: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SQL_ID : "btpjqgv0u0stb" PLAN_HASH_VALUE: "2830885032" SQL>BEGIN 2 IF :sql_text IS NULL THEN 3 RAISE_APPLICATION_ERROR(-20100, 'SQL_TEXT for SQL_ID &&sql_id. was not found in memory (gv$sqltext_with_newlines) or AWR (dba_hist_sqltext).'); 4 END IF; 5 END; 6 / SQL>SET TERM OFF; SQL>BEGIN 2 IF :other_xml IS NULL THEN 3 RAISE_APPLICATION_ERROR(-20101, 'PLAN for SQL_ID &&sql_id. and PHV &&plan_hash_value. was not found in memory (gv$sql_plan) or AWR (dba_hist_sql_plan).'); 4 END IF; 5 END; 6 / SQL>SET TERM OFF; Execute coe_xfr_sql_profile_btpjqgv0u0stb_2830885032.sql on TARGET system in order to create a custom SQL Profile with plan 2830885032 linked to adjusted sql_text. COE_XFR_SQL_PROFILE completed.
Vemos que se ejecutó de forma exitosa, así que nos generó un script que crea el SQL profile.
Lo ejecutamos:
SQL> sta coe_xfr_sql_profile_btpjqgv0u0stb_2830885032.sql SQL> REM SQL> REM $Header: 215187.1 coe_xfr_sql_profile_btpjqgv0u0stb_2830885032.sql 11.4.4.4 2014/02/26 carlos.sierra $ SQL> REM SQL> REM Copyright (c) 2000-2012, Oracle Corporation. All rights reserved. SQL> REM SQL> REM AUTHOR SQL> REM carlos.sierra@oracle.com SQL> REM SQL> REM SCRIPT SQL> REM coe_xfr_sql_profile_btpjqgv0u0stb_2830885032.sql SQL> REM SQL> REM DESCRIPTION SQL> REM This script is generated by coe_xfr_sql_profile.sql SQL> REM It contains the SQL*Plus commands to create a custom SQL> REM SQL Profile for SQL_ID btpjqgv0u0stb based on plan hash SQL> REM value 2830885032. SQL> REM The custom SQL Profile to be created by this script SQL> REM will affect plans for SQL commands with signature SQL> REM matching the one for SQL Text below. SQL> REM Review SQL Text and adjust accordingly. SQL> REM SQL> REM PARAMETERS SQL> REM None. SQL> REM SQL> REM EXAMPLE SQL> REM SQL> START coe_xfr_sql_profile_btpjqgv0u0stb_2830885032.sql; SQL> REM SQL> REM NOTES SQL> REM 1. Should be run as SYSTEM or SYSDBA. SQL> REM 2. User must have CREATE ANY SQL PROFILE privilege. SQL> REM 3. SOURCE and TARGET systems can be the same or similar. SQL> REM 4. To drop this custom SQL Profile after it has been created: SQL> REM EXEC DBMS_SQLTUNE.DROP_SQL_PROFILE('coe_btpjqgv0u0stb_2830885032'); SQL> REM 5. Be aware that using DBMS_SQLTUNE requires a license SQL> REM for the Oracle Tuning Pack. SQL> REM 6. If you modified a SQL putting Hints in order to produce a desired SQL> REM Plan, you can remove the artifical Hints from SQL Text pieces below. SQL> REM By doing so you can create a custom SQL Profile for the original SQL> REM SQL but with the Plan captured from the modified SQL (with Hints). SQL> REM SQL> WHENEVER SQLERROR EXIT SQL.SQLCODE; SQL> REM SQL> VAR signature NUMBER; SQL> VAR signaturef NUMBER; SQL> REM SQL> DECLARE 2 sql_txt CLOB; 3 h SYS.SQLPROF_ATTR; 4 PROCEDURE wa (p_line IN VARCHAR2) IS 5 BEGIN 6 DBMS_LOB.WRITEAPPEND(sql_txt, LENGTH(p_line), p_line); 7 END wa; 8 BEGIN 9 DBMS_LOB.CREATETEMPORARY(sql_txt, TRUE); 10 DBMS_LOB.OPEN(sql_txt, DBMS_LOB.LOB_READWRITE); 11 -- SQL Text pieces below do not have to be of same length. 12 -- So if you edit SQL Text (i.e. removing temporary Hints), 13 -- there is no need to edit or re-align unmodified pieces. 14 wa(q'[select /*+ full(pp)*/ * from pp where n=1]'); 15 DBMS_LOB.CLOSE(sql_txt); 16 h := SYS.SQLPROF_ATTR( 17 q'[BEGIN_OUTLINE_DATA]', 18 q'[IGNORE_OPTIM_EMBEDDED_HINTS]', 19 q'[OPTIMIZER_FEATURES_ENABLE('11.2.0.2')]', 20 q'[DB_VERSION('11.2.0.2')]', 21 q'[OPT_PARAM('optimizer_index_cost_adj' 1)]', 22 q'[OPT_PARAM('optimizer_index_caching' 100)]', 23 q'[ALL_ROWS]', 24 q'[OUTLINE_LEAF(@"SEL$1")]', 25 q'[INDEX_RS_ASC(@"SEL$1" "PP"@"SEL$1" ("PP"."N"))]', 26 q'[END_OUTLINE_DATA]'); 27 :signature := DBMS_SQLTUNE.SQLTEXT_TO_SIGNATURE(sql_txt); 28 :signaturef := DBMS_SQLTUNE.SQLTEXT_TO_SIGNATURE(sql_txt, TRUE); 29 DBMS_SQLTUNE.IMPORT_SQL_PROFILE ( 30 sql_text => sql_txt, 31 profile => h, 32 name => 'coe_btpjqgv0u0stb_2830885032', 33 description => 'coe btpjqgv0u0stb 2830885032 '||:signature||' '||:signaturef||'', 34 category => 'DEFAULT', 35 validate => TRUE, 36 replace => TRUE, 37 force_match => FALSE /* TRUE:FORCE (match even when different literals in SQL). FALSE:EXACT (similar to CURSOR_SHARING) */ ); 38 DBMS_LOB.FREETEMPORARY(sql_txt); 39 END; 40 / PL/SQL procedure successfully completed. SQL> WHENEVER SQLERROR CONTINUE SQL> SET ECHO OFF; SIGNATURE --------------------- 613978514929328923 SIGNATUREF --------------------- 16370312570377067161 ... manual custom SQL Profile has been created COE_XFR_SQL_PROFILE_btpjqgv0u0stb_2830885032 completed
El SQL profile se creó, así que validamos si la consulta que antes hacía un acceso full sobre la tabla ahora toma el índice:
15:14:08 SQL> select /*+ full(pp)*/ * from pp where n=1; N C ---------- --------------------------------------------------------------------- 1 28 15:14:09 SQL> select * from table(dbms_xplan.display_cursor); PLAN_TABLE_OUTPUT --------------------------------------------------------------------------------------------- SQL_ID btpjqgv0u0stb, child number 1 ------------------------------------- select /*+ full(pp)*/ * from pp where n=1 Plan hash value: 2830885032 -------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | | | 1 (100)| | | 1 | TABLE ACCESS BY INDEX ROWID| PP | 1 | 65 | 1 (0)| 00:00:01 | |* 2 | INDEX RANGE SCAN | PP_IDX | 1 | | 1 (0)| 00:00:01 | -------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("N"=1) Note ----- - SQL profile coe_btpjqgv0u0stb_2830885032 used for this statement 23 rows selected. 15:14:50 SQL> select category, status 15:15:04 2 from dba_sql_profiles 15:15:09 3 where name='coe_btpjqgv0u0stb_2830885032'; CATEGORY STATUS ------------------------------ -------- DEFAULT ENABLED
Perfecto, el SQL profile está haciendo lo que esperamos y está activo.
Recién ahora estamos en la situación que me interesaba mostrar: ¿cómo hacemos para ver el plan de ejecución original de esta sentencia?. Uso el string OTRA, pero podría ser cualquier string distinto de DEFAULT:
15:15:50 SQL> alter session set sqltune_category='OTRA'; Session altered. 15:16:02 SQL> select /*+ full(pp)*/ * from pp where n=1; N C ---------- --------------------------------------------------------------------------------- 1 28 15:16:12 SQL> select * from table(dbms_xplan.display_cursor); PLAN_TABLE_OUTPUT -------------------------------------------------------------------------------------------- SQL_ID btpjqgv0u0stb, child number 2 ------------------------------------- select /*+ full(pp)*/ * from pp where n=1 Plan hash value: 2338859486 -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | | | 3 (100)| | |* 1 | TABLE ACCESS FULL| PP | 1 | 65 | 3 (0)| 00:00:01 | -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("N"=1) Note ----- - dynamic sampling used for this statement (level=2) 22 rows selected.
Vemos que al ejecutar la sentencia se vuelve a comportar como antes, sin usar el SQL profile.

Espero les sea útil.

lunes, 17 de febrero de 2014

Oracle RAC 12c sobre Oracle VM y VirtualBox usando Templates

OTN publicó hace unos días un hands-on lab How to Deploy a Four-Node Oracle RAC 12c Cluster in Minutes Using Oracle VM Templates, basado en una sesión del Oracle Open World 2013.
Es un artículo muy bueno, con todos los detalles para hacer la configuración e instalación, usando un equipo con 16gb de RAM para configurar 4 nodos virtuales con Oracle RAC 12c.

Pero sobre el final (y después de unas 3 hs de trabajo si se siguen las instrucciones) aclara: el objetivo del lab no es dejar corriendo el cluster porque no dan los recursos del servidor para hacerlo. Citando el texto original:
"Note: The goal of this lab is to show how to create a four-node cluster using Oracle VM with Flex Cluster 
and Oracle Flex ASM, not to actually run a four-node cluster. Because of the limited resources we have on the 
x86 machine, the build for this four-node cluster will not finish. By comparison, a similar deployment on a
 bare-metal/Oracle VM environment with adequate resources would take around 30 to 40 minutes."

Ya no parece tan interesante.
Pero con mínimos cambios se puede dejar corriendo un cluster de dos nodos. Ahora es más atractivo, aunque utiliza mucho hardware, pero es una buena alternativa por varios motivos:
  • el tiempo que lleva de deploy es menor a otras alternativas.
  • para familiarizarse con el uso de Oracle VM, templates de OVM, y Oracle RAC sin tener que instalar OVM en un servidor de pruebas.

Antes de contarles detalles sobre mi experiencia, un poco de background sobre las opciones para hacer deploys "rápidos" de máquinas virtuales con Oracle:
  • Oracle RAC está soportado en producción sobre varias tecnologías de virtualización, entre ellas Oracle VM (OVM), pero no VirtualBox.  OVM Server se debe instalar en el equipo que se use para virutalizar, lo que lo deja fuera notebooks o instalaciones de test que tienen otros propósitos y no hay nadie que se haga cargo de su administración (es más complejo administrar un equipo que usa OVM Server para correr virtuales que uno que usa Linux + VirtualBox)
  • Oracle tiene imágenes de máquinas virtuales OVM preinstaladas con todo lo necesario (VM Templates) para distintos propósitos, entre ellos la base de datos con la opción de RAC, para 11g y 12c. No hay templates para VirtualBox.
  • Siempre se puede crear desde cero las máquinas virtuales, instalar el sistema operativo, configurar storage, instalar Grid, Oracle y luego configurar todo. También hay guías muy buenas al respecto (como esta de Tim Hall - RAC 12c + OEL6 + virtualbox), pero es una tarea que lleva bastante más tiempo que solamente seguir la guía del lab.

Así que comparto mi experiencia usando un pc con AMD FX(tm)-8120 Eight-Core Processor de 1.4Ghz, 32Gb de RAM y openSUSE 12.3 x64


Primer intento

Siguiendo la guía al pie de la letra, el último paso que levanta las 4 VM de RAC falla con los siguientes mensajes, después de 4:45hs de haber comenzado el primer paso (sin contar el tiempo que lleva descargar los archivos que se necesitan).
tail -f /u01/racovm/buildcluster.log ERROR (node:rac2): Failed to run rootcrs.pl, status: 25 See log at: /u01/app/12.1.0/grid/cfgtoollogs/crsconfig/rootcrs_rac2_2014-02-15_11-32-40AM.log 2014-02-15 12:26:28:[girootcrslocal:Time :rac2] Completed with errors in 3230 seconds (0h:53m:50s), status: 25 INFO (node:rac0): All girootcrslocal operations completed on all (4) node(s) at: 12:27:22 2014-02-15 12:28:24:[girootcrs:Time :rac0] Completed with errors in 5497 seconds (1h:31m:37s), status: 3 2014-02-15 12:29:19:[creategrid:Time :rac0] Completed with errors in 5786 seconds (1h:36m:26s), status: 3 2014-02-15 12:29:43:[buildcluster:Time :rac0] Completed with errors in 6160 seconds (1h:42m:40s), status: 3

Segundo intento

Antes de descartar el uso de las 4 VM probé cambiar la configuración en VirtualBox del OVM server para que use 6 CPU en vez de las 2 que trae configuradas por defecto.
Usando la consola web de OVM Manager detuve las 4 VM, las borré y luego paré en VirtualBox OVM Server, cambié la configuración de CPUs, lo inicié y repetí los pasos desde el punto 11 (Clone Four Virtual Machines from the Template).

El resultado al levantar las VM fue el mismo: error. Aunque esta vez el servidor quedó bastante más cargado y casi no respondía
tail -f /u01/racovm/buildcluster.log ... ERROR (node:rac1): Failed to run rootcrs.pl, status: 25 See log at: /u01/app/12.1.0/grid/cfgtoollogs/crsconfig/rootcrs_rac1_2014-02-15_03-10-06PM.log 2014-02-15 16:17:24:[girootcrslocal:Time :rac1] Completed with errors in 4039 seconds (1h:07m:19s), status: 25 .... INFO (node:rac0): Waiting for all girootcrslocal operations to complete on all nodes (At 16:42:22, elapsed: 1h:28m:47s, 1 node(s) remaining, all background pid(s): 26984)...

Y esta es la carga del nodo0:
[root@rac0 ~]# uptime 18:32:08 up 4:11, 1 user, load average: 38.79, 36.94, 35.97


Intento final con dos nodos

Ahora sí para levantar un RAC con 2 nodos solamente, borré otra vez las 4 VM creadas usando la consola web de OVM Manager, y repetí los pasos desde el punto 11 (Clone Four Virtual Machines from the Template).

En el paso donde se indica crear el archivo netconfig12cRAC4node.ini, creé uno de nombre netconfig12cRAC2node.ini y dejé la configuración de dos nodos solamente (rac0 y rac1). El archivo params12c.ini no fue necesario crearlo nuevamente ni modificarlo.
El comando final (./deploycluster.py) usa el archivo de parámetros de 2 nodos, y esta vez el resultado es exitoso:

[root@ovm-mgr deploycluster]# ./deploycluster.py -u admin -M rac.? -N utils/netconfig12cRAC2node.ini -P utils/params12c.ini Oracle DB/RAC OneCommand (v2.0.3) for Oracle VM - deploy cluster - (c) 2011-2013 Oracle Corporation (com: 28700:v2.0.2, lib: 180072:v2.0.3, var: 1500:v2.0.3) - v2.4.3 - ovm-mgr.oow.com (x86_64) Invoked as root at Sun Feb 16 05:35:41 2014 (size: 45500, mtime: Tue Jul 30 16:55:37 2013) Using: ./deploycluster.py -u admin -M rac.? -N utils/netconfig12cRAC2node.ini -P utils/params12c.ini INFO: Login password to Oracle VM Manager not supplied on command line or environment (DEPLOYCLUSTER_MGR_PASSWORD), prompting... Password: INFO: Attempting to connect to Oracle VM Manager... INFO: Oracle VM Client (3.2.4.524) protocol (1.9) CONNECTED (tcp) to Oracle VM Manager (3.2.4.524) protocol (1.9) IP (192.168.56.3) UUID (0004fb0000010000285d60b0071f42ae) INFO: Inspecting /SoftOracle/deploycluster/utils/netconfig12cRAC2node.ini for number of nodes defined.... INFO: Detected 2 nodes in: /SoftOracle/deploycluster/utils/netconfig12cRAC2node.ini INFO: Located a total of (2) VMs; 2 VMs with a simple name of: ['rac.0', 'rac.1'] INFO: Detected (2) Hub nodes and (0) Leaf nodes in the Flex Cluster INFO: Detected a RAC deployment... INFO: Starting all (2) VMs... INFO: VM with a simple name of "rac.0" (Hub node) is in a Stopped state, attempting to start it....OK. INFO: VM with a simple name of "rac.1" (Hub node) is in a Stopped state, attempting to start it....OK. INFO: Verifying that all (2) VMs are in Running state and pass prerequisite checks... INFO: Detected Flex ASM enabled with a dedicated network adapter (eth2), all VMs will require a minimum of (3) Vnics... .. INFO: Skipped checking memory of VMs due to DEPLOYCLUSTER_SKIP_VM_MEMORY_CHECK=yes INFO: Detected that all (2) Hub node VMs specified on command line have (1) common shared disk between them (ASM_MIN_DISKS=1) INFO: The (2) VMs passed basic sanity checks and in Running state, sending cluster details as follows: netconfig.ini (Network setup): /SoftOracle/deploycluster/utils/netconfig12cRAC2node.ini params.ini (Overall build options): /SoftOracle/deploycluster/utils/params12c.ini buildcluster: yes INFO: Starting to send configuration details to all (2) VM(s)..... INFO: Sending to VM with a simple name of "rac.0" (Hub node)................. INFO: Sending to VM with a simple name of "rac.1" (Hub node)...... INFO: Configuration details sent to (2) VMs... Check log (default location /u01/racovm/buildcluster.log) on build VM (rac.0)... INFO: deploycluster.py completed successfully at 05:36:49 in 67.7 seconds (0h:01m:07s) Logfile at: /SoftOracle/deploycluster/deploycluster7.log


Y este es el log de la configuración exitosa de las VM:
tail -f /u01/racovm/buildcluster.log ... INFO (node:rac0): Running on: rac0 as oracle: export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1; /u01/app/oracle/product/12.1.0/dbhome_1/bin/srvctl status database -d ORCL Instance ORCL1 is running on node rac0 Instance ORCL2 is running on node rac1 INFO (node:rac0): Running on: rac0 as root: /u01/app/12.1.0/grid/bin/crsctl status resource -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE rac0 STABLE ONLINE ONLINE rac1 STABLE ora.DATA.dg ONLINE ONLINE rac0 STABLE ONLINE ONLINE rac1 STABLE ora.LISTENER.lsnr ONLINE ONLINE rac0 STABLE ONLINE ONLINE rac1 STABLE ora.net1.network ONLINE ONLINE rac0 STABLE ONLINE ONLINE rac1 STABLE ora.ons ONLINE ONLINE rac0 STABLE ONLINE ONLINE rac1 STABLE ora.proxy_advm ONLINE ONLINE rac0 STABLE ONLINE ONLINE rac1 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac0 STABLE ora.asm 1 ONLINE ONLINE rac0 STABLE 2 ONLINE ONLINE rac1 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 OFFLINE OFFLINE STABLE ora.gns 1 ONLINE ONLINE rac0 STABLE ora.gns.vip 1 ONLINE ONLINE rac0 STABLE ora.oc4j 1 OFFLINE OFFLINE STABLE ora.orcl.db 1 ONLINE ONLINE rac0 Open,STABLE 2 ONLINE ONLINE rac1 Open,STABLE ora.rac0.vip 1 ONLINE ONLINE rac0 STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.scan1.vip 1 ONLINE ONLINE rac0 STABLE -------------------------------------------------------------------------------- INFO (node:rac0): For an explanation on resources in OFFLINE state, see Note:1068835.1 2014-02-16 11:16:07:[clusterstate:Time :rac0] Completed successfully in 164 seconds (0h:02m:44s) 2014-02-16 11:16:13:[buildcluster:Done :rac0] Building 12c RAC Cluster 2014-02-16 11:16:16:[buildcluster:Time :rac0] Completed successfully in 9501 seconds (2h:38m:21s)


Finalmente, para validar que realmente está funcionando me conecto a una de las instancias del RAC:
server:/archivos/oracle # ssh oracle@192.168.56.10 oracle@192.168.56.10's password: [oracle@rac0 ~]$ echo $ORACLE_SID ORCL1 [oracle@rac0 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.1.0 Production on Sun Feb 16 11:54:26 2014 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options SQL> set lines 180 pages 180 SQL> col host_name for a10 SQL> select inst_id, version, instance_name, host_name, status 2 from gv$instance; INST_ID VERSION INSTANCE_NAME HOST_NAME STATUS ---------- ----------------- ---------------- ---------- ------------ 1 12.1.0.1.0 ORCL1 rac0 OPEN 2 12.1.0.1.0 ORCL2 rac1 OPEN

Espero les sea útil.