11gR2 ASM – Inside story – Part 6 (Recreate High available Service and rename Disk group)

July 30th, 2011 | Posted in 11gR2, ASM, Blog, grid infrastructure, RAC | 6 Comments

   
Click on the flag, to chosse your language:

Download the pdf version of the article here; Recreate High available Service and rename Disk group

In the previous ASM inside story article, which refers to the part 5 of the story. We have seen how to read an ASM file from OS.

In this article, we will see how to recreate the high available service, register the resources and at the end of this article we will rename a diskgroup.

The following procedures have been tested in an 11gR2 standalone grid infrastructure under Oracle Enterprise Linux.

1- Recreate the High Available Service:

Issue:

After server reboots, the resources have not been started automatically as a part of the Oracle Restart task. I have checked the status of resource, but they failed with the following errors;


[oracle@localhost .oracle]$ srvctl status asm
PRCR-1070 : Failed to check if resource ora.asm is registered
Cannot communicate with crsd
[oracle@localhost .oracle]$

I have tried to start the high available service;


[root@localhost bin]# ./crsctl start has
Failure at scls_scr_getval with code 1
Internal Error Information:
  Category: -2
 Operation: opendir
  Location: scrsearch1
  Other: cant open scr home dir scls_scr_getval
  System Dependent Information: 2

CRS-4000: Command Start failed, or completed with errors.

Solution:

To solve the issue, After fixing the /etc/hosts file, origin of this issue. I have deleted HAS, using the force option;


[root@localhost bin]# /u01/app/oracle/product/11.2.0/grid/perl/bin/perl -I /u01/app/oracle/product/11.2.0/grid/perl/lib -I /u01/app/oracle/product/11.2.0/grid/crs/install /u01/app/oracle/product/11.2.0/grid/crs/install/roothas.pl -delete -force
2011-07-30 14:04:54: Checking for super user privileges
2011-07-30 14:04:54: User has super user privileges
2011-07-30 14:04:54: Parsing the host name
Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
Failure at scls_scr_getval with code 1
Internal Error Information:
  Category: -2
 Operation: opendir
  Location: scrsearch1
  Other: cant open scr home dir scls_scr_getval
  System Dependent Information: 2

CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
ACFS-9200: Supported
Successfully deconfigured Oracle Restart stack

I configured the HAS using the following command;


[root@localhost bin]# /u01/app/oracle/product/11.2.0/grid/perl/bin/perl -I /u01/app/oracle/product/11.2.0/grid/perl/lib -I /u01/app/oracle/product/11.2.0/grid/crs/install /u01/app/oracle/product/11.2.0/grid/crs/install/roothas.pl
2011-07-30 14:06:13: Checking for super user privileges
2011-07-30 14:06:13: User has super user privileges
2011-07-30 14:06:13: Parsing the host name
Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node 192 successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting

192     2011/07/30 14:07:28     /u01/app/oracle/product/11.2.0/grid/cdata/192/backup_20110730_140728.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@localhost bin]#

Now I have to check the status of the resources;


[root@localhost bin]# ./crsctl status res
NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=OFFLINE
STATE=OFFLINE

[root@localhost bin]# 

Now, I add ASM and start it;


su - oracle

[oracle@localhost ~]$ srvctl status asm
PRCR-1001 : Resource ora.asm does not exist
[oracle@localhost ~]$ srvctl add asm
[oracle@localhost ~]$ srvctl status asm
ASM is not running.
[oracle@localhost ~]$ 

[oracle@localhost ~]$ srvctl start asm
[oracle@localhost ~]$ srvctl status asm
ASM is running on 192
[oracle@localhost ~]$
[oracle@localhost ~]$ ps -edf | grep ASM
oracle    5162     1  0 14:12 ?        00:00:00 asm_pmon_+ASM
oracle    5164     1  0 14:12 ?        00:00:00 asm_vktm_+ASM
oracle    5168     1  0 14:12 ?        00:00:00 asm_gen0_+ASM
oracle    5170     1  0 14:12 ?        00:00:00 asm_diag_+ASM
oracle    5172     1  0 14:12 ?        00:00:00 asm_psp0_+ASM
oracle    5174     1  1 14:12 ?        00:00:00 asm_dia0_+ASM
oracle    5176     1  0 14:12 ?        00:00:00 asm_mman_+ASM
oracle    5178     1  0 14:12 ?        00:00:00 asm_dbw0_+ASM
oracle    5180     1  0 14:12 ?        00:00:00 asm_lgwr_+ASM
oracle    5182     1  0 14:12 ?        00:00:00 asm_ckpt_+ASM
oracle    5184     1  0 14:12 ?        00:00:00 asm_smon_+ASM
oracle    5186     1  0 14:12 ?        00:00:00 asm_rbal_+ASM
oracle    5188     1  0 14:12 ?        00:00:00 asm_gmon_+ASM
oracle    5190     1  1 14:12 ?        00:00:00 asm_mmon_+ASM
oracle    5192     1  1 14:12 ?        00:00:00 asm_mmnl_+ASM
oracle    5221  2910  0 14:12 pts/1    00:00:00 grep ASM
[oracle@localhost ~]$ 

