Translate

Tuesday, January 14, 2014

Oracle Data guard in Oracle Standard Edition license product.

An important documentation on Oracle data sync on Standard edition.

Oracle Data guard in Oracle Standard Edition license.
Prepared by: Tapas Kumar Karmakar & Suman Das.
Designation: Oracle DBA.
Base Version: Ora_SE_DG_V01.d
Applied to: Oracle Server - Standard Edition - Version 8.1.5.0 and later
Metalink ID: 333749.1

This document is prepared with the guidance taken from Oracle Metalink ID: 333749.1 and Suman Das (Oracle DBA @ Nelito Syatem) . As per this Metalink ID, when any organization took “Oracle license for Standard edition” for using Production with DR (Disaster Recovery) setup, No one can use the keyword “STANDBY” in DR setup, this keyword is subject to license violation.

So in order to overcome this license violation we can follow the following steps, for creating DR database with archive log apply from primary database.

Steps to be followed.
Note:  (Assuming DR setup is ready with same replica of datafile, redolog file as of primary set up)

        1)        Create a backup control file from Primary.
           SQL> alter database backup controlfile to '<name>.ctl';
        2)        Transfer the backup controlfile from DC to DR, and keep it in same location as it in pfile location on DR database.
        3)        Start the DR database.
a)        Create spfile from pfile=’……..’;
b)        Startup nomount
c)        Alter database mount;
        4)        Transfer the archive log created in DC to DR.
        5)        Apply the archive log to DR using command.
           SQL> recover database using backup controlfile until cancel;

              After all the set up has been done, some important note needs to be kept in mind.

        1)        Add tempfiles to temp tablespace.
This is because recovery using backup controlfile command automatically removed tempfile records from controlfile
            SQL> alter tablespace temp add tempfile '<name>' size..
This is because recovery using backup controlfile command automatically removed tempfile records from controlfile
        2)        If you create a new tablespace in primary you may get the following errors while applying the corresponding logs in DR server.
            ORA-00283: recovery session canceled due to errors
            ORA-01244: unnamed datafile(s) added to controlfile by media recovery
            ORA-01110: data file 7: 'D:\oradatd\DR\tes1.dbf'



         3)        At this stage you need to run a command like this to create an empty datafile in standby.
a)        SQL>select name from v$datafile where name like '%UNNAMED%';
Output will come with “UNNAMED00007” where 7 represent datafile number.
                b)     SQL> alter database create datafile 'D:\ app\oracle\OraHome1\UNNAMED00007'
                              as ' D:\oradatd\DR\test01.dbf'; Where “D:\oradatd\DR\” is location for datafiles in standby.
Now you can restart the recovery process.


If anybody wants to open the DR database for reporting purpose then steps to be followed.

1)     Stop recover of database if pending.
      Sql> Alter database recover cancel;
           Sql> Alter database open read only;
2)     Alter reporting purpose works gets completed.
           Sql> Shu immediate;
           Sql> Startup nomount;
           Transfer archive logs from DC to DR.
           Sql> recover database using backup controlfile until cancel;


Transfer the archive log files from DC to DR.
COMMAND

  xcopy F$\TEST\ARC \\DR_IP\F$\TEST\ARC  /E /D /C /Y
  OR
  robocopy F$\TEST\ARC \\DR_IP\F$\TEST\ARC  /MIR /MON:1 /R:2000 /LOG+:file_name.txt

For checking archive log applied.
Sql> select max(fhrba_Seq) from x$kcvfh;


Conclusion.

Tested in training environment, passed all the statement without any error.
Required Oracle SE 8.1.5.0 and Later, windows xcopy or robocopy utility of OS. So before configuring the DR setup in SE edition everybody must follow this in order to follow Oracle license policy for DR setup created with oracle standard edition.



Regards.
Tapas Kumar Karmakar.
Oracle DBA.