Thursday, July 26, 2012

How to resize Redo Log on RAC instance with ASM option

In this post we will see how we can resize redolog files on RAC instance while we have ASM

1. First check existing status with below query:

select l.group#, l.thread#, f.member, l.archived, l.status, (bytes/1024/1024) fsize
from v$log l, v$logfile f
where f.group# = l.group#
order by 1,2;


Sampe output can be like below:

GROUP# THREAD# MEMBER                                        ARCHIVED    STATUS    MB
—— ——- ———————————             ——– ——— —
1    2    +ORADATA/test/onlinelog/group_8.882.743077403        NO        CURRENT     100
2    2    +ORADATA/test/onlinelog/group_9.610.743077405        YES       INACTIVE    100
3    1    +ORADATA/test/onlinelog/group_10.871.743077407    YES       INACTIVE    100
4    1    +ORADATA/test/onlinelog/group_11.886.743078145    YES       INACTIVE    100

2. Now our purpose is increase redosize from 100Mb to 500 Mb

3. We are going to add our new redo file by below command:

alter database add logfile group 5 ‘+ORADATA’ size 500M;    << run this command on node 2
alter database add logfile group 6 ‘+ORADATA’ size 500M;    << run this command on node 2
alter database add logfile group 7 ‘+ORADATA’ size 500M;    << run this command on node 1
alter database add logfile group 8 ‘+ORADATA’ size 500M;    << run this command on node 1

4. We run below query again

select l.group#, l.thread#, f.member,  l.archived, l.status, (bytes/1024/1024) fsize
from v$log l, v$logfile f
where f.group# = l.group#
order by 1,2;



Sample output can be like below:

GROUP# THREAD# MEMBER                                                                     ARCHIVED     STATUS        MB
—— ——- ———————————                                                     ——–             ———           —
1    2    +ORADATA/test/onlinelog/group_1.882.743077403        NO                CURRENT        100
2    2    +ORADATA/test/onlinelog/group_2.610.743077405       YES              INACTIVE       100
3    1    +ORADATA/test/onlinelog/group_3.871.743077407       YES              INACTIVE       100
4    1    +ORADATA/test/onlinelog/group_4.886.743078145        YES              INACTIVE       100
5    2    +ORADATA/test/onlinelog/group_4.1728.743078149      NO                UNUSED           500
6    2    +ORADATA/test/onlinelog/group_6.1728.743077542     NO                UNUSED           500
7    1    +ORADATA/test/onlinelog/group_7.1728.743078149     NO                  UNUSED         500
8    1    +ORADATA/test/onlinelog/group_5.1728.743077852     NO                  UNUSED        500

5. Switch until we are into log group 5,6,7,8 so we can drop log groups 1, 2,3 and 4:

SQL> alter system switch logfile;

** repeat as necessary until group 5 first is CURRENT **

6. Run the query again to verify the current log group is group 4, if its INACTIVE than you can drop related group safely

SQL> select group#, status from v$log;

7. Now drop redo log groups 1, 2, and 3:

SQL> alter database drop logfile group 1;
SQL> alter database drop logfile group 2;
SQL> alter database drop logfile group 3;
SQL> alter database drop logfile group 4;

Verify the groups were dropped, and the new groups’ sizes are correct.

select l.group#, l.thread#, f.member, l.archived, l.status, (bytes/1024/1024) fsize
from v$log l, v$logfile f
where f.group# = l.group#
order by 1,2;


Success..

Thanks,
Kaziul Islam Bulbul
Dhaka, Bangladesh.

Friday, July 20, 2012

root.sh finished with VIP, Scan failed in first node during oracle 11g RAC installation


Environment:
--------------------
Database : Oracle 11gR2 (64i bit )
OS: RHEL 5.7 (64 bit)

Problem
-------------

                   root.sh completed successfully in node 1 with VIP and listener  status failed. I can't ping node 1 vip and scan IP. Node 2 root.sh finished successfully. So unable to proceed database installation . Details log as belows,

