Linux

Change Diskgroup Redundancy – ASM

 

(Change Diskgroup Redundancy)

1. Create a new Diskgroup with desired redundancy and move the existing data to newly created Diskgroup.
2. Drop the existing Diskgroup after backing up data and create a new Diskgroup with desired redundancy.
Create a new diskgroup with desired redundancy and move the existing data to newly created diskgroup.
1) If we have extra disk space available,then we can create a new diskgroup and move the files from old diskgroup to it.
— Initially we have two diskgroup with external redundancy as:
SQL> select state,name from v$asm_diskgroup;
STATE NAME———– ——————–MOUNTED ERMAN

2) Create a new diskgroup with normal redundancy as :
SQL > create diskgroup ERMANNEW normal redundancy failgroup
SQL> select state,name,type from v$asm_diskgroup;
STATE NAME TYPE———– ——————- ——MOUNTED ERMAN EXTERNMOUNTED ERMANNEW NORMAL
3)Backup the current database as follows:
SQL> show parameter db_name
NAME TYPE VALUE—————- ———– —————————-db_name string orcl10g
SQL> create pfile=’/tmp/ermantest/demo/initorcl+ASM.ora’ from spfile;
SQL> alter database backup controlfile to ‘+ERMANNEW’;
SQL> alter system set control_files=’+ERMANNEW\ORCL11G\CONTROLFILE\<system generated control file name from diskgroup ERMANNEW>’ SCOPE=SPFILE;

— Connect to rman$ rman target /
RMAN > shutdown immediate;
RMAN > startup nomount;
RMAN> restore controlfile to ‘<new_diskgroup +ERMANNEW>’ from ‘+ERMAN\ORCL10G\CONTROLFILE\mycontrolfile.ctl’;
RMAN > alter database mount;
RMAN> backup as copy database format ‘+ERMANNEW’;

4)Switch the database to copy. At this moment we are switching to the new Diskgroup
RMAN> switch database to copy;
RMAN> recover database ;
This will recover the backup controlfile taken and restored before to be in sync with database/datafiles

RMAN> alter database open resetlogs;

5)Add new tempfile to newly created database.
SQL> alter tablespace TEMP add tempfile ‘+ERMANNEW’ SIZE 10M;

Drop any existing tempfile on the old diskgroup

SQL> alter database tempfile ‘+ERMAN/orcl10g/tempfile/temp.265.626631119’ drop;

6)Find out how many members we have in redolog groups, make sure that we have only one member in each log group.(drop other members).
Suppose we have 3 log groups, then add one member to each log group as following:
SQL> alter database add logfile member ‘+ERMANNEW’ to group 1;
SQL> alter database add logfile member ‘+ERMANNEW’ to group 2;;
SQL> alter database add logfile member ‘+ERMANNEW’ to group 3;
Then we can drop the old logfile member from earlier diskgroups as:
SQL> alter database drop logfile member ‘complete_name’;

7)Use the following query to verify that all the files are moved to new diskgroup with desired redundancy:

SQL> select name from v$controlfileunionselect name from v$datafileunionselect name from v$tempfileunionselect member from v$logfileunionselect filename from v$block_change_tracking;

+ERMANNEW/orcl/controlfile/backup.261.980091055
+ERMANNEW/orcl/datafile/sysaux.263.980093225
+ERMANNEW/orcl/datafile/system.262.980093223
+ERMANNEW/orcl/datafile/undotbs1.264.980093229
+ERMANNEW/orcl/datafile/users.265.980093229
+ERMANNEW/orcl/onlinelog/group_1.266.980093395
+ERMANNEW/orcl/onlinelog/group_3.268.980093417
+ERMANNEW/orcl/tempfile/temp.267.980094287

good.
8) Enable block change tracking using  ALTER DATABASE command.
SQL> alter database enable block change tracking using file ‘<FILE_NAME>’;

asm disk group changed fto erman to ermannew. have a good day.

ASM

Advertisements
Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s