Search This Blog

Friday, 30 June 2017

Multiplexing Redo Log files in three different mount point. Each Redo Log group




Multiplexing Redo log files in three different mount point.Each Redo Log group


Multiplexing of Redolog files
............................................................................................................


Firstly we need to create a mount point where we want to store the redo logs.
mkdir /redoa
mkdir /redob
mkdir /redoc

then gven the permission and owner to the mount points;

chmod -Rf 777 /redoa
chmod -Rf 777 /redob
chmod -Rf 777 /redoc

chown -Rf oracle:oinstall /redoa
chown -Rf oracle:oinstall /redob
chown -Rf oracle:oinstall /redoc

........................connect to database..................



[oracle@ab ~]$ export ORACLE_SID=dborcl
[oracle@ab ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Mar 12 15:17:49 2015

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

Connected to an idle instance.




SQL> startup startup
SQL> startup
ORACLE instance started.

Total System Global Area  885211136 bytes
Fixed Size                  2294456 bytes
Variable Size             620760392 bytes
Database Buffers          255852544 bytes
Redo Buffers                6303744 bytes
Database mounted.
Database opened.

Multiplexing of Redolog files


.................How to see the log membere...............

SQL> column member format a40;                      
SQL> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         3         ONLINE  /redoc/dborcl/redo03.log                 NO
         0

         2         ONLINE  /redob/dborcl/redo02.log                 NO
         0

         1         ONLINE  /redoa/dborcl/redo1.log                  NO



................................................................................................


......................How to add the log members in loggroup................................

SQL> alter database add logfile member '/redoa/redoa1.log' to group 1;

Database altered.

SQL> alter database add logfile member '/redoa/redoa2.log' to group 1;

Database altered.

SQL> alter database add logfile member '/redoa/redoa3.log' to group 1;

Database altered.

SQL> alter database add logfile member '/redob/redob2.log' to group 2;

Database altered.

           
SQL> alter database add logfile member '/redob/redob1.log' to group 2;

Database altered.

SQL> alter database add logfile member '/redob/redob3.log' to group 2;

Database altered.

SQL> alter database add logfile member '/redoc/redoc1.log' to group 3;

Database altered.

SQL> alter database add logfile member '/redoc/redoc2.log' to group 3;

Database altered.

SQL> alter database add logfile member '/redoc/redoc3.log' to group 3;

Database altered.


................................................................................................


.....................................how to know the members of group........................................


SQL> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         3         ONLINE  /redoc/dborcl/redo03.log                 NO
         0

         2         ONLINE  /redob/dborcl/redo02.log                 NO
         0

         1 INVALID ONLINE  /redoa/redoa1.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         1         ONLINE  /redoa/dborcl/redo1.log                  NO
         0

         1 INVALID ONLINE  /redoa/redoa2.log                        NO
         0

         1 INVALID ONLINE  /redoa/redoa3.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         2 INVALID ONLINE  /redob/redob2.log                        NO
         0

         2 INVALID ONLINE  /redob/redob1.log                        NO
         0

         2 INVALID ONLINE  /redob/redob3.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         3 INVALID ONLINE  /redoc/redoc1.log                        NO
         0

         3 INVALID ONLINE  /redoc/redoc2.log                        NO
         0

         3 INVALID ONLINE  /redoc/redoc3.log                        NO
         0


.......................................................................................................................


.............................How to know the particulor member of the group...............................................





SQL> select * from v$logfile where group#=1;

    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         1 INVALID ONLINE  /redoa/redoa1.log                        NO
         0

         1         ONLINE  /redoa/dborcl/redo1.log                  NO
         0

         1 INVALID ONLINE  /redoa/redoa2.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         1 INVALID ONLINE  /redoa/redoa3.log                        NO
         0

........................................................................



SQL> select * from v$logfile where group#=2;

    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         2         ONLINE  /redob/dborcl/redo02.log                 NO
         0

         2 INVALID ONLINE  /redob/redob2.log                        NO
         0

         2 INVALID ONLINE  /redob/redob1.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         2 INVALID ONLINE  /redob/redob3.log                        NO



SQL>  select * from v$logfile where group#=3;

    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         3         ONLINE  /redoc/dborcl/redo03.log                 NO
         0

         3 INVALID ONLINE  /redoc/redoc1.log                        NO
         0

         3 INVALID ONLINE  /redoc/redoc2.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         3 INVALID ONLINE  /redoc/redoc3.log



..........................................................................................



..............................shut down the database....................................

SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


.............................................................................................

How to renaming the redofiles

............................................................................................


....1...copy redolog file to where we want. in os lavel

[oracle@ab ~]$ cp /redoa/redoa2.log /redob/redoa2.log
[oracle@ab ~]$ cp /redoa/redoa3.log /redoc/redoa3.log
[oracle@ab ~]$ cp /redob/redob2.log /redoa/redob2.log
[oracle@ab ~]$ cp /redob/redob3.log /redoc/redob3.log
[oracle@ab ~]$ cp /redoc/redoc3.log /redoa/redoc3.log
[oracle@ab ~]$ cp /redoc/redoc2.log /redob/redoc2.log
[oracle@ab ~]$ ^C

...2......startup the database in mount....................


[oracle@ab ~]$ export ORACLE_SID=dborcl
[oracle@ab ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Mar 12 15:17:49 2015

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

Connected to an idle instance.




SQL> startup mount
ORACLE instance started.

Total System Global Area  885211136 bytes
Fixed Size                  2294456 bytes
Variable Size             620760392 bytes
Database Buffers          255852544 bytes
Redo Buffers                6303744 bytes
Database mounted.

....3..........renaming the redo logfile


SQL> alter database rename file'/redoa/redoa3.log' to '/redoc/redoa3.log';

Database altered.

SQL> alter database rename file'/redoa/redoa2.log' to '/redob/redoa2.log';

Database altered.

SQL> alter database rename file '/redob/redob2.log' to '/redoa/redob2.log';

Database altered.

SQL> alter database rename file '/redob/redob3.log' to '/redoc/redob3.log';

Database altered.

SQL> alter database rename file '/redoc/redoc3.log' to '/redoa/redoc3.log';

Database altered.

SQL> alter database rename file '/redoc/redoc2.log' to '/redob/redoc2.log';

Database altered.
......4........................open the database...................................

SQL> alter database open
  2  ;

Database altered.

.........................................................................................




............now fire some commands................


*newely aadded logfile status are invalid




SQL> column member format a40;
SQL> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         3         ONLINE  /redoc/dborcl/redo03.log                 NO
         0

         2         ONLINE  /redob/dborcl/redo02.log                 NO
         0

         1 INVALID ONLINE  /redoa/redoa1.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         1         ONLINE  /redoa/dborcl/redo1.log                  NO
         0

         1 INVALID ONLINE  /redob/redoa2.log                        NO
         0

         1 INVALID ONLINE  /redoc/redoa3.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         2 INVALID ONLINE  /redoa/redob2.log                        NO
         0

         2 INVALID ONLINE  /redob/redob1.log                        NO
         0

         2 INVALID ONLINE  /redoc/redob3.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         3 INVALID ONLINE  /redoc/redoc1.log                        NO
         0

         3 INVALID ONLINE  /redob/redoc2.log                        NO
         0

         3 INVALID ONLINE  /redoa/redoc3.log                        NO






.................................................................................................................
.................to online the newely added file fire switch log.......


SQL>alter system switch logfile


System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.


...............................now all added new files status are online................................................

SQL> column member format a40;
SQL> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         3         ONLINE  /redoc/dborcl/redo03.log                 NO
         0

         2         ONLINE  /redob/dborcl/redo02.log                 NO
         0

         1         ONLINE  /redoa/redoa1.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         1         ONLINE  /redoa/dborcl/redo1.log                  NO
         0

         1         ONLINE  /redob/redoa2.log                        NO
         0

         1         ONLINE  /redoc/redoa3.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         2         ONLINE  /redoa/redob2.log                        NO
         0

         2         ONLINE  /redob/redob1.log                        NO
         0

         2         ONLINE  /redoc/redob3.log                        NO
         0


    GROUP# STATUS  TYPE    MEMBER                                   IS_
---------- ------- ------- ---------------------------------------- ---
    CON_ID
----------
         3         ONLINE  /redoc/redoc1.log                        NO
         0

         3         ONLINE  /redob/redoc2.log                        NO
         0

         3         ONLINE  /redoa/redoc3.log                        NO
         0


12 rows selected.


...................................................................................................................

No comments:

Post a Comment