Disclaimer

These scripts come without warranty of any kind. Use them at your own risk. I assume no liability for the accuracy, correctness, completeness, or usefulness of any information provided by this site nor for any sort of damages using these scripts may cause.

Thursday, December 22, 2011

Adding Standby Redo Log and Resolving Data guard Error

ORA-16801: redo transport-related property is inconsistent with database Settings

Data Guard Setup: Primary with Two Standbys
DB Version: 10.2.0.4.0 64Bit
OS: Enterprise Linux 5.3 64Bit
Data Guard Broker: Yes
Redo Transport Mode: ASYNC

Second standby database created using rman duplicate command. Started the managed recovery process and logs are started applying. Data Guard broker enabled for this database.  While enabling & verifying the configuration for this database, I got the following error.

ORA-16801: redo transport-related property is inconsistent with database setting
ORA-16715: redo transport-related property LogXptMode of standby database "stby2" is inconsistent

Note: I tried to add Standby Redo Log (SRL) immediately after  creating standby but before starting the managed recovery, but I got the error ORA-301 signalled during: ALTER DATABASE ADD STANDBY LOGFILE GROUP  and not able to add the standby redo logs.

I performed the following steps to resolve this issue.

1.       Stop the redo apply on the standby database
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
2.       Create the Standby Redo Log on standby

a) The size of the standby redo log files must match the size of primary database online redo log files. Find the size of the primary database online redo log files. Number of Standby Redo Logs should be at least one greater than number online redo logsSQL> select bytes from v$log;
   BYTES
   ----------
  52428800
  52428800
  52428800
Here the size of my online redo log files is 50M.

b) Use the following query to find the details of the log files in the primary database.
SQL> select group#,type,member from v$logfile;
    GROUP# TYPE    MEMBER
---------- ------- --------------------------------------------------
         1 ONLINE  /u03/oradata/prod_redo01a.log
         1 ONLINE  /u03/oradata/prod_redo01b.log
         2 ONLINE  /u03/oradata/prod_redo02a.log
         2 ONLINE  /u03/oradata/prod_redo02b.log
         3 ONLINE  /u03/oradata/prod_redo03a.log
         3 ONLINE  /u03/oradata/prod_redo03b.log
         4 STANDBY /u03/oradata/prod_redo04a.log
         4 STANDBY /u03/oradata/prod_redo04b.log
         5 STANDBY /u03/oradata/prod_redo05a.log
         5 STANDBY /u03/oradata/prod_redo05b.log
         6 STANDBY /u03/oradata/prod_redo06a.log

    GROUP# TYPE    MEMBER
---------- ------- --------------------------------------------------
         6 STANDBY /u03/oradata/prod_redo06b.log
         7 STANDBY /u03/oradata/prod_redo07a.log
         7 STANDBY /u03/oradata/prod_redo07b.log

From above output you can see that I already have standby redo logs on primary.

c) Now I have created the standby redo log files in the standby database.
alter database add standby logfile group 4 ('/u03/oradata/prod_redo04a.log’, '/u03/oradata/prod_redo04b.log’) size 50M ;
alter database add standby logfile group 5 ('/u03/oradata/prod_redo05a.log’, ‘/u03/oradata/oas2/prod_redo05b.log’) size 50M;
alter database add standby logfile group 6 ('/u03/oradata/oas2/prod_redo06a.log’, ‘/u03/oradata/oas2/prod_redo06b.log’) size 50M;
alter database add standby logfile group 7 ('/u03/oradata/oas2/prod_redo07a.log’, ‘/u03/oradata/oas2/prod_redo07b.log’) size 50M;

3.       Start the log apply

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

4.     Enable second standby (SSTD)
DGMGRL> enable database stdby2;
5.       Verify the configuration
DGMGRL> show configuration;

Friday, December 2, 2011

Steps to add/increase the swap partition on Linux (Using Logical Volume).

In certain situations you may need to increase the swap space on your linux server. For example, installing new version of Oracle on an existing linux server.

Linux has two types of swap space:
1) The swap partition. The swap partition is an independent section of the hard disk used solely for swapping; no other files can exist there.

2) The swap file.  The swap file is a special file in the filesystem that exists with your other files.
Below steps are showing how to increase space swap space by adding another swap partition using logical volume.

All these steps has to be done as root user.

1. Create a logical volume
   
    Pre-req: Enough free space must be available on volume group.


 a) open logical volume manager using system-config-lvm
 b) Click on logical view
 c) Click on "Create New Logical Volum Button"
 d) Give the LV name like "swap2"
 e) Specify the size required in GBs
 f) Keep all other values unchanged and click OK to create volume
 g) Note down the new logical volume full path (ex: /dev/vgdata/swap2) from voluem properties and close the GUI.


2. Format the newly created volume with swap file system

   a) # mkswap </full/path to/new volume>
   ex: mkswap /dev/vgdata/swap2


3. Activate the new swap
     a) # swapon </full/path to/new volume>
  ex: swapon /dev/vgdata/swap2


4. Add the following line to fstab to persist swap configuration after re-boot.
   </full/path to/new volume> swap swap defaults 0 0
 ex: /dev/vgdata/swap2 swap swap defaults 0 0

5. verify the swap
  
a) free -m
 b) cat /proc/swaps