Wednesday 23 March 2016

Change ASM Diskgroup from normal redundancy to external redundancy



Step 1 :
SQL> shut immediate;

Step 2:
SQL> startup mount

Step 3:
Open RMAN  and  do a Backup of Whole Database

SQL> !rman target /

RMAN> backup device type disk format '/u01/asm1/database_format%u' database;

Starting backup at 22-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=25 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/myasm/datafile/system.302.907085491
input datafile file number=00002 name=+DATA/myasm/datafile/sysaux.303.907085493
input datafile file number=00003 name=+DATA/myasm/datafile/undotbs1.304.907085495
input datafile file number=00005 name=+DATA/myasm/datafile/users.320.907107373
input datafile file number=00006 name=+DATA/myasm/datafile/demo.319.907106321
input datafile file number=00004 name=+DATA/myasm/datafile/users.305.907085495
channel ORA_DISK_1: starting piece 1 at 22-MAR-16
channel ORA_DISK_1: finished piece 1 at 22-MAR-16
piece handle=/u01/asm1/database_format09r148in tag=TAG20160322T122141 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:37
Finished backup at 22-MAR-16

Starting Control File and SPFILE Autobackup at 22-MAR-16
piece handle=+DATA/myasm/autobackup/2016_03_22/s_907157976.272.907158211 comment=NONE
Finished Control File and SPFILE Autobackup at 22-MAR-16

RMAN> backup device type disk format '/u01/asm1/arch_format%u' archivelog all;

Starting backup at 22-MAR-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=1 STAMP=907086880
input archived log thread=1 sequence=3 RECID=2 STAMP=907105575
input archived log thread=1 sequence=4 RECID=3 STAMP=907110892
input archived log thread=1 sequence=5 RECID=4 STAMP=907115995
input archived log thread=1 sequence=6 RECID=5 STAMP=907116001
input archived log thread=1 sequence=7 RECID=6 STAMP=907116020
input archived log thread=1 sequence=8 RECID=7 STAMP=907116024
input archived log thread=1 sequence=9 RECID=8 STAMP=907116037
input archived log thread=1 sequence=10 RECID=9 STAMP=907116045
input archived log thread=1 sequence=11 RECID=10 STAMP=907116050
input archived log thread=1 sequence=12 RECID=11 STAMP=907116066
input archived log thread=1 sequence=13 RECID=12 STAMP=907116177
input archived log thread=1 sequence=14 RECID=13 STAMP=907116218
input archived log thread=1 sequence=15 RECID=14 STAMP=907116267
input archived log thread=1 sequence=16 RECID=15 STAMP=907116290
input archived log thread=1 sequence=17 RECID=16 STAMP=907116297
input archived log thread=1 sequence=18 RECID=17 STAMP=907153331
input archived log thread=1 sequence=19 RECID=18 STAMP=907154322
input archived log thread=1 sequence=20 RECID=19 STAMP=907154422
input archived log thread=1 sequence=21 RECID=20 STAMP=907155366
input archived log thread=1 sequence=22 RECID=21 STAMP=907155677
channel ORA_DISK_1: starting piece 1 at 22-MAR-16
channel ORA_DISK_1: finished piece 1 at 22-MAR-16
piece handle=/u01/asm1/arch_format0br148ns tag=TAG20160322T122427 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 22-MAR-16

Starting Control File and SPFILE Autobackup at 22-MAR-16
piece handle=+DATA/myasm/autobackup/2016_03_22/s_907157976.289.907158289 comment=NONE
Finished Control File and SPFILE Autobackup at 22-MAR-16


Step 4 :
Create pfile for Database and backup controlfile

SQL> create pfile='/u01/asm1/initnew.ora' from spfile;
File created.

SQL> alter database backup controlfile to '/u01/asm1/control01.ctl';
Database altered.

SQL> shut immediate;


Step 6
Run ASMCA, Create new diskgroup and drop disk group existing Diskgroup

And create new diskgroup with External Redundnacy
$ASMCA

[oracle@oracleasm1 Desktop]$ . oraenv
ORACLE_SID = [myasm] ? myasm
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 is /u01/app/oracle
[oracle@oracleasm1 Desktop]$ rlwrap sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 22 12:49:17 2016
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.

SQL> startup nomount pfile='/u01/asm1/initnew.ora';
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                                1336232 bytes
Variable Size                        197135448 bytes
Database Buffers               109051904 bytes
Redo Buffers                         6336512 bytes

SQL> create spfile ='+DATA' from pfile='/u01/asm1/initnew.ora' ;
File created.

SQL> !rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Mar 22 12:50:34 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: MYASM (not mounted)

RMAN> restore controlfile from '/u01/asm1/control01.ctl';

Starting restore at 22-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=25 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=+DATA/myasm/controlfile/current.257.907160017
output file name=+DATA/myasm/controlfile/current.258.907160019
Finished restore at 22-MAR-16

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> restore database;

Starting restore at 22-MAR-16
Starting implicit crosscheck backup at 22-MAR-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=25 device type=DISK
Crosschecked 7 objects
Finished implicit crosscheck backup at 22-MAR-16

Starting implicit crosscheck copy at 22-MAR-16
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 22-MAR-16

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

datafile 4 not processed because file is offline
datafile 5 not processed because file is offline
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/myasm/datafile/system.302.907085491
channel ORA_DISK_1: restoring datafile 00002 to +DATA/myasm/datafile/sysaux.303.907085493
channel ORA_DISK_1: restoring datafile 00003 to +DATA/myasm/datafile/undotbs1.304.907085495
channel ORA_DISK_1: restoring datafile 00006 to +DATA/myasm/datafile/demo.319.907106321
channel ORA_DISK_1: reading from backup piece /u01/asm1/database_format09r148in
channel ORA_DISK_1: piece handle=/u01/asm1/database_format09r148in tag=TAG20160322T122141
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:03:16
Finished restore at 22-MAR-16

RMAN> recover database ;

Starting recover at 22-MAR-16
using channel ORA_DISK_1
datafile 4 not processed because file is offline
datafile 5 not processed because file is offline

starting media recovery

archived log for thread 1 with sequence 23 is already on disk as file +NEWDATA/myasm/onlinelog/group_3.258.907115921
archived log file name=+NEWDATA/myasm/onlinelog/group_3.258.907115921 thread=1 sequence=23
media recovery complete, elapsed time: 00:00:01
Finished recover at 22-MAR-16



RMAN> alter database open resetlogs;

1 comment:

  1. Is it really possible to convert Redundancy of the Disk Group from High to Normal?
    When the Disk Group contains Data Bases.MOS note-438580.1 says it is not possible to do that..

    ReplyDelete