This discussion is archived
1 2 Previous Next 15 Replies Latest reply: Oct 31, 2012 3:04 AM by UweHesse RSS

LGWR , ARCH , LNS resposiblities in dataguard

955912 Explorer
Currently Being Moderated
Hi to all;

I have some doubt regarding redo transports between primary and standy.

1. LNS writes redo data to standyby ( i am ok with that) , redo data taken from exactly where? ( RLBC , Archived Destination)

LGWR , ARCH , LNS

2. I want to know above three process what they do exactly to send redo from primary to standby ?

Regards
Thiyagusham
  • 1. Re: LGWR , ARCH , LNS resposiblities in dataguard
    Shivananda Rao Guru
    Currently Being Moderated
    Hi,

    Welcome to OTN !!

    Please refer this http://www.datadisk.co.uk/html_docs/oracle_dg/architecture.htm

    Please consider closing your questions by providing appropriate points if you feel that they have been answered.
  • 2. Re: LGWR , ARCH , LNS resposiblities in dataguard
    mseberg Guru
    Currently Being Moderated
    Thiyagusham;

    Your best bet would be to review Data Guard Architecture.

    There's a short note here that should answer all your questions :

    http://neeraj-dba.blogspot.com/2011/10/data-guard-architecture-oracle-11g-part.html

    and here :

    http://www.datadisk.co.uk/html_docs/oracle_dg/architecture.htm

    Best Regards

    mseberg
  • 3. Re: LGWR , ARCH , LNS resposiblities in dataguard
    955912 Explorer
    Currently Being Moderated
    @ Shivananda Rao , @ mseberg

    I have some more doubts please clear it ...

    As per given link i got ,
    Log Network Server (LNS) is reading from the redo buffer in the SGA and passes redo to Oracle Net Services from transmission to a standby database.

    I google some link says ,

    Sample settings for LGWR and ARCH in init.ora file:

    LOG_ARCHIVE_DEST_3=’SERVICE=appsstdby1 LGWR’
    LOG_ARCHIVE_DEST_4=’SERVICE=appsdtby2 ARCH’

    For a no-data-loss environment, the LGWR should be used to transfer redo to the standby site even though
    the default process for the log transfer service is ARCH.

    It is possible to switch between ARCH and LGWR for the log transfer service using the ALTER SYSTEM statement.
    The change will not take effect until a log switch occurs on the primary database.

    My ques is <please explain clearly>

    1.ARCH , LGWR , NLS all three sends redo from primary to standby ?
    2. Only LNS sends redo from primary to standby ?

    Regards
    Thiyagusham.G

    Edited by: 952909 on Oct 29, 2012 7:12 AM

    Edited by: 952909 on Oct 29, 2012 7:13 AM
  • 4. Re: LGWR , ARCH , LNS resposiblities in dataguard
    Shivananda Rao Guru
    Currently Being Moderated
    952909 wrote:
    @ Shivananda Rao

    I have some more doubts please clear it ...

    As per given link i got ,
    Log Network Server (LNS) is reading from the redo buffer in the SGA and passes redo to Oracle Net Services from transmission to a standby database.

    I google some link says ,

    Sample settings for LGWR and ARCH in init.ora file:

    LOG_ARCHIVE_DEST_3=’SERVICE=appsstdby1 LGWR’
    LOG_ARCHIVE_DEST_4=’SERVICE=appsdtby2 ARCH’
    For a no-data-loss environment, the LGWR should be used to transfer redo to the standby site even though
    the default process for the log transfer service is ARCH.

    It is possible to switch between ARCH and LGWR for the log transfer service using the ALTER SYSTEM statement.
    The change will not take effect until a log switch occurs on the primary database.

    My ques is <please explain clearly>

    1.ARCH , LGWR , NLS all three sends redo from primary to standby ?
    2. Only LNS sends redo from primary to standby ?

    Regards
    Thiyagusham.G
    LNS sends redo information from the primary to standby databases. The mode of information passed on depends on the type of apply that you are using in the parameter "log_archive_dest_n" where n stands for the destination number that is pointing to the standby database service on the primary database initialization parameter file. If you are using Real Time apply, then you would be using the term LGWR in the above mentioned parameter and remember that you require Standby Redo Logs created for the real time to be used.
    My ques is <please explain clearly>
    I hope the link presented in the earlier posts explain more precisely :)
  • 5. Re: LGWR , ARCH , LNS resposiblities in dataguard
    955912 Explorer
    Currently Being Moderated
    @ Shivananda Rao ,

    Thanks for all replies. we have big argue on this(in my project ) ..so i need good clarity.
    Kindly understand my question. Given link not answed to my specific question.

    If i set like this in primary 'init.ora'

    LOG_ARCHIVE_DEST_2=’SERVICE=testdb ’
    by default is ARCH.

    >> My QUESTION IS THIS ONLY >>


    At what situvation
    1. when lgwr involves to send redo to standby ?
    2. when arch involves to send redo to standby ?
    or
    3. won't they send any redo to standby except LNS ?

    Regards
    Thiyagusham.G

    Edited by: 952909 on Oct 29, 2012 9:02 AM
  • 6. Re: LGWR , ARCH , LNS resposiblities in dataguard
    teits Pro
    Currently Being Moderated
    952909 wrote:
    @ Shivananda Rao ,

    Thanks for all replies. we have big argue on this(in my project ) ..so i need good clarity.
    Kindly understand my question. Given link not answed to my specific question.

    If i set like this in primary 'init.ora'

    LOG_ARCHIVE_DEST_2=’SERVICE=testdb ’
    by default is ARCH.
    My QUESTION IS THIS ONLY >>
    At what situvation
    1. when lgwr involves to send redo to standby ?
    2. when arch involves to send redo to standby ?
    or
    3. won't they send any redo to standby except LNS ?
    1. lgwr will not sent redo to standby
    2. e.g when there is redo log archived in primary and redo data not yet in standby. you will see an entry like this in your alertlog: +FAL[server, ARC3]: Begin FAL archive (dbid 0 branch 766776473 thread 1 sequence 796 dest stby2)+
    also if you enable trace of arch(og_archive_trace) to 128...you will see +FAL[server, ARC0]: Complete FAL archive (dbid 0 branch 766776473 thread 1 sequence 789 destination stby2)+
    3. answer in 2 above

    Note that deprecated attributes on the LOG_ARCHIVE_DEST_n init. parameter include ARCH,LGWR...etc for 11g

    read: http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2-dataguardnetworkbestpr-134557.pdf

    side-note: it will be good if you acknowledged the posts that has help you!!!

    Tobi

    Edited by: teits on Oct 29, 2012 5:41 PM
  • 7. Re: LGWR , ARCH , LNS resposiblities in dataguard
    955912 Explorer
    Currently Being Moderated
    Hello TEITS

    It helped me. still i want to clear from rao explanation ...

    LOG_ARCHIVE_DEST_3=’SERVICE=appsstdby1 LGWR’

    * The mode of information passed on depends on the type of apply that you are using in the parameter*
    Type of apply => not understand ...
    what it indicates here >>
    LOG_ARCHIVE_DEST_3=’SERVICE=appsstdby1 LGWR’
    LOG_ARCHIVE_DEST_4=’SERVICE=appsdtby2 ARCH’

    To trace :-

    SQL>select thread#,sequence#,registrar,dest_id from v$archived_log where dest_id=3;

    It is possible to switch between ARCH and LGWR for the log transfer service using the ALTER SYSTEM statement.


    Thnaks and regards
    Thiyagusham. G
  • 8. Re: LGWR , ARCH , LNS resposiblities in dataguard
    teits Pro
    Currently Being Moderated
    To trace :-

    SQL>select thread#,sequence#,registrar,dest_id from v$archived_log where dest_id=3;
    to trace :
    alter system set log_archive_trace=128;
    you can now check the log/trace files created for each a ARC process in your diagnostic_dest directory path
    It is possible to switch between ARCH and LGWR for the log transfer service using the ALTER SYSTEM statement.
    YES
    for example...
    alter system set log_archive_dest_3 = 'service=orcldg arch  valid_for=(all_logfiles,primary_role) db_unique_name=orcldg' ;
    noexpedite archive mode.
    alter system set log_archive_dest_3 = 'service=orcldg lgwr  valid_for=(all_logfiles,primary_role) db_unique_name=orcldg' ;
    current logfiles and others logfiles will be used.


    Tobi
    HTH

    Edited by: teits on Nov 3, 2012 3:44 AM
  • 9. Re: LGWR , ARCH , LNS resposiblities in dataguard
    VinodDhandapani Newbie
    Currently Being Moderated
    LGWR - Writes the redo data from redo buffer to Online redo log. If the redo transport to standby server is SYNC then it signals the LNS to send the redo data to the standby server and waits for the acknowledgement from LNS that the data is sent. The data is transmitted to the Standby server by the LNS through ftp mechanism. The RFS process in the standby server receives the redo data. Then LNS sends acknowledgement back to the LGWR in the primary server. The primary server then issues Commit Complete.

    If the redo transport to standby server is ASYNC then the redo is transmitted to the standby server from the Archived Redo log instead of Online redo log. Again the redo data is transmitted by the LNS.

    Regarding your question,

    LGWR and ARCH will never send data to standby redo server they only signal LNS to send the redo data. Transmitting the redo data from one server to another is done by some mechanism like FTP which both LGWR and ARCH cannot handle.


    Hope this Helps.
  • 10. Re: LGWR , ARCH , LNS resposiblities in dataguard
    UweHesse Expert
    Currently Being Moderated
    LGWR will never write Redo to the Standby RFS. Instead - under normal circumstances - LNS does (both with SYNC and ASYNC)
    LNS reads out of the LogBuffer or out of Online Logfiles

    Sometimes, when the communication between Primary & Standby was interrupted (Standby down for a while, e.g.),
    ARCH will send Archive Logs to the Standby RFS to resolve Archive Log Gaps. Again, that may happen with both SYNC and ASYNC

    Kind regards
    Uwe Hesse

    "Don't believe it, test it!"
    http://uhesse.com
  • 11. Re: LGWR , ARCH , LNS resposiblities in dataguard
    teits Pro
    Currently Being Moderated
    Vinod Dhandapani wrote:
    LGWR and ARCH will never send data to standby redo server they only signal LNS to send the redo data. Transmitting the redo data from one server to another is done by some mechanism like FTP which both LGWR and ARCH cannot handle.
    above statement is MISLEADING!!!...ARCH do send redo data

    test it:
    ON standby sql terminal
    STANDBY_SQL>select process,pid,client_pid  from v$managed_standby where process='RFS';
    
    PROCESS       PID CLIENT_PID
    --------- ---------- ----------------------------------------
    RFS            11397 10648
    RFS            10411 10658
    
    on primary database terminal
    PRIMARY_SQL>exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@red1 ~]$ ps -ef|egrep '10648|10658'
    oracle   10648     1  0 12:10 ?        00:00:00 ora_arc1_orcl
    oracle   10658     1  0 12:10 ?        00:00:00 ora_nsa3_orcl
    oracle   12251 10015  0 12:49 pts/1    00:00:00 egrep 10648|10658
    ora_arc1_orcl is arch process connected directly to RFS on the standby....waiting to resolve Archive Log Gaps in either ASYNC or SYNC.
    Also in my previous post in this thread...ARC trace/log files shows arc process sending redo.

    you can also use linux cmd strace to trace NSAa,NSSa,ARCn processes on the primary and RFS process on the standby. (simulating archive log gaps OR service=orcldg arch)

    Thiyagusham, mark the thread as answered if you think your question has been answered.

    Tobi
  • 12. Re: LGWR , ARCH , LNS resposiblities in dataguard
    VinodDhandapani Newbie
    Currently Being Moderated
    Both LGWR and ARCH attributes have been deprecated. The redo shipment is done only by LNS process from Oracle 11g.
    I forgot to mention the version in my previous post..

    Thanks
    Vinod D
  • 13. Re: LGWR , ARCH , LNS resposiblities in dataguard
    teits Pro
    Currently Being Moderated
    Vinod Dhandapani wrote:
    Both LGWR and ARCH attributes have been deprecated. The redo shipment is done only by LNS process from Oracle 11g.
    that i have mention before "Note that deprecated attributes on the LOG_ARCHIVE_DEST_n init. parameter include ARCH,LGWR...etc for 11g"

    i just did a simple test for you on 11g DB. why dont you try it too? instead of insisting on a wrong idea.
    ARCH and LNS both send redo. read my posts on the thread and check the links.

    "Don't believe it, test it! and don't mislead!"

    1.alter system set log_archive_dest_3 = 'service=orcldg arch valid_for=(all_logfiles,primary_role) db_unique_name=orcldg' scope=memory --on primary db
    2.alter system set log_archive_trace= 1152 scope=memory --on primary db
    3.alter system switch logfile -- execute this several times(10 times) to have archived logfiles --on primary db
    4.select process,pid,client_pid from v$managed_standby where process='RFS'; find the client pid process in the primary DB. if client pid are 10658 and 10648.  on standby db
    $ps -ef|egrep '10658|10648' #on primary db
    5. cd $TRACE_LOG_DIAG files location: #on primary db
    tail -1000f orcl_arc1_10648.trc
    tail -1000f orcl_nsv1_10634.trc
    6. alter system switch logfile -- execute this several times(10 times) to have archived logfiles --on primary db
    7.continue to observe the 5
    8.what is your conclusion? <hence proof that ARC send redo>


    Tobi
  • 14. Re: LGWR , ARCH , LNS resposiblities in dataguard
    VinodDhandapani Newbie
    Currently Being Moderated
    From oracle 10g documentation,

    The description for, Log_arch_dest_n attributes LGWR and ARCH is as follows,

    "+Specifies whether redo transport services use archiver processes (ARCn) or the log writer process (LGWR) to collect transaction redo data and transmit it to standby destinations. If neither the ARCH or LGWR attributes are specified, the default is ARCH.+"

    In 11g, these attributes were deprecated, so where is the question of Lgwr and Arch sending the data to standby destination.

    The following explanation was taken from the book Oracle Database 11g Release 2 High Availability from oracle press. In page number 306,

    "*NOTE*: +If you are familiar with log transport attributes available prior to Oracle 11g, you will notice that we are not covering the ARC or LGWR attributes. These attributes were deprecated in favor of always using the more efficient LNS process to perform redo shipment.+"

    ASYNC (Default) and SYNC Attributes

    "+When the default mode of *ASYNC* is used, the log network server (LNS) process does not wait for each network I/O to complete before proceeding to minimize the overhead of Oracle Data Guard on the primary database. To ensure minimal overhead of Oracle Data Guard when operating in ASYNC mode, LNS will always attempt to read redo from the log buffer to avoid disk I/O; should the log buffer have been flushed, LNS will then read from online redo and subsequently archived redo. Obviously, in this case it is more efficient for LNS to read from the log buffer (instead of performing physical I/O), so we should ensure that LNS is reading from the log buffer as often as possible. To check how often LNS is reading from the log buffer, we can query *x$logbuf_readhist*.+

    +The SYNC attribute specifies that network I/O is to be performed synchronously for the destination, which means that once the I/O is initiated, the archiving process waits for the I/O to complete before continuing. That being said, a transaction is not committed on the primary database until the redo data necessary to recover that transaction is received by all destinations in which the SYNC attribute has been specified. With Oracle Database 11g Release 2, the local write and remote write(s) will occur at the same time to minimize the performance impact of SYNC on the+
    +primary database. The SYNC attribute is not available with log_archive_dest_11 through log_archive_dest_31.+".


    So my understanding is that we will be specifying either ASYNC or SYNC in the log_arch_dest_n parameter. In both the cases the LNS will be doing the redo shipment.

    My intention is to help the person who asked the question by sharing my knowledge not to mislead anyone. If I am wrong then I will be more happy because I will learn something new.

    Thanks
    Vinod D
1 2 Previous Next