Upgrade Oracle RAC from 11.2.0.2 to 11.2.0.3

Posted on Posted in Oracle DB

Bueno en este manual voy a explicar como realizar la actualización de un RAC 11.2.0.2 a la nueva versión 11.2.0.3, proceso que tuve que realizar hace poco en el trabajo.

Oracle con las últimas versiones ha ido tomando el buen abito de realizar las instalaciones en un $ORACLE_HOME diferente al usado el la versión “activa”.

Resumiendo el proceso que vamos a seguir:

  • Instalamos el último Opatch
  • Instalamos Parches necesarios
  • Instalamos software 11.2.0.3 de GRID
  • Instalamos software 11.2.0.3 de BD
  • Actualizamos la BD de 11.2.0.2 a 11.2.0.3

Preparativos preliminares

La instalación de los parches abra que realizar lo en cada nodo y por duplicado ya que es aplicable al $ORACLE_HOME de GRID + BD

Instalalar el Opatch 11.2.0.1.4 o superior

Descomprimimos directamente sobre los ORACLE_HOME de GRID y DB, y cambiamos los permisos del Opatch al usuario oracle y grupo oinstall

 
cd /u01/app/oracle/product/11.2.0.2/db_1
cp -pr OPatch/ OPatch_OLD
[oracle@larry-db db_1]$ unzip /u01/sofware_oracle/11.2.0.3/opatch_11.2.0.1.9/p6880880_112000_Linux-x86-64.zip
Archive:  /u01/sofware_oracle/11.2.0.3/opatch_11.2.0.1.9/p6880880_112000_Linux-x86-64.zip
replace OPatch/docs/FAQ? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: OPatch/docs/FAQ
  inflating: OPatch/docs/Users_Guide.txt
...
..
.

chown -R oracle.oinstall Opatch

cd /u01/app/11.2.0.2/grid
[oracle@larry-db grid]$ cp -pr OPatch/ OPatch_OLD
cp: cannot create directory `OPatch_OLD': Permission denied
[oracle@larry-db1 grid]$ su
Password:
[root@larry-db grid]# cp -pr OPatch/ OPatch_OLD
[root@larry-db grid]# unzip /u01/sofware_oracle/11.2.0.3/opatch_11.2.0.1.9/p6880880_112000_Linux-x86-64.zip
.Archive:  /u01/sofware_oracle/11.2.0.3/opatch_11.2.0.1.9/p6880880_112000_Linux-x86-64.zip
replace OPatch/docs/FAQ? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: OPatch/docs/FAQ
  inflating: OPatch/docs/Users_Guide.txt
  inflating: OPatch/docs/Prereq_Users_Guide.txt
  inflating: OPatch/jlib/opatch.jar
  inflating: OPatch/jlib/opatchutil.jar
...
..
.

chown -R oracle.oinstall Opatch

Instalación del PSU1

Nos descargamos el PSU1 desde Metalink p10157506_112020_Linux-x86-64.zip, este paquete trae dos parches 10157506 y 10158965 que tendremos que descomprimir en un directorio temporal vacio!!!

mkdir /u01/software_oracle/11.2.0.3/stage
cd stage
unzip p10157506_112020_Linux-x86-64.zip
cd /u01/app/11.2.0.2/grid
Obtención del Response File
[root@larry-db 11.2.0.3]# /u01/app/11.2.0.2/grid/OPatch/ocm/bin/emocmrsp
OCM Installation Response Generator 10.3.4.0.0 - Production
Copyright (c) 2005, 2010, Oracle and/or its affiliates.  All rights reserved.

Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: larry@snaider.dom
Provide your My Oracle Support password to receive security updates via your My Oracle Support account.
Password (optional):
Error connecting to host (https://ccr.oracle.com).
Connection timed out

Unable to establish a network connection to Oracle. Specify the URL for an
Oracle Support Hub in this format:
    http[s]://<OracleSupportHubHost>:<OracleSupportHubPort>
If you do not wish to configure OCM through an Oracle Support Hub, enter NONE
Oracle Support Hub URL: NONE

Unable to establish a network connection to Oracle. If your systems require a
proxy server for outbound Internet connections, enter the proxy server details
in this format:
    [<proxy-user>@]<proxy-host>[:<proxy-port>]
If you want to remain uninformed of critical security issues in your
configuration, enter NONE
Proxy specification: proxy.snaider.dom:8080
Proxy information verified, validating specified email value(s).

The OCM configuration response file (ocm.rsp) was successfully created.
Instalación de los Parches

El Opatch PARA EL CRS y luego lo LEVANTA, pero para aplicar el parche tiene que estar levantado, sino dará error.

ERRORES que pueden surgir:

  • Puede fallar al aplicar el parche si la carpeta Opatch de cada HOME no tiene permisos de oracle.oinstall
  • Por no conseguir parar todos los procesos de oracle (CRS, GRID) cuando esta aplicando el parche, en este caso paramos manualmente el CRS y nos aseguramos que no queda ningún rastro en ejecucción, si es necesario matamos los procesos residuales.
  • Por especificar directamente el directorio del parche y no poner el directorio BASE del parche
Instalamos parches en grid
[root@larry grid]# opatch auto /u01/11.2.0.3/stage -oh /u01/app/11.2.0.2/grid
Executing /usr/bin/perl /u01/app/11.2.0.2/grid/OPatch/crs/patch112.pl -patchdir /u01/11.2.0.3 -patchn stage -oh /u01/app/11.2.0.2/grid -paramfile /u01/app/11.2.0.2/grid/crs/install/crsconfig_params
opatch auto log file location is /u01/app/11.2.0.2/grid/OPatch/crs/../../cfgtoollogs/opatchauto2011-11-25_09-17-45.log
Detected Oracle Clusterware install
Using configuration parameter file: /u01/app/11.2.0.2/grid/crs/install/crsconfig_params
OPatch  is bundled with OCM, Enter the absolute OCM response file path:
/u01/app/11.2.0.2/grid/ocm.rsp
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes

Successfully unlock /u01/app/11.2.0.2/grid
patch /u01/11.2.0.3/stage/10157506  apply successful for home  /u01/app/11.2.0.2/grid
patch /u01/11.2.0.3/stage/10158965  apply  failed  for home  /u01/app/11.2.0.2/grid
ACFS-9300: ADVM/ACFS distribution files found.
ACFS-9312: Existing ADVM/ACFS installation detected.
ACFS-9314: Removing previous ADVM/ACFS installation.
ACFS-9315: Previous ADVM/ACFS components successfully removed.
ACFS-9307: Installing requested ADVM/ACFS software.
ACFS-9308: Loading installed ADVM/ACFS drivers.
ACFS-9321: Creating udev for ADVM/ACFS.
ACFS-9323: Creating module dependencies - this may take some time.
ACFS-9327: Verifying ADVM/ACFS devices.
ACFS-9309: ADVM/ACFS installation correctness verified.
CRS-4123: Oracle High Availability Services has been started.

LOG DE PROCESO /u01/app/11.2.0.2/grid/cfgtoollogs/

Comprobamos que lo ha instalado

[oracle@larry-db1 grid]$ opatch lsinventory

Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/11.2.0.2/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0.2/grid/oraInst.loc
OPatch version    : 11.2.0.1.9
OUI version       : 11.2.0.2.0
Log file location : /u01/app/11.2.0.2/grid/cfgtoollogs/opatch/opatch2011-11-22_17-03-17PM.log

Lsinventory Output file location : /u01/app/11.2.0.2/grid/cfgtoollogs/opatch/lsinv/lsinventory2011-11-22_17-03-17PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1): 

Oracle Grid Infrastructure                                           11.2.0.2.0
There are 1 products installed in this Oracle Home.

Interim patches (2) :

Patch  10158965     : applied on Tue Nov 22 16:54:25 CET 2011
Unique Patch ID:  13161096
   Created on 26 Nov 2010, 08:07:59 hrs PST8PDT
   Bugs fixed:
     10073683, 10158965, 10022980, 10209232, 9788588, 10019218, 9715581, 10040531

Patch  10157506     : applied on Tue Nov 22 16:13:06 CET 2011
Unique Patch ID:  13161096
   Created on 27 Nov 2010, 05:48:40 hrs PST8PDT
   Bugs fixed:
     10157506, 9979706, 9959110, 10016083, 10015460, 10014392, 9918485
     10157622, 10089120, 10057296, 9971646, 10053985, 10040647, 9978765
     9864003, 10069541, 10110969, 10107380, 9915329, 10044622, 10029119
     9812970, 10083009, 9812956, 10048027, 10036193, 10008467, 10040109
     10015210, 10083789, 10033106, 10073372, 9876201, 10042143, 9963327
     9679401, 10062301, 10018215, 10075643, 10007185, 10071992, 10057680
     10038791, 10124517, 10048487, 10078086, 9926027, 10052721, 9944948
     10028235, 10146768, 10011084, 10027079, 10028343, 10045436, 9907089
     10073075, 10175855, 10178670, 10072474, 10036834, 9975837, 10028637
     10029900, 9949676, 10069698, 10019796, 9975343, 9861790, 9906432
     10087118, 10070563, 10056808, 10029794, 10061534, 9974223, 10260251
     10252497, 10241696, 10228079, 10216878, 10015603

Rac system comprising of multiple nodes
  Local node = larry-db1
  Remote node = larry-db2

--------------------------------------------------------------------------------

OPatch succeeded.
instalamos parches en bd

Tenemos que realizar el mismo proceso pero especificando el $ORACLE_HOME de la BD

[root@larry-db1 stage]# opatch auto /u01/software_oracle/11.2.0.3/stage -oh /u01/app/oracle/product/11.2.0.2/db_1
Executing /usr/bin/perl /u01/app/oracle/product/11.2.0.2/db_1/OPatch/crs/patch112.pl -patchdir /u01/software_oracle/11.2.0.3 -patchn stage -oh /u01/app/oracle/product/11.2.0.2/db_1 -paramfile /u01/app/11.2.0.2/grid/crs/install/crsconfig_params
opatch auto log file location is /u01/app/oracle/product/11.2.0.2/db_1/OPatch/crs/../../cfgtoollogs/opatchauto2011-11-22_17-28-52.log
Detected Oracle Clusterware install
Using configuration parameter file: /u01/app/11.2.0.2/grid/crs/install/crsconfig_params
OPatch  is bundled with OCM, Enter the absolute OCM response file path:
/u01/app/oracle/product/11.2.0.2/db_1/OPatch/ocm/ocm.zip
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
patch /u01/software_oracle/11.2.0.3/stage/10157506/custom/server/10157506  apply successful for home  /u01/app/oracle/product/11.2.0.2/db_1
patch /u01/software_oracle/11.2.0.3/stage/10158965  apply successful for home  /u01/app/oracle/product/11.2.0.2/db_1
[root@larry-db1 stage]# exit

Comprobamos que se han instalado

[oracle@larry-db1 grid]$ . oraDB.env
=====================================================
 XXXXX   XXXXXX
  X   X   X    X
  X    X  X    X
  X    X  X    X
  X    X  XXXXX
  X    X  X    X
  X    X  X    X
  X   X   X    X
 XXXXX   XXXXXX
=====================================================
ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/db_1
ORACLE_SID=LARRY1
=====================================================
[oracle@larry-db1 db_1]$ opatch lsinventory

Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/11.2.0.2/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0.2/db_1/oraInst.loc
OPatch version    : 11.2.0.1.9
OUI version       : 11.2.0.2.0
Log file location : /u01/app/oracle/product/11.2.0.2/db_1/cfgtoollogs/opatch/opatch2011-11-22_17-35-09PM.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0.2/db_1/cfgtoollogs/opatch/lsinv/lsinventory2011-11-22_17-35-09PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1): 

Oracle Database 11g                                                  11.2.0.2.0
There are 1 products installed in this Oracle Home.

Interim patches (2) :

Patch  10158965     : applied on Tue Nov 22 17:32:28 CET 2011
Unique Patch ID:  13161096
   Created on 26 Nov 2010, 08:07:59 hrs PST8PDT
   Bugs fixed:
     10073683, 10158965, 10022980, 10209232, 9788588, 10019218, 9715581, 10040531

Patch  10157506     : applied on Tue Nov 22 17:32:07 CET 2011
Unique Patch ID:  13161096
   Created on 27 Nov 2010, 05:48:40 hrs PST8PDT
   Bugs fixed:
     10157506, 9979706, 9959110, 10016083, 10015460, 10014392, 9918485
     10157622, 10089120, 10057296, 9971646, 10053985, 10040647, 9978765
     9864003, 10069541, 10110969, 10107380, 9915329, 10044622, 10029119
     9812970, 10083009, 9812956, 10048027, 10036193, 10008467, 10040109
     10015210, 10083789, 10033106, 10073372, 9876201, 10042143, 9963327
     9679401, 10062301, 10018215, 10075643, 10007185, 10071992, 10057680
     10038791, 10124517, 10048487, 10078086, 9926027, 10052721, 9944948
     10028235, 10146768, 10011084, 10027079, 10028343, 10045436, 9907089
     10073075, 10175855, 10178670, 10072474, 10036834, 9975837, 10028637
     10029900, 9949676, 9974223, 10260251

Rac system comprising of multiple nodes
  Local node = larry-db1
  Remote node = larry-db1

--------------------------------------------------------------------------------

OPatch succeeded.

catbundle.sql

Es necesario pasar este script en la BD antes de realizar la actualización, se encargará de cargar los objetos SQL modificados en la BD

[oracle@larry-db1]$srvctl start database -d LARRY
[oracle@larry-cdr1]$srvctl start database -d LARRYCDR

Aplicamos el parche en produccion:

[oracle@larry-db1 software_oracle]$ cd $ORACLE_HOME/rdbms/admin
[oracle@larry-db1 admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Vie Nov 25 11:22:41 2011

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, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> @catbundle.sql psu apply    

PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.

Generating apply and rollback scripts...
Check the following file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_LARRY_GENERATE_2011Nov25_11_23_02.log
Apply script: /u01/app/oracle/product/11.2.0.2/db_1/rdbms/admin/catbundle_PSU_LARRY_APPLY.sql
Rollback script: /u01/app/oracle/product/11.2.0.2/db_1/rdbms/admin/catbundle_PSU_LARRY_ROLLBACK.sql

PL/SQL procedure successfully completed.
Executing script file...

SQL> COLUMN spool_file NEW_VALUE spool_file NOPRINT
SQL> SELECT '/u01/app/oracle/cfgtoollogs/catbundle/' || 'catbundle_PSU_' || name || '_APPLY_' || TO_CHAR(SYSDATE, 'YYYYMonDD_hh24_mi_ss', 'NLS_DATE_LANGUAGE=''AMERICAN''') || '.log' AS spool_file FROM v$database;

SQL> SPOOL &spool_file
SQL> exec dbms_registry.set_session_namespace('SERVER')

PL/SQL procedure successfully completed.

SQL> ALTER SESSION SET current_schema = SYS;

Session altered.

SQL> PROMPT Updating registry...
Updating registry...
SQL> INSERT INTO registry$history
  2    (action_time, action,
  3     namespace, version, id,
  4     bundle_series, comments)
  5  VALUES
  6    (SYSTIMESTAMP, 'APPLY',
  7     SYS_CONTEXT('REGISTRY$CTX','NAMESPACE'),
  8     '11.2.0.2',
  9     0,
 10     'PSU',
 11     'Patchset 11.2.0.2.0');

1 row created.

SQL> COMMIT;

Commit complete.

SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_LARRY_APPLY_2011Nov25_11_23_04.log
SQL>

Parche 12539000

Aplicamos el parche 12539000 p12539000_112020_Linux-x86-64.zip el cual será necesario para la correcta instalación del software 11.2.0.3. Para aplicarlo seguiremos el mismo procedimiento que en casos anteriores:

RECORDAR QUE LA APLICACIÓN DE LOS PARCHES HAY QUE HACERLO EN CADA NODO Y POR DUPLICADO EN EL $ORACLE_HOME DE GRID Y BD.

[root@larry-db1 11.2.0.3]# /u01/app/11.2.0.2/grid/OPatch/opatch auto /u01/software_oracle/11.2.0.3/parche_12539000 -oh /u01/app/11.2.0.2/grid
Executing /usr/bin/perl /u01/app/11.2.0.2/grid/OPatch/crs/patch112.pl -patchdir /u01/software_oracle/11.2.0.3 -patchn parche_12539000 -oh /u01/app/11.2.0.2/grid -paramfile /u01/app/11.2.0.2/grid/crs/install/crsconfig_params
opatch auto log file location is /u01/app/11.2.0.2/grid/OPatch/crs/../../cfgtoollogs/opatchauto2011-11-25_13-21-29.log
Detected Oracle Clusterware install
Using configuration parameter file: /u01/app/11.2.0.2/grid/crs/install/crsconfig_params
OPatch  is bundled with OCM, Enter the absolute OCM response file path:
/u01/software_oracle/11.2.0.3/ocm.rsp
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
Successfully unlock /u01/app/11.2.0.2/grid
patch /u01/software_oracle/11.2.0.3/parche_12539000/12539000  apply successful for home  /u01/app/11.2.0.2/grid
ACFS-9300: ADVM/ACFS distribution files found.
ACFS-9312: Existing ADVM/ACFS installation detected.
ACFS-9314: Removing previous ADVM/ACFS installation.
ACFS-9315: Previous ADVM/ACFS components successfully removed.
ACFS-9307: Installing requested ADVM/ACFS software.
ACFS-9308: Loading installed ADVM/ACFS drivers.
ACFS-9321: Creating udev for ADVM/ACFS.
ACFS-9323: Creating module dependencies - this may take some time.
ACFS-9327: Verifying ADVM/ACFS devices.
ACFS-9309: ADVM/ACFS installation correctness verified.
CRS-4123: Oracle High Availability Services has been started.

Verificamos:

[oracle@larry-db1 ~]$ /u01/app/11.2.0.2/grid/OPatch/opatch lsinventory

Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/11.2.0.2/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0.2/grid/oraInst.loc
OPatch version    : 11.2.0.1.9
OUI version       : 11.2.0.2.0
Log file location : /u01/app/11.2.0.2/grid/cfgtoollogs/opatch/opatch2011-11-25_13-35-57PM.log

Lsinventory Output file location : /u01/app/11.2.0.2/grid/cfgtoollogs/opatch/lsinv/lsinventory2011-11-25_13-35-57PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1): 

Oracle Grid Infrastructure                                           11.2.0.2.0
There are 1 products installed in this Oracle Home.

Interim patches (3) :

Patch  12539000     : applied on Fri Nov 25 13:26:27 CET 2011
Unique Patch ID:  13976979
   Created on 28 Jul 2011, 12:37:42 hrs PST8PDT
   Bugs fixed:
     12539000

Patch  10158965     : applied on Tue Nov 22 16:54:25 CET 2011
Unique Patch ID:  13161096
   Created on 26 Nov 2010, 08:07:59 hrs PST8PDT
   Bugs fixed:
     10073683, 10158965, 10022980, 10209232, 9788588, 10019218, 9715581, 10040531

Patch  10157506     : applied on Tue Nov 22 16:13:06 CET 2011
Unique Patch ID:  13161096
   Created on 27 Nov 2010, 05:48:40 hrs PST8PDT
   Bugs fixed:
     10157506, 9979706, 9959110, 10016083, 10015460, 10014392, 9918485
     10157622, 10089120, 10057296, 9971646, 10053985, 10040647, 9978765
     9864003, 10069541, 10110969, 10107380, 9915329, 10044622, 10029119
     9812970, 10083009, 9812956, 10048027, 10036193, 10008467, 10040109
     10015210, 10083789, 10033106, 10073372, 9876201, 10042143, 9963327
     9679401, 10062301, 10018215, 10075643, 10007185, 10071992, 10057680
     10038791, 10124517, 10048487, 10078086, 9926027, 10052721, 9944948
     10028235, 10146768, 10011084, 10027079, 10028343, 10045436, 9907089
     10073075, 10175855, 10178670, 10072474, 10036834, 9975837, 10028637
     10029900, 9949676, 10069698, 10019796, 9975343, 9861790, 9906432
     10087118, 10070563, 10056808, 10029794, 10061534, 9974223, 10260251
     10252497, 10241696, 10228079, 10216878, 10015603

Rac system comprising of multiple nodes
  Local node = larry-db1
  Remote node = larry-db2

--------------------------------------------------------------------------------

OPatch succeeded.

CVU – Cluster Verification utility

Lanzamos la herramienta que nos verificará el estado del cluster:

[oracle@larry-db1 grid]$ ./runcluvfy.sh stage -pre crsinst -upgrade -n all -rolling -src_crshome /u01/app/11.2.0.2/grid/ -dest_crshome /u01/app/11.2.0.3 -dest_version 11.2.0.3.0

Performing pre-checks for cluster services setup 

Checking node reachability...
Node reachability check passed from node "larry-db1"

Checking user equivalence...
User equivalence check passed for user "oracle"

Checking CRS user consistency
CRS user consistency check successful

Checking node connectivity...
Checking hosts config file...

Verification of the hosts config file successful

Check: Node connectivity for interface "bond0"
Node connectivity passed for interface "bond0"
.....
....
...
..
.

Instalación del Software 11.2.0.3

GRID 11.2.0.3

Creamos la estructura en LOS DOS NODOS

mkdir -p /u01/app/11.2.0.3/grid
chown -R oracle:oinstall /u01/app/11.2.0.3/grid
chmod -R 775 /u01/app/11.2.0.3/grid

Unset variables de grid

unset ORACLE_BASE
unset ORACLE_HOME
unset ORACLE_SID

Nos conectamos con las X a uno de los nodos de producción y lanzamos el Instalador

/u01/software_oracle/11.2.0.3/grid/
./runInstaller.sh

Seguimos el asistente ajustando rutas, permisos y ejecutando el root.sh final en todos los nodos


Cuando lo pida, ejecutar rootupgrade.sh en el nodo local (si tuvieramos mas de 2 nodos, se podría ejecutar en paralelo, dejando el último nodo para cuando hubíera terminado el resto), una vez finalizado terminar con el segundo NODO.

[root@larry-db1 grid]# /u01/app/11.2.0.3/grid/rootupgrade.sh
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/11.2.0.3/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
......
....
..

Instalación 11.2.0.3 DB

Con usuario ORACLE creamos la nueva estructura de directorios

[oracle@larry-db1 database]$ mkdir -p /u01/app/oracle/product/11.2.0.3/db_1
/u01/software_oracle/11.2.0.3/database/
./runInstaller.sh

Cuando lo pida en ambos nodos:

/u01/app/oracle/product/11.2.0.3/db_1/root.sh

Actualización de la Base de Datos

Tareas previas

Tenemos que tomar una serie de medidas antes de seguir con la actualización de la BD:

Desactivamos el DG_BROKER

Desactivamos la cnfiguración del DB BROKER y lo paramos

[oracle@larry-db1 ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/db_1
[oracle@larry-db1 bin]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - 64bit Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect /
Connected.
DGMGRL> disable configuration;
Disabled.
DGMGRL> exit
[oracle@larry-db1 bin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 - Production on Vie Nov 14 18:07:46 2008

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> alter system set DG_BROKER_START=FALSE;

System altered.

SQL>
Vaciado de la papelera
[oracle@larry-db1 ~]$ sqlplus  / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mi� Dic 7 09:49:41 2011

Copyright (c) 1982, 2011, 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, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> purge dba_recyclebin;        

DBA Recyclebin purged.
Drop de DMSYS
SQL> drop user DMSYS cascade;
Configuración Spfile

Por Bug’s de Oracle es necesario realizar cambios en el spfile, sino la actualización fallará.
Estos cambios afectan al parámetro log_archive_dest_2 y a los parámetros ocultos _*

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

SQL> alter system set log_archive_dest_2='service="larrycdr_dg"' scope=spfile sid='LARRY1';
SQL> alter system set log_archive_dest_2='service="larrycdr_dg"' scope=spfile sid='LARRY2';

System altered.

SQL> alter system reset "_job_queue_interval" scope=spfile sid='LARRY1';
SQL> alter system reset "_job_queue_interval" scope=spfile sid='LARRY2';

System altered.

SQL> shutdown immediate;
cd /u01/app/oracle/product/11.2.0.3/db_1/bin
./dbua -keepHiddenParams

Obviamos los warnings

Desactivamos los archive_logs

Y seguimos con la actualización

Podemos ver los logs que va generando desde /u01/app/oracle/cfgtoollogs/dbua/LARRY

Comprobaciones Finales

Una vez actualizada nos aseguramos que esta todo correcto:

Archive_logs

Puede ocurrirnos que los archives se estén escribiendo en $ORACLE_HOME/dbs para solucionarlo reseteamos el parámetro “LOG_ARCHIVE_DEST_1” y parece solucionarse:

SQL> alter system reset LOG_ARCHIVE_DEST_1 scope=spfile sid='*';

Spfile

Dejamos el spfile como estaba:

sqlplus / as sysdba

SQL> alter system set log_archive_dest_2='service="larrycdr_dg"','LGWR ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=300 db_unique_name="LARRYCDR" net_timeout=30','valid_for=(all_logfiles,primary_role)' scope=spfile sid='LARRY1';

SQL> alter system set log_archive_dest_2='service="larrycdr_dg"','LGWR ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=300 db_unique_name="LARRYCDR" net_timeout=30','valid_for=(all_logfiles,primary_role)' scope=spfile sid='LARRY2';

SQL> alter system set "_job_queue_interval"=1 scope=spfile sid='LARRY1';

SQL> alter system set "_job_queue_interval"=1 scope=spfile sid='LARRY2';

 Ajuste de ficheros

Ajustamos ficheros en ambos nodos:

$ORACLE_HOME\network\admin
$ORACLE_GRID\network\admin
– listener.ora
– tnsnames.ora
– sqlnet.ora

cp -a /u01/app/oracle/product/11.2.0.2/db_1/dbs/orapwLARRYCDR1 /u01/app/oracle/product/11.2.0.3/db_1/dbs/orapwLARRYCDR1
cp -a /u01/app/11.2.0.2/grid/dbs/orapw+ASM /u01/app/11.2.0.3/grid/dbs
cp -a /u01/app/oracle/product/11.2.0.2/db_1/network/admin/{tnsnames.ora,sqlnet.ora} /u01/app/oracle/product/11.2.0.3/db_1/network/admin/
cp -a /u01/app/oracle/product/11.2.0.2/db_1/dbs/initLARRYCDR1.ora /u01/app/oracle/product/11.2.0.3/db_1/dbs/initLARRYCDR1.ora
vi /u01/app/11.2.0.3/grid/network/admin/listener.ora y cambiar 11.2.0.2 por 11.2.0.3

Y reiniciamos el listener una vez realizados los cambios

lsnrctl stop
lsnrctl start

Ajustamos las variables de entorno

Ajustamos variables:
$HOME/bin
oraDB.env & oraGRID.env

Actualizamos el Catalogo de RMAN

Para poder seguir realizando las copias correctamete es neceario actualizar el catálogo:

[oracle@larry-db1 bd]$ rman target / ${RMAN_CATALOG}

Recovery Manager: Release 11.2.0.3.0 - Production on Lun Dic 12 09:01:57 2011

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: LARRY (DBID=540858300)
connected to recovery catalog database
PL/SQL package RMANTMP2.DBMS_RCVCAT version 11.02.00.02 in RCVCAT database is not current
PL/SQL package RMANTMP2.DBMS_RCVMAN version 11.02.00.02 in RCVCAT database is not current

RMAN>  upgrade catalog;

recovery catalog owner is RMANTMP2
enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> UPGRADE CATALOG;

recovery catalog upgraded to version 11.02.00.03
DBMS_RCVMAN package upgraded to version 11.02.00.03
DBMS_RCVCAT package upgraded to version 11.02.00.03

RMAN> exit

Bueno este es el proceso que tuve que realizar en el trabajo para poder actualizar la BD de 11.2.0.2 a 11.2.0.3 espero que os sirva de utilidad.

Un saludo

2 thoughts on “Upgrade Oracle RAC from 11.2.0.2 to 11.2.0.3

Leave a Reply

Your email address will not be published. Required fields are marked *