root.sh log in 1st node of RAC.
------------------------------------------------------------------------------------------------------
add nodeapps -n roots-db01 -A roots-db01-vip/255.255.255.224/eth0 on node=roots-db01 ... failed
CRS-2672: Attempting to start 'ora.asm' on 'roots-db01'
CRS-2676: Start of 'ora.asm' on 'roots-db01' succeeded
CRS-2672: Attempting to start 'ora.CRSDATA.dg' on 'roots-db01'
CRS-2676: Start of 'ora.CRSDATA.dg' on 'roots-db01' succeeded
PRCR-1001 : Resource ora.net1.network does not exist
add scan=roots-scan ... failed
Preparing packages for installation...
cvuqdisk-1.0.7-1
Configure Oracle Grid Infrastructure for a Cluster ... failed
Updating inventory properties for clusterware
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 33823 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
---------------------------------------------------------------------------------------------------------

[grid@roots-db01 bin]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host
----------------------------------------------------------------------
ora.CRSDATA.dg ora....up.type 0/5    0/     ONLINE    ONLINE    roots-db01
ora....ER.lsnr ora....er.type 0/5    0/     ONLINE    ONLINE    roots-db02
ora.asm        ora.asm.type   0/5    0/     ONLINE    ONLINE    roots-db01
ora.eons       ora.eons.type  0/3    0/     ONLINE    ONLINE    roots-db02
ora.gsd        ora.gsd.type   0/5    0/     OFFLINE   OFFLINE
ora....network ora....rk.type 0/5    0/     ONLINE    ONLINE    roots-db02
ora.ons        ora.ons.type   0/3    0/     ONLINE    ONLINE    roots-db02
ora....ry.acfs ora....fs.type 0/5    0/     ONLINE    ONLINE    roots-db02
ora....SM1.asm application    0/5    0/0    ONLINE    ONLINE    roots-db01
ora....01.lsnr application    0/5    0/0    OFFLINE   OFFLINE
ora....b01.gsd application    0/5    0/0    OFFLINE   OFFLINE
ora....b01.ons application    0/3    0/0    OFFLINE   OFFLINE
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    roots-db02
ora....02.lsnr application    0/5    0/0    ONLINE    ONLINE    roots-db02
ora....b02.gsd application    0/5    0/0    OFFLINE   OFFLINE
ora....b02.ons application    0/3    0/0    ONLINE    ONLINE    roots-db02
ora....b02.vip ora....t1.type 0/0    0/0    ONLINE    ONLINE    roots-db02

[grid@roots-db02 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host
----------------------------------------------------------------------
ora.CRSDATA.dg ora....up.type 0/5    0/     ONLINE    ONLINE    roots-db01
ora....ER.lsnr ora....er.type 0/5    0/     ONLINE    ONLINE    roots-db02
ora.asm        ora.asm.type   0/5    0/     ONLINE    ONLINE    roots-db01
ora.eons       ora.eons.type  0/3    0/     ONLINE    ONLINE    roots-db02
ora.gsd        ora.gsd.type   0/5    0/     OFFLINE   OFFLINE
ora....network ora....rk.type 0/5    0/     ONLINE    ONLINE    roots-db02
ora.ons        ora.ons.type   0/3    0/     ONLINE    ONLINE    roots-db02
ora....ry.acfs ora....fs.type 0/5    0/     ONLINE    ONLINE    roots-db02
ora....SM1.asm application    0/5    0/0    ONLINE    ONLINE    roots-db01
ora....01.lsnr application    0/5    0/0    OFFLINE   OFFLINE
ora....b01.gsd application    0/5    0/0    OFFLINE   OFFLINE
ora....b01.ons application    0/3    0/0    OFFLINE   OFFLINE
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    roots-db02
ora....02.lsnr application    0/5    0/0    ONLINE    ONLINE    roots-db02
ora....b02.gsd application    0/5    0/0    OFFLINE   OFFLINE
ora....b02.ons application    0/3    0/0    ONLINE    ONLINE    roots-db02
ora....b02.vip ora....t1.type 0/0    0/0    ONLINE    ONLINE    roots-db02
-----------------------------------------------------------------------------------------------------------

Solution
-------------

Since only node 1 was not configured, this is what i did to resolve the issue:
Please do this as root

On node1
========
srvctl add vip -n roots-db01 -A 10.33.40.5/255.255.255.224/eth0 -k 1

srvctl add scan -n roots-scan 

srvctl add scan_listener
srvctl start vip -n roots-db01 
srvctl start scan
srvctl start scan_listener

The issue resolved for me.

Success..

Thanks,
Kaziul Islam Bulbul
Dhaka, Bangladesh