[oracle@localhost ~]$ export ORACLE_HOME=$GRID_HOME
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:20:40 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option

SQL> 

Now, I check the database resource;


[oracle@localhost ~]$ srvctl status database -d ORAW
PRCD-1120 : The resource for database ORAW could not be found.
PRCR-1001 : Resource ora.oraw.db does not exist
[oracle@localhost ~]$ srvctl add database -d ORAW -o $ORACLE_HOME
[oracle@localhost ~]$ srvctl status database -d ORAW
Database is not running.
[oracle@localhost ~]$

Ok, Now after adding the database., we need to start the database instance;


[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:19:45 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/ORAW/spfileORAW.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/ORAW/spfileORAW.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:DGOpenFile05 Failed to open file +DATA/oraw/spfileoraw.ora
ORA-17503: ksfdopn:2 Failed to open file +DATA/oraw/spfileoraw.ora
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-06512: at line 4
SQL> exit
Disconnected

From the error, we have to mount the ASM diskgroup DATA, which is needed by the database instance. This diskgroup holds the spfile.


[oracle@localhost ~]$ asmcmd mount DATA
[oracle@localhost ~]$ 

[oracle@localhost ~]$ source /home/oracle/.bash_profile
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:23:35 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             268438616 bytes
Database Buffers           37748736 bytes
Redo Buffers                6336512 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '+DATA_RAC/oraw/datafile/data_rac_read.256.744964813'

SQL>

Again, we need to mount the DATA_RAC Diskgroup, which holds one datafile;


[oracle@localhost ~]$ export ORACLE_HOME=$GRID_HOME
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ asmcmd mount DATA_RAC
[oracle@localhost ~]$ source /home/oracle/.bash_profile
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:25:40 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> alter database open;

Database altered.

SQL> 

Now, we have fixed the issue. We have our infrastructure up and running including ASM instances, database instances.
We could do the same steps to add the listeners as resources and any other resources, like database console…

2- Rename ASM Diskgroup:

In my environment, I have removed the RAC lab I had installed and reduced it to a single standalone environment. I have recently restored the RAC 11gR2 environment to a single instance.
But, when looking into my new environment, I have seen that was a diskgroup named DATA_RAC which has been created in my old RAC lab. Now, the name of this diskgroup does not have any sense.
So, I wanted to rename it to DATA_REPORTING.

The following procedure could be also applied to a RAC environment. in the case of RAC, you should try the procedure in all RAC nodes.

First step includes the shutdown of the database instance;


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
[oracle@localhost ~]$

Now, we list the name of the diskroups using V$ASM_DISKGROUP view.


[oracle@localhost ~]$ export ORACLE_HOME=$GRID_HOME
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:29:56 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option

SQL> SELECT NAME FROM V$ASM_DISKGROUP;

NAME
------------------------------
INDX
DATA_RAC
DATA

SQL>

Dismount the disgroup.


[oracle@localhost ~]$ asmcmd umount DATA_RAC

verify that the diskgroup is really dismounted. The diskgroup should be listed when performing the command below;


[oracle@localhost ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      4000      843              795              24              0             N  DATA/
[oracle@localhost ~]$

Now rename the disggroup;


[oracle@localhost ~]$ renamedg phase=both dgname=DATA_RAC newdgname=DATA_REPORTING verbose=true
NOTE: No asm libraries found in the system

Parsing parameters..

Parameters in effect:

         Old DG name       : DATA_RAC
         New DG name          : DATA_REPORTING
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: phase=both dgname=DATA_RAC newdgname=DATA_REPORTING verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk UFS:/dev/raw/raw5 with disk number:0 and timestamp (32951462 -1967443968)
Identified disk UFS:/dev/raw/raw6 with disk number:1 and timestamp (32951462 -1967443968)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk UFS:/dev/raw/raw5 with disk number:0 and timestamp (32951462 -1967443968)
Identified disk UFS:/dev/raw/raw6 with disk number:1 and timestamp (32951462 -1967443968)
Checking if the diskgroup is mounted
Checking disk number:0
Checking disk number:1
Checking if diskgroup is used by CSS
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for /dev/raw/raw5
Modifying the header
Looking for /dev/raw/raw6
Modifying the header
Completed phase 2
Terminating kgfd context 0xb7e70050
[oracle@localhost ~]$ 

Mount the renamed disgroup;


[oracle@localhost ~]$ asmcmd mount DATA_REPORTING

Verify that the renamed disgroup is mounted.


[oracle@localhost ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      4000      843              795              24              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576      2000     1692                0             846              0             N  DATA_REPORTING/
[oracle@localhost ~]$

Now, we should not forget our database. We startup the instance;


[oracle@localhost ~]$ source /home/oracle/.bash_profile
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:34:20 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             268438616 bytes
Database Buffers           37748736 bytes
Redo Buffers                6336512 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '+DATA_RAC/oraw/datafile/data_rac_read.256.744964813'

Now rename all the datafiles, or database files listed in the error message;


SQL> alter database rename file '+DATA_RAC/oraw/datafile/data_rac_read.256.744964813'
  2  to
  3  '+DATA_REPORTING/oraw/datafile/data_rac_read.256.744964813';

Database altered.

SQL> alter database open;

Database altered.

SQL> 

Now, we have our database ready for use, and, also our disgroup with names that really make sense.

Descargar la version Española del articulo en pdf, aqui; Recreate High available Service and rename Disk group – ES

Introducción:

En el pasado articulo, hemos visto como leer un fichero de ASM a partir del sistema operativo.
En este articulo, vamos a ver como recrear el servicio de alta disponibilidad, registrar los recursos y al final del articulo, cambiaremos el nombre de un grupo de discos.

Este procedimiento se aplica a una base de datos 11gR2 bajo Oracle Enterprise Linux.

1- Recrear el servicio de alta disponibilidad:

Problema:

Después de reiniciar el servidor, los recursos de HA no arrancaban automáticamente.
A partir de la versión 11gR2 es el servicio de Oracle restart que es el responsable del arranque automático de los recursos; como la base de datos, las instancias de ASM, etc..

Al comprobar los recursos, hemos recibido el siguiente error;


[oracle@localhost .oracle]$ srvctl status asm
PRCR-1070 : Failed to check if resource ora.asm is registered
Cannot communicate with crsd
[oracle@localhost .oracle]$

Ahora, intentamos arrancar el servicio de alta disponibilidad;


[root@localhost bin]# ./crsctl start has
Failure at scls_scr_getval with code 1
Internal Error Information:
  Category: -2
 Operation: opendir
  Location: scrsearch1
  Other: cant open scr home dir scls_scr_getval
  System Dependent Information: 2

CRS-4000: Command Start failed, or completed with errors.

Solución:

Para resolver el problema, he corregido el contenido del fichero /etc/hosts como estaba antes de reiniciar la maquina. Ahora, borro el servicio de alta disponibilidad, usando la opción -force;


[root@localhost bin]# /u01/app/oracle/product/11.2.0/grid/perl/bin/perl -I /u01/app/oracle/product/11.2.0/grid/perl/lib -I /u01/app/oracle/product/11.2.0/grid/crs/install /u01/app/oracle/product/11.2.0/grid/crs/install/roothas.pl -delete -force
2011-07-30 14:04:54: Checking for super user privileges
2011-07-30 14:04:54: User has super user privileges
2011-07-30 14:04:54: Parsing the host name
Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
Failure at scls_scr_getval with code 1
Internal Error Information:
  Category: -2
 Operation: opendir
  Location: scrsearch1
  Other: cant open scr home dir scls_scr_getval
  System Dependent Information: 2

CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
ACFS-9200: Supported
Successfully deconfigured Oracle Restart stack

Ahora, reconsideramos el servicio de alta disponibilidad de nuevo;


[root@localhost bin]# /u01/app/oracle/product/11.2.0/grid/perl/bin/perl -I /u01/app/oracle/product/11.2.0/grid/perl/lib -I /u01/app/oracle/product/11.2.0/grid/crs/install /u01/app/oracle/product/11.2.0/grid/crs/install/roothas.pl
2011-07-30 14:06:13: Checking for super user privileges
2011-07-30 14:06:13: User has super user privileges
2011-07-30 14:06:13: Parsing the host name
Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node 192 successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting

192     2011/07/30 14:07:28     /u01/app/oracle/product/11.2.0/grid/cdata/192/backup_20110730_140728.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@localhost bin]#

Verificamos el estado de los recursos;


[root@localhost bin]# ./crsctl status res
NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=OFFLINE
STATE=OFFLINE

[root@localhost bin]# 

Añadimos, ASM como un recurso al servicio de alta disponibilidad;


su - oracle

[oracle@localhost ~]$ srvctl status asm
PRCR-1001 : Resource ora.asm does not exist
[oracle@localhost ~]$ srvctl add asm
[oracle@localhost ~]$ srvctl status asm
ASM is not running.
[oracle@localhost ~]$ 

[oracle@localhost ~]$ srvctl start asm
[oracle@localhost ~]$ srvctl status asm
ASM is running on 192
[oracle@localhost ~]$
[oracle@localhost ~]$ ps -edf | grep ASM
oracle    5162     1  0 14:12 ?        00:00:00 asm_pmon_+ASM
oracle    5164     1  0 14:12 ?        00:00:00 asm_vktm_+ASM
oracle    5168     1  0 14:12 ?        00:00:00 asm_gen0_+ASM
oracle    5170     1  0 14:12 ?        00:00:00 asm_diag_+ASM
oracle    5172     1  0 14:12 ?        00:00:00 asm_psp0_+ASM
oracle    5174     1  1 14:12 ?        00:00:00 asm_dia0_+ASM
oracle    5176     1  0 14:12 ?        00:00:00 asm_mman_+ASM
oracle    5178     1  0 14:12 ?        00:00:00 asm_dbw0_+ASM
oracle    5180     1  0 14:12 ?        00:00:00 asm_lgwr_+ASM
oracle    5182     1  0 14:12 ?        00:00:00 asm_ckpt_+ASM
oracle    5184     1  0 14:12 ?        00:00:00 asm_smon_+ASM
oracle    5186     1  0 14:12 ?        00:00:00 asm_rbal_+ASM
oracle    5188     1  0 14:12 ?        00:00:00 asm_gmon_+ASM
oracle    5190     1  1 14:12 ?        00:00:00 asm_mmon_+ASM
oracle    5192     1  1 14:12 ?        00:00:00 asm_mmnl_+ASM
oracle    5221  2910  0 14:12 pts/1    00:00:00 grep ASM
[oracle@localhost ~]$ 

[oracle@localhost ~]$ export ORACLE_HOME=$GRID_HOME
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:20:40 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option

SQL> 

verificamos, el estado de la instancia de bases de datos y su recurso;


[oracle@localhost ~]$ srvctl status database -d ORAW
PRCD-1120 : The resource for database ORAW could not be found.
PRCR-1001 : Resource ora.oraw.db does not exist
[oracle@localhost ~]$ srvctl add database -d ORAW -o $ORACLE_HOME
[oracle@localhost ~]$ srvctl status database -d ORAW
Database is not running.
[oracle@localhost ~]$

Vale, ahora, tenemos que arrancar la instancia de bases de datos.


[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:19:45 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/ORAW/spfileORAW.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/ORAW/spfileORAW.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:DGOpenFile05 Failed to open file +DATA/oraw/spfileoraw.ora
ORA-17503: ksfdopn:2 Failed to open file +DATA/oraw/spfileoraw.ora
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-06512: at line 4
SQL> exit
Disconnected

El error es explicito; tenemos que montar el grupo de discos DATA.


[oracle@localhost ~]$ asmcmd mount DATA
[oracle@localhost ~]$ 

[oracle@localhost ~]$ source /home/oracle/.bash_profile
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:23:35 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             268438616 bytes
Database Buffers           37748736 bytes
Redo Buffers                6336512 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '+DATA_RAC/oraw/datafile/data_rac_read.256.744964813'

SQL>

El error es también explicito; tenemos que montar el grupo de discos DATA_RAC.


[oracle@localhost ~]$ export ORACLE_HOME=$GRID_HOME
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ asmcmd mount DATA_RAC
[oracle@localhost ~]$ source /home/oracle/.bash_profile
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:25:40 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> alter database open;

Database altered.

SQL> 

Ahora, que tenemos la base de datos arrancada, tenemos también la infraestructura arrancada.

2- Renombrar un grupo de discos ASM:

Después de migrar mi RAC a una base de datos de simple instancia, he notado que había un grupo de discos que portaba el nombre de DATA_RAC. Ahora, quiero renombrar este grupo de discos, para tener mas sentido. Voy a renombrar lo a DATA_REPRTING.

El seguinete procedimiento puede también ser aplicado a unas instancias de RAC. En aquel caso, se puede aplicar las etapas en todos los nodos del cluster.

El primer etapa, incluye parar la instancia de bases de datos


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
[oracle@localhost ~]$

Ahora, listamos los diferentes nombres de grupos de discos;


[oracle@localhost ~]$ export ORACLE_HOME=$GRID_HOME
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:29:56 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option

SQL> SELECT NAME FROM V$ASM_DISKGROUP;

NAME
------------------------------
INDX
DATA_RAC
DATA

SQL>

Desmontamos el grupo de discos, DATA_RAC;


[oracle@localhost ~]$ asmcmd umount DATA_RAC

Verificamos que el grupo de discos esta realmente dismontado;


[oracle@localhost ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      4000      843              795              24              0             N  DATA/
[oracle@localhost ~]$

Cambiamos el nombre del grupo de discos;


[oracle@localhost ~]$ renamedg phase=both dgname=DATA_RAC newdgname=DATA_REPORTING verbose=true
NOTE: No asm libraries found in the system

Parsing parameters..

Parameters in effect:

         Old DG name       : DATA_RAC
         New DG name          : DATA_REPORTING
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: phase=both dgname=DATA_RAC newdgname=DATA_REPORTING verbose=true
Executing phase 1
Discovering the grupo
Performing discovery with string:
Identified disk UFS:/dev/raw/raw5 with disk number:0 and timestamp (32951462 -1967443968)
Identified disk UFS:/dev/raw/raw6 with disk number:1 and timestamp (32951462 -1967443968)
Checking for hearbeat...
Re-discovering the grupo
Performing discovery with string:
Identified disk UFS:/dev/raw/raw5 with disk number:0 and timestamp (32951462 -1967443968)
Identified disk UFS:/dev/raw/raw6 with disk number:1 and timestamp (32951462 -1967443968)
Checking if the diskgroup is mounted
Checking disk number:0
Checking disk number:1
Checking if diskgroup is used by CSS
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for /dev/raw/raw5
Modifying the header
Looking for /dev/raw/raw6
Modifying the header
Completed phase 2
Terminating kgfd context 0xb7e70050
[oracle@localhost ~]$ 

Montamos el grupo de discos recien renombrado;


[oracle@localhost ~]$ asmcmd mount DATA_REPORTING

Verificar que el grupo de discos esta realmente montado;


[oracle@localhost ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      4000      843              795              24              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576      2000     1692                0             846              0             N  DATA_REPORTING/
[oracle@localhost ~]$

Ahora, deberemos arrancar la instancia de bases de datos;


[oracle@localhost ~]$ source /home/oracle/.bash_profile
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:34:20 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             268438616 bytes
Database Buffers           37748736 bytes
Redo Buffers                6336512 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '+DATA_RAC/oraw/datafile/data_rac_read.256.744964813'

Es la hora de renombrar los ficheros de bases de datos;


SQL> alter database rename file '+DATA_RAC/oraw/datafile/data_rac_read.256.744964813'
  2  to
  3  '+DATA_REPORTING/oraw/datafile/data_rac_read.256.744964813';

Database altered.

SQL> alter database open;

Database altered.

SQL> 

Ahora tenemos nuestra bases de datos lista para ser usada, con unos nombres de grupos de discos mas significativos;

Télécharger la version Française article, en pdf, ici; Recreate High available Service and rename Disk group – FR

Introduction:

Dans l’article précédent de l’histoire de ASM, nous avons vu comment lire un fichier ASM depuis le système opératif.
Dans cet article, nous allons voir comment recréer le service de haute disponibilité, comment register les ressources et enfin, comment renommer un groupe de disques ASM.

Cette procédure est appliquée à une bases de données 11gR2, sous Oracle Enterprise Linux.

1- Recréer le service de haute disponibilité :

Problème et besoin:

Après le redémarrage du serveur de bases de données, les ressources de haute disponibilité ne se redémarrent pas automatiquement. Il faut se rappeler que à partir de la version 11gR2, Oracle Restart est responsable de redémarrage automatiques des ressources; ASM, instances de bases de données, listeners, etc…

Voici l’erreur que j’ai reçu;


[oracle@localhost .oracle]$ srvctl status asm
PRCR-1070 : Failed to check if resource ora.asm is registered
Cannot communicate with crsd
[oracle@localhost .oracle]$

Maintenant, nous allons essayer de redémarrer les services de haute disponibilité manuellement;


[root@localhost bin]# ./crsctl start has
Failure at scls_scr_getval with code 1
Internal Error Information:
  Category: -2
 Operation: opendir
  Location: scrsearch1
  Other: cant open scr home dir scls_scr_getval
  System Dependent Information: 2

CRS-4000: Command Start failed, or completed with errors.

Solution et démarche à suivre:

Pour résoudre le problème, j’aurais du modifier le contenu du fichier /etc/hosts.
Maintenant, j’ai supprimé le service de haute disponibilité, en utilisant l’option -force;


[root@localhost bin]# /u01/app/oracle/product/11.2.0/grid/perl/bin/perl -I /u01/app/oracle/product/11.2.0/grid/perl/lib -I /u01/app/oracle/product/11.2.0/grid/crs/install /u01/app/oracle/product/11.2.0/grid/crs/install/roothas.pl -delete -force
2011-07-30 14:04:54: Checking for super user privileges
2011-07-30 14:04:54: User has super user privileges
2011-07-30 14:04:54: Parsing the host name
Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
Failure at scls_scr_getval with code 1
Internal Error Information:
  Category: -2
 Operation: opendir
  Location: scrsearch1
  Other: cant open scr home dir scls_scr_getval
  System Dependent Information: 2

CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
ACFS-9200: Supported
Successfully deconfigured Oracle Restart stack

Maintenant, nous démarrons le service de haute disponibilité;


[root@localhost bin]# /u01/app/oracle/product/11.2.0/grid/perl/bin/perl -I /u01/app/oracle/product/11.2.0/grid/perl/lib -I /u01/app/oracle/product/11.2.0/grid/crs/install /u01/app/oracle/product/11.2.0/grid/crs/install/roothas.pl
2011-07-30 14:06:13: Checking for super user privileges
2011-07-30 14:06:13: User has super user privileges
2011-07-30 14:06:13: Parsing the host name
Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node 192 successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting

192     2011/07/30 14:07:28     /u01/app/oracle/product/11.2.0/grid/cdata/192/backup_20110730_140728.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@localhost bin]#

Vérifions, l’état des ressources;


[root@localhost bin]# ./crsctl status res
NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=OFFLINE
STATE=OFFLINE

[root@localhost bin]# 

Ajoutons ASM comme une ressource au service haute disponibilité


su - oracle

[oracle@localhost ~]$ srvctl status asm
PRCR-1001 : Resource ora.asm does not exist
[oracle@localhost ~]$ srvctl add asm
[oracle@localhost ~]$ srvctl status asm
ASM is not running.
[oracle@localhost ~]$ 

[oracle@localhost ~]$ srvctl start asm
[oracle@localhost ~]$ srvctl status asm
ASM is running on 192
[oracle@localhost ~]$
[oracle@localhost ~]$ ps -edf | grep ASM
oracle    5162     1  0 14:12 ?        00:00:00 asm_pmon_+ASM
oracle    5164     1  0 14:12 ?        00:00:00 asm_vktm_+ASM
oracle    5168     1  0 14:12 ?        00:00:00 asm_gen0_+ASM
oracle    5170     1  0 14:12 ?        00:00:00 asm_diag_+ASM
oracle    5172     1  0 14:12 ?        00:00:00 asm_psp0_+ASM
oracle    5174     1  1 14:12 ?        00:00:00 asm_dia0_+ASM
oracle    5176     1  0 14:12 ?        00:00:00 asm_mman_+ASM
oracle    5178     1  0 14:12 ?        00:00:00 asm_dbw0_+ASM
oracle    5180     1  0 14:12 ?        00:00:00 asm_lgwr_+ASM
oracle    5182     1  0 14:12 ?        00:00:00 asm_ckpt_+ASM
oracle    5184     1  0 14:12 ?        00:00:00 asm_smon_+ASM
oracle    5186     1  0 14:12 ?        00:00:00 asm_rbal_+ASM
oracle    5188     1  0 14:12 ?        00:00:00 asm_gmon_+ASM
oracle    5190     1  1 14:12 ?        00:00:00 asm_mmon_+ASM
oracle    5192     1  1 14:12 ?        00:00:00 asm_mmnl_+ASM
oracle    5221  2910  0 14:12 pts/1    00:00:00 grep ASM
[oracle@localhost ~]$ 

[oracle@localhost ~]$ export ORACLE_HOME=$GRID_HOME
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:20:40 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option

SQL> 

Vérifions, l’état de l’instance de bases de données et ses ressources;


[oracle@localhost ~]$ srvctl status database -d ORAW
PRCD-1120 : The resource for database ORAW could not be found.
PRCR-1001 : Resource ora.oraw.db does not exist
[oracle@localhost ~]$ srvctl add database -d ORAW -o $ORACLE_HOME
[oracle@localhost ~]$ srvctl status database -d ORAW
Database is not running.
[oracle@localhost ~]$

Ok, maintenant, nous devons démarrer l’instance de bases de données.


[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:19:45 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/ORAW/spfileORAW.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/ORAW/spfileORAW.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:DGOpenFile05 Failed to open file +DATA/oraw/spfileoraw.ora
ORA-17503: ksfdopn:2 Failed to open file +DATA/oraw/spfileoraw.ora
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-06512: at line 4
SQL> exit
Disconnected

Analyzons l’erreur, il faut monter le groupe de disques, DATA.


[oracle@localhost ~]$ asmcmd mount DATA
[oracle@localhost ~]$ 

[oracle@localhost ~]$ source /home/oracle/.bash_profile
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:23:35 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             268438616 bytes
Database Buffers           37748736 bytes
Redo Buffers                6336512 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '+DATA_RAC/oraw/datafile/data_rac_read.256.744964813'

SQL>

Aussi, montons le groupe de disques, DATA_RAC.


[oracle@localhost ~]$ export ORACLE_HOME=$GRID_HOME
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ asmcmd mount DATA_RAC
[oracle@localhost ~]$ source /home/oracle/.bash_profile
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:25:40 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> alter database open;

Database altered.

SQL> 

Maintenant, nous avons la base de données démarrée, aussi bien que la infrastructure

2- Renommer le groupe de disques ASM:

Après avoir migré ma base de données en RAC à une base de données d’instance unique; J’ai noté qu’il y’¡a un groupe de disques nommé DATA_RAC. Ce nom de groupe de disques n’a plus de sens maintenant dans un environnement d’instance unique. Donc, je vais le renommer en DATA_REPORTING;


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
[oracle@localhost ~]$

On va vérifier les noms de groupes de disques;


[oracle@localhost ~]$ export ORACLE_HOME=$GRID_HOME
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:29:56 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option

SQL> SELECT NAME FROM V$ASM_DISKGROUP;

NAME
------------------------------
INDX
DATA_RAC
DATA

SQL>

On va démonter le groupe de disques, DATA_RAC;


[oracle@localhost ~]$ asmcmd umount DATA_RAC

Le groupe de disque est bien démonté;


[oracle@localhost ~]$ asmcmd lsdg
State    Type    Rebal  Hector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      4000      843              795              24              0             N  DATA/
[oracle@localhost ~]$

Changeons le nom de groupe de disques;


[oracle@localhost ~]$ renamedg phase=both dgname=DATA_RAC newdgname=DATA_REPORTING verbose=true
NOTE: No asm libraries found in the system

Parsing parameters..

Parameters in effect:

         Old DG name       : DATA_RAC
         New DG name          : DATA_REPORTING
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: phase=both dgname=DATA_RAC newdgname=DATA_REPORTING verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk UFS:/dev/raw/raw5 with disk number:0 and timestamp (32951462 -1967443968)
Identified disk UFS:/dev/raw/raw6 with disk number:1 and timestamp (32951462 -1967443968)
Checking for hearbeat...
Re-discovering the grupo
Performing discovery with string:
Identified disk UFS:/dev/raw/raw5 with disk number:0 and timestamp (32951462 -1967443968)
Identified disk UFS:/dev/raw/raw6 with disk number:1 and timestamp (32951462 -1967443968)
Checking if the diskgroup is mounted
Checking disk number:0
Checking disk number:1
Checking if diskgroup is used by CSS
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for /dev/raw/raw5
Modifying the header
Looking for /dev/raw/raw6
Modifying the header
Completed phase 2
Terminating kgfd context 0xb7e70050
[oracle@localhost ~]$ 

On doit monter maintenant le groupe de diques;


[oracle@localhost ~]$ asmcmd mount DATA_REPORTING

vérifions que le groupe renommé est bien monté;


[oracle@localhost ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      4000      843              795              24              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576      2000     1692                0             846              0             N  DATA_REPORTING/
[oracle@localhost ~]$

Démarrons l’instance de bases de données;


[oracle@localhost ~]$ source /home/oracle/.bash_profile
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 14:34:20 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             268438616 bytes
Database Buffers           37748736 bytes
Redo Buffers                6336512 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '+DATA_RAC/oraw/datafile/data_rac_read.256.744964813'

Il faudrait renommer les fichiers de données;


SQL> alter database rename file '+DATA_RAC/oraw/datafile/data_rac_read.256.744964813'
  2  to
  3  '+DATA_REPORTING/oraw/datafile/data_rac_read.256.744964813';

Database altered.

SQL> alter database open;

Database altered.

SQL> 

Miantenant, nous avons des groups de disques avec des noms plus cohérents et logique.

Scridb filter


6 Comments to “11gR2 ASM – Inside story – Part 6 (Recreate High available Service and rename Disk group)”

  1. Jim Boles says:

    Wow!…. the section on in Part 6 about reconfiguring HAS was priceless. That saved me tons of time.
    Thx for your continued efforts to blaze the trail!

  2. Johannes says:

    Many Thanks, your post helped me a lot. One small addition (maybe others run into it too): After recreating HAS, I needed to adjust oratab as the ORACLE_HOME for the database resource (ORAW in your example) pointed to the wrong path.

  3. Johannes says:

    thanks

  4. anungtama says:

    Solve my problem..you did a great job.

  5. Harry says:

    awesome


Leave a Comment





Subscribe


Polls

which oracle topic interests you most?

View Results

Loading ... Loading ...


Oracle Class Tweets


Recent Posts


Recent Comments

  • Jaspreet: Brilliant explanation.
  • Yousuf: Very Nice… Just wanted to check you have done all patching at Node 1 only.. is there any thing need to...
  • Yousuf: Very Nice.. Thanks for sharing.. Once question.. You have executed all commands on Node 1 only.. Is there any...
  • Emir: Thanks… Great article
  • borse firmate: Thank you for another informative blog. The place else may just I am getting that kind of information...
  • leandro: why this parameter is systemwide? could you read from a asm instance from one failure group and from the...
  • Mohammad: paul, we create pfile from target database to source database and later we change database name, and...
  • Muhammad Ikram: Thanks Brother for sharing pearls of knowledge. May ALLAH reward you for this both here and...
  • rgrover: Thanks for the POST. I recently encounter similar issue. Your POST helped.
  • gopalredy: really its very use full to dbas
  • Vivian: This is awesome! Thank you so much!
  • henry zhong: CDB=DB, and PDB=SCHEMA but in a sub dictionary?
  • Dehbashee: Salam Brother, Thanx for sharing, however, i would be interested in chaging the password for the grid user...
  • wissem: No we don’t need that :) Just the scripts I posted above
  • Md. Tanweer: Thanks for posting the material. I really appreciate if you can send me, if you have tutorial for 11g...
  • christiaan: Thanks!! This has been bugging the hell out of me for so long.
  • Rajasekhar: Thank you
  • Samarjit Panigrahy: Very Nice and Simple Demo… Cool :)
  • cq: Any reason not to use auto patch for both CRS and RAC homes with one command? Or use opatch auto for RAC home as...
  • Hitesh: Hi, Can we use this RACcheck tool on oracle SE version ? Thanks