Con este Post ponemos fin a la serie dedicada a ASM, recapitulando: hemos visto cómo instalar el software y cómo crear una instancia ASM, para luego proceder a migrar la base de datos de forma manual y usando OEM Database Console, pues bien ahora veremos el procedimiento a seguir para realizar un upgrade a ASM, y cómo hacer para registrar esta instancia para que sea administrable desde OEM Database Console.
I. Upgrade de ASM
Partiremos del supuesto que tenemos ASM 10.2.0.1 con ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 y que queremos actualizar a ASM 11.1.0.7, con ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_2.
1. Debemos detener la instancia ASM, pero esto no es posible sin que primero hagamos lo mismo con las bases de datos que la están usando.
[oracle@urania ~]$ . oraenv
ORACLE_SID = [orcl] ? orcl
[oracle@urania ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 4 00:13:11 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SYS@orcl> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@urania ~]$ . oraenv
ORACLE_SID = [orcl] ? +ASM
[oracle@urania ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 4 00:15:13 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SYS@+ASM> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown.
[root@urania]# cd /u01/app/oracle/product/11.1.0/db_2/bin
[root@urania bin]# ./localconfig reset
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized
Stale CSS daemon is running... killing it now
Cleaning up Network socket directories
Setting up Network socket directories
Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
Cluster Synchronization Services is active on these nodes.
urania
Cluster Synchronization Services is active on all the nodes.
Oracle CSS service is installed and running under init(1M)
[oracle@urania ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_2
[oracle@urania ~]$ $ORACLE_HOME/bin/lsnrctl start
LSNRCTL for Linux: Version 11.1.0.7.0 - Production on 04-FEB-2009 00:52:53
Copyright (c) 1991, 2008, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.1.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.1.0.7.0 - Production
System parameter file is /u01/app/oracle/product/11.1.0/db_2/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/urania/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=urania.localdomain)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=urania.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.1.0.7.0 - Production
Start Date 04-FEB-2009 00:52:54
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.1.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/urania/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=urania.localdomain)(PORT=1521)))
Services Summary...
Service "orcl.localdomain" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
4. El upgrade lo realizaremos con el utilitario DBUA, pero debemos tener cuidado de invocar el que corresponde a la nueva versión de ASM, que para nuestro ejemplo es la 11.1.0.7.
[oracle@urania ~]$ $ORACLE_HOME/bin/dbua
5. Se nos ofrece una bienvenida, la cual aceptamos, y se nos presenta la alternativa de: actualizar una base de datos, o actualizar ASM; escogemos actualizar ASM.
8. Finalmente se nos presenta un resumen de lo actuado, con referencia a los logs generados, para su eventual inspección.
9. Con ASM ya actualizado podemos proceder a iniciar la instancia ASM y las bases de datos asociadas.
[[oracle@urania ~]$ . oraenv
ORACLE_SID = [orcl] ? +ASM
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_2 is /u01/app/oracle
[oracle@urania ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.7.0 - Production on Wed Feb 4 01:35:31 2009
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Connected to an idle instance.
SYS@+ASM> startup
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size 1312896 bytes
Variable Size 258086784 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
[oracle@urania ~]$ . oraenv
ORACLE_SID = [orcl] ? orcl
[oracle@urania ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 4 01:37:13 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SYS@orcl> startup;
ORACLE instance started.
Total System Global Area 318046208 bytes
Fixed Size 1313120 bytes
Variable Size 180356768 bytes
Database Buffers 130023424 bytes
Redo Buffers 6352896 bytes
Database mounted.
Database opened.
¡Tarea concluída! Tenemos la base de datos 10gR2 operando sobre una nueva instancia ASM 11gR1, pero aún nos falta algo más: administrar la instancia ASM desde OEM Database Console.
II. Registrando ASM en OEM Database Console
Para incluir la instancia ASM debemos reconfigurar OEM siguiendo estos pasos:
1. Desconfiguramos OEM para que ya no tenga registrada a la base de datos.
[oracle@urania ~]$ emca -deconfig dbcontrol db
STARTED EMCA at Feb 4, 2009 9:19:19 AM
EM Configuration Assistant, Version 11.1.0.7.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: orcl
Do you wish to continue? [yes(Y)/no(N)]: Y
Feb 4, 2009 9:19:28 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2009_02_04_09_19_19.log.
Feb 4, 2009 9:19:30 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Enterprise Manager configuration completed successfully
FINISHED EMCA at Feb 4, 2009 9:20:34 AM
2. Configuramos nuevamente OEM y notaremos que en adición a los datos relativos a la instancia de la base de datos, ahora también nos solicitará información sobre la instancia ASM.
[oracle@urania ~]$ emca -config dbcontrol db
STARTED EMCA at Feb 4, 2009 9:24:59 AM
EM Configuration Assistant, Version 11.1.0.7.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /u01/app/oracle/product/11.1.0/db_2 ]:
ASM SID [ +ASM ]:
ASM port [ 1521 ]:
ASM user role [ SYSDBA ]:
ASM username [ SYS ]:
ASM user password:
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /u01/app/oracle/product/11.1.0/db_2
Local hostname ................ urania.localdomain
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /u01/app/oracle/product/11.1.0/db_2
ASM SID ................ +ASM
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ SYS
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Feb 4, 2009 9:26:04 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2009_02_04_09_24_59.log.
Feb 4, 2009 9:26:13 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Feb 4, 2009 9:30:14 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Feb 4, 2009 9:30:20 AM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library is already configured.
Feb 4, 2009 9:30:20 AM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: EM_SWLIB_STAGE_LOC (value) will be ignored.
Feb 4, 2009 9:30:20 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Feb 4, 2009 9:30:37 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Feb 4, 2009 9:30:37 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Feb 4, 2009 9:30:55 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Feb 4, 2009 9:30:55 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Feb 4, 2009 9:32:19 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Feb 4, 2009 9:32:20 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://urania.localdomain:5500/em <<<<<<<<<<<
Feb 4, 2009 9:32:32 AM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************ WARNING ************************
Management Repository has been placed in secure mode wherein Enterprise Manager
data will be encrypted. The encryption key has been placed in the file:
/u01/app/oracle/product/11.1.0/db_2/urania.localdomain_orcl/sysman/config/emkey.ora.
Please ensure this file is backed up as the encrypted data will become unusable
if this file is lost.
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Feb 4, 2009 9:32:32 AM
Concluído esto ahora notaremos que finalmente se incluye el link a la instancia ASM.
Puerta de acceso a gran cantidad de información y opciones que nos permitirán administrar la instancia ASM, con la misma simplicidad que OEM nos proporciona para la base de datos.
En este punto, y luego de tratar el tema durante varios Posts consecutivos, tenemos una base de datos que reside en ASM al igual que su Flash Recovery Area, siendo ambas instancias plenamente administrables desde OEM Database Console.
Llegamos pues al final de esta serie que espero les haya sido de utilidad, o eventualmente lo sea, en cuanto den el paso de adoptar ASM (lo cual ocurrirá tarde o temprano).