Tuesday, 22 March 2016

Multiplex of redolog files in ASM

If you have two diskgroup, you want to multiplex redo in different diskgroup, you just add redo log desitnation diskgroup.

Step 1 :
Check the Current Disk of REDOLOGS. (In my case , its  ‘+DATA’)

So , Now I will move it to another DiskGroup (i,e, NEWDATA)


SQL> select l.group# , l.bytes , l.status , lf.member from v$logfile lf , v$log l where lf.group# = l.group#;

    GROUP#         BYTES STATUS
---------- ---------- ----------------
MEMBER
--------------------------------------------------------------------------------
                 3   52428800 INACTIVE
+DATA/myasm/onlinelog/group_3.312.907086019

                 3   52428800 INACTIVE
+DATA/myasm/onlinelog/group_3.313.907086039

                 2   52428800 CURRENT
+DATA/myasm/onlinelog/group_2.310.907085987


    GROUP#         BYTES STATUS
---------- ---------- ----------------
MEMBER
--------------------------------------------------------------------------------
                 2   52428800 CURRENT
+DATA/myasm/onlinelog/group_2.311.907086001

                 1   52428800 INACTIVE
+DATA/myasm/onlinelog/group_1.308.907085955

                 1   52428800 INACTIVE
+DATA/myasm/onlinelog/group_1.309.907085973

6 rows selected.



Step 2:
Edit the 2 Parameter as bellow  , create pfile &  Bounce the Database

SQL> alter system set db_create_online_log_dest_1='+NEWDATA' scope=spfile;
System altered.

SQL> alter system set db_create_online_log_dest_2='+NEWDATA' scope=spfile;
System altered.

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

SQL> shut immediate
Database closed.


SQL> show parameter db_create_online_log_dest;

NAME                                                        TYPE               VALUE
------------------------------------ ----------- ------------------------------
db_create_online_log_dest_1          string               +NEWDATA
db_create_online_log_dest_2          string               +NEWDATA
db_create_online_log_dest_3          string
db_create_online_log_dest_4          string
db_create_online_log_dest_5          string

Step 3 :
Drop and Re-Create Redolog as Follows

SQL> alter database drop logfile group 3;
Database altered.

SQL> alter database add logfile group 3 size 50m;
Database altered.


SQL> alter database drop logfile group 2;
alter database drop logfile group 2
*
ERROR at line 1:
ORA-01624: log 2 needed for crash recovery of instance myasm (thread 1)
ORA-00312: online log 2 thread 1: '+DATA/myasm/onlinelog/group_2.310.907085987'
ORA-00312: online log 2 thread 1: '+DATA/myasm/onlinelog/group_2.311.907086001'


SQL> alter system switch logfile;
System altered.

SQL> alter database drop logfile group 2;
Database altered.

SQL> alter database add logfile group 2 size 50m;
Database altered.


SQL> alter database drop logfile group 1;
Database altered.

SQL> alter database add logfile group 1 size 50m;
Database altered.


Step 4 :
Check the view again, see. .  Disk  is now changed (+NEWDATA)

SQL> select l.group# , l.bytes , l.status , lf.member from v$logfile lf , v$log l where lf.group# = l.group#;

    GROUP#         BYTES STATUS
---------- ---------- ----------------
MEMBER
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                 3   52428800 INACTIVE
+NEWDATA/myasm/onlinelog/group_3.258.907115921

                 3   52428800 INACTIVE
+NEWDATA/myasm/onlinelog/group_3.259.907115933

                 2   52428800 UNUSED
+NEWDATA/myasm/onlinelog/group_2.262.907116331


    GROUP#         BYTES STATUS
---------- ---------- ----------------
MEMBER
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                 2   52428800 UNUSED
+NEWDATA/myasm/onlinelog/group_2.263.907116339

                 1   52428800 CURRENT
+NEWDATA/myasm/onlinelog/group_1.260.907116199

                 1   52428800 CURRENT
+NEWDATA/myasm/onlinelog/group_1.261.907116207


6 rows selected.


SQL>


No comments:

Post a Comment