jueves, 24 de septiembre de 2015

CAMBIAR REDUNDANCY +ASM

Change ASM disk group from normal redundancy to external redundancy


Hello,
1
When the disk group was created with normal redundancy, the only way to change is to drop the disk group and recreate a new one.
1) shutdown database
shutdown immediate;
2) startup in mount mode
startup mount;
3) make database full backup, archivelog backup, spfile backup and controlfile backup
RMAN> backup device type disk format '/u02/backup/backup/database_backup%U' database;

RMAN> backup device type disk format '/u02/backup/backup/archivelog%U' archivelog all;

SQL>  create pfile='/u02/backup/initorcl.ora' from spfile;

SQL>  alter database backup controlfile to '/u02/backup/control.ctl';
4) shutdown database;
shutdown immediate;
5) login as sysasm and drop disk group
[oracle@oel6 backup]$ . oraenv
ORACLE_SID = [orcl] ? +ASM
sqlplus / as sysasm

SQL> drop diskgroup DISKS including contents;

SQL> shutdown immedaite;

SQL> startup nomount;
6) run asmca and create new disk group with external redundancy
2
SQL> select status from v$instance;
STATUS
————
STARTED
7) ASM instance is already started, now we must restore database and all related files.
[oracle@oel6]$ . oraenv
ORACLE_SID = [+ASM] ? orcl
sqlplus / as sysdba

SQL> startup nomount pfile='/u02/backup/initorcl.ora';

SQL> create spfile='+DISKS' from pfile='/u02/backup/initorcl.ora';

SQL> !rman target /

RMAN> restore controlfile from '/u02/backup/control.ctl';

RMAN> alter database mount;

RMAN> restore database;

RMAN> recover database;

unable to find archived log
archived log thread=1 sequence=8
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/25/2013 12:11:31
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 8 and starting SCN of 21904164
While recovery it will give an error for archive log missing, this is expected we need to open the database with resetlogs as
RMAN> alter database open resetlogs;
8)
for using correct spfile:
ASMCMD> cp '/u0/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl.ora' '+DISKS/ORCL/spfileorcl.ora' 
delete spfile from file system
rm -rf /u0/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl.ora
edit /u0/app/oracle/product/11.2.0/dbhome_1/dbs/initorcl.ora, which must contains link to our spfile in disk group.
*.SPFILE='+DISKS/orcl/spfileorcl.ora'
3
that’s all.

No hay comentarios: