Saturday, March 8, 2014

How to bring a Standby DB in Sync with Promary DB , if the Stand By DB was in Out of Sync

If found Standby DB(DR Server) is not in sync with Primary Database ,Follow the below steps to make it in sync with Primary DB.

1.Check the Status of log sequence with below query

SQL>select sequence#, status, process from v$managed_standby;

SEQUENCE#     STATUS       PROCESS
----------             ------------          ---------
    137675        CLOSING               ARCH
    137673        CLOSING               ARCH
    137674        CLOSING               ARCH
         0        CONNECTED             ARCH
         0                  IDLE                  RFS
    137676             IDLE                  RFS
         0                  IDLE                  RFS
    137576 WAIT_FOR_LOG        MRP0
         0                  IDLE                   RFS
2.Check the archive gap.(v$archive_gap only shows the log sequences of the next gap that needs to be resolved)

        SQL>SELECT * FROM V$ARCHIVE_GAP;

To find out how far behind your standby is (in days), try this query on the standby:

3.SQL> select name,sequence#,archived,applied from v$archived_log order by sequence#;

  
If the Gap is more like in the above example Standby DB showing 100 Archive gap with Primary DB and status is  showing "WAIT_FOR_LOG"
   

4)Check first if the archive log file which is showing "WAIT_FOR_LOG" is available in /Oracle/SID/Oraarach or not.

5)if not available try to copy mannually from primary or restore from tape
        brrestore -a 136541 -c -d util_file -r /oracle/SID/112_64/dbs/initSID.utl

 6)Once the archive log available in "oraarch" directory register the log file in Standby DB using below command:

 SQL>ALTER DATABASE REGISTER LOGFILE '/oracle/SID/oraarch/SIDarch1_136541_701090413.dbf';

  7)Then check the status again

        SQL>select sequence#, status, process from v$managed_standby;

SEQUENCE#     STATUS       PROCESS
----------             ------------          ---------
    137675        CLOSING               ARCH
    137673        CLOSING               ARCH
    137674        CLOSING               ARCH
         0        CONNECTED             ARCH
         0                  IDLE                  RFS
    137676             IDLE                  RFS
         0                  IDLE                  RFS
    137576  APPLYING LOG       MRP0
         0                  IDLE                   RFS

If the status changed to "APPLING LOG " Then the issue resolved .Now rest of the logs will applied automatically if not applying automatically then follow the above steps.

 8)Check the applied logs status

        SQL>select name,sequence#,archived,applied from v$archived_log order by sequence#;

It should show the status as applied.

 SEQUENCE# ARC APPLIED
----------            ---     ---------
/oracle/SID/oraarch/SIDarch1_137575_701090413.dbf
    137575 YES YES



ORA-01274: cannot add datafile '/oracle/SID/sapdata2/dat_19/dat.data19' - file could not be created Recovery interrupted!


If the Parameter STANDBY_FILE_MANAGEMENT is set to MANUAL , we will get below error in Standby Databae (DR) while adding a datafile in Primary Database.
And this will bring the DR out of sync.


" ORA-01274: cannot add datafile '/oracle/SID/sapdata2/dat_19/dat.data19' - file could not be created
Recovery interrupted!"

Solution :

On standby(DR) database:

SQL> select name from v$datafile where name like '%UNNAMED00039%';
NAME
--------------------------------------------------------------------------------
/oracle/SID/112_64/dbs/UNNAMED00039

On production database:
SQL> select name from v$datafile where file# = 39;
NAME
--------------------------------------------------------------------------------
/oracle/SID/sapdata2/dat_19/dat.data19

And finally on standby database alter the database using below command:
SQL> alter database create datafile '/oracle/SID/112_64/dbs/UNNAMED00039' as '/oracle/SID/sapdata2/dat_19/dat.data19';

Recomendation :: Permanently set

 STANDBY_FILE_MANAGEMENT to AUTO in Standby Database.












Oracle Data Guard (ODG) Management During Outage in SAP Production Server & DR Server

 Oracle Data Guard (ODG) Management During Outage in SAP Production Server & DR Server

----------------------------------------------------------------------------     
                Before Outage :
----------------------------------------------------------------------------

In Production
=============
1) SQL>alter system set log_archive_dest_state_2 = 'defer';

In DR
=====
2) SQL> alter database recover managed standby database cancel;
   SQL> shutdown immediate;

---------------------------------------------------------------------------
            After Outage :
---------------------------------------------------------------------------

In Production
=============

1) SQL> alter system set log_archive_dest_state_2 = 'enable';

In DR
====
2) SQL> startup nomount;
   SQL> alter database mount standby database;
   SQL> alter database recover managed standby database disconnect from session;

In Production
=============

3) SQL> select status, error from v$archive_dest where dest_id=2;

The value should be "Valid". It will take some time to show the value as "Valid".
------------------------------------------------------------------------------
            DR Sync Checking
-----------------------------------------------------------------------------
In DR
====
To check the DR Sync :

SQL> set linesize 80;
SQL> column name format a60;
SQL> select name,sequence#,archived,applied from v$archived_log order by sequence#;

SQL> select process,status from v$managed_standby;

SQL> select message from v$dataguard_status;

Sunday, November 27, 2011

[INS-30060] Check for group existence failed in Oracle 11g(Solaris)


[INS-30060] Check for group existence failed.
Solution:
OS> ls -la /var/tmp/CVU* (Solaris)
Solaris:
OS> chown -R <user>:<group> /var/tmp/CVU_11.2.0.*
or
OS> rm -rf /var/tmp/CVU_11.2.0.*

Wednesday, September 21, 2011

The tp buffer contains old, not completely processed OCS Packages

   Import phase 'CHECK_REQUIREMENTS' (21.09.2011, 10:08:11)
   The tp buffer contains old, not completely processed OCS Packages
   Interrupt the import due to an error situation (21.09.2011, 10:08:12)
   Display detailed informations concerning the error in phase 'CHECK_REQUIREMENTS'
   Abort the import due to an error situation (21.09.2011, 10:08:19)

Solution:
If you execute
tp showbuffer <sid> pf=<path to transport profile> tag=SPAM
You can either delete these from the buffer if they are old packages that have been imported previously or if the buffer does not contain transports that you need, you could simply reset the current spam queue so it is empty.

Then rename the actual buffer file to OLD_<buffer file name> and create a new buffer in usr/sap/trans/buffer

Go to /usr/sap/trans/buffer
 take backup of buffer (e.g <SID> DEV)
# touch DEV

How to check Oracle trace log in SAP

Go to below path


/oracle/<SID>/saptrace/diag/rdbms/<SID in Small letter>/<SID>/trace/alert_<SID>.log

Monday, September 19, 2011

FCO-00011 The step createOcl10Links with step key |NW_ABAP_DB|ind|ind|ind|ind|0|0|NW_CreateDBan

 ERROR      2011-09-20 07:26:08.555 [iaxxejsbas.cpp:211]
FJS-00003  TypeError: linkTarget has no properties (in script NW_ABAP_DB|ind|ind|ind|ind, line 8229: ???)
FCO-00011  The step createOcl10Links with step key |NW_ABAP_DB|ind|ind|ind|ind|0|0|NW_CreateDBan
 ============================================================================
 Solution:-

If you are using oracle 11g RDBMS DVD and Client as 10g we might face error in "Install Oracle client software" phase ,so made a soft link as below mentioned.

cd  /oracle/client/11x_64

ln -s instantclient_11202 instantclient_10204