Who writes LOG SEQUENCE NUMBER to CONTROL FILE,whether CKPT or LGWR process

I am in confusion that,
When log switch occurs that time Log sequence no. is generated by LGWR. then after who writes that LSN to CONTROL FILE whether Checkpoint or LGWR.
Please provide me proper answer with example.....

I notice by using fuser on a controlfile on hp-ux, a number of processes keep the controlfile open.  So it would make sense that the one that writes logs would write log sequence numbers to the controlfile too.
$ for z in  `/usr/sbin/fuser  control03.ctl|awk ' {x=split($0,args); for (i=2;i<=x;i++){print args[i]}}'`
        do
            ps -efx|grep $z|grep -v grep
        done
control03.ctl: oooooooooo
  oracle 27129     1  0  Sep  5  ?        12:15 ora_arc1_TPRD
  oracle 27073     1  0  Sep  5  ?        52:45 ora_dbw0_TPRD
  oracle 27127     1  0  Sep  5  ?        10:52 ora_arc0_TPRD
  oracle  9485     1  0  Nov  3  ?         9:14 oracleTPRD (LOCAL=NO)
  oracle 22395     1  0 08:36:22 ?         0:24 oracleTPRD (LOCAL=NO)
  oracle 27075     1  0  Sep  5  ?        68:53 ora_lgwr_TPRD
  oracle 22116     1  0 08:33:24 ?         1:06 oracleTPRD (LOCAL=NO)
  oracle 27077     1  0  Sep  5  ?        41:05 ora_ckpt_TPRD
  oracle 26510     1  0  Nov 30  ?        21:26 oracleTPRD (LOCAL=NO)

Similar Messages

  • Log sequence number

    who updates the log sequence number in control file and datafiles , I know chkpoint is responsible to update checkpoint number in datafile and control file number.

    it is LGWR.

  • Doubt about CURRENT LOG SEQUENCE NUMBER

    I just want to know that why the "current log sequence number" is added to the header of each data file ? why oracle needs to do that ? as it is also added to the control file and whenever it needs to know the current log sequence number , it can get it from control file , then why to add this in the header of data files ?

    For Recovery.
    When you are doing a Recovery of a database where the datafiles have been restored from backups but the controlfile has been recreated (thus, the controlfile has no information about log sequence numbers and checkpoint scns), the Recovery must read this information from the datafile headers.
    Say you have 5 datafiles and they have been backed up 6 months ago using ALTER TABLESPACE BEGIN BACKUP commands and, therefore, have different checkpoint SCNs. The checkpoint SCNs could be 1021, 1059, 1085, 1745, 2045.
    How would Oracle know which Log Sequence Numbers are needed ? It knows that a Recovery must start with SCN 1021. But if the information about Log Sequence Numbers is not available in the controlfile (either because it is as of today and the controlfile doesn't store information about 6 months of redo logs OR because the controlfile has been recreated), what is the Log Sequence Number corresponding to that SCN 1021 ?
    That information is available in the datafile header. You will NOT see it in V$DATAFILE or V$DATAFILE_HEADER. You will not see it in a level 1 dump of datafile headers.
    You will see an example here :
    http://web.singnet.com.sg/~hkchital/Incomplete_Recovery_with_BackupControlfile.doc
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Current log sequence number

    i have a small doubt :
    when there is log switch , the current log sequence number is stored in the control file . Is the same current log sequence number stored in the headers of the datafiles??????
    waiting for your answers eargerly.....
    kumaresan.M

    nops i don think so.
    there is no need for doing this, only controlfile needs to know about the current sequence number
    Regards

  • Redo log sequence number

    hi everyone,
    I am looking at our SB system, and try to do only redo log backup. however it comes back with error message: The current redo log sequence number is not greater than the sequence number of the last saved offline redo log file.
    So, we suspect that since last refresh, we may reset the sequence back from 1.  Any one know how to solve this problem?  Thanks in advance.
    Amy

    Hi,
    Is your probh solved?
    Can u pl tell if u executed a recovery of database earlier?
    Pl check if there was a case of reset logs.
    To do this run BRTOOLS-->Instance Mgt->Show Inst Status.
    This will show if there was a case of reset logs.
    If it is so try the following:
    Shut down sap and the database.
    Look for a folder named oraarch
    Oracle/sid/oraarch
    Copy all the archive files to another folder and delete all the arc files from the oraarch folder.
    The name of the arch files will be like <SID>ARCHARC123456.001
    After copying to another location and subsequently deleting them from oraarch folders start up oracle in mount mode.
    Then issue the following sql
    alter database open resetlogs;
    then start sap.
    NB:Dont forget to take a complete backup before and after diong this.
    Hope this will help.
    Most probably your database contains two icarnations of redo log files so this error is comming.
    regards

  • Sequence number/counter in File name using FTP

    Hi
    I have to add sequence number in the file name. How can i do that? everytime file generates it should pick up the latest file number.
    Example File1 File2 File3. 1,2 and 3 are the sequnce number.
    Regards

    Hi ria,
             You can do this by dynamic file creation. Use this following code and cretate an UDF. The map the required file format to the target header structure as below;
    UDF
    sequence number:
    IDENTIFIER is the parameter
    Import com.bp.xi.util.*;
    Code:
    return ServiceUtil.getSequenceValue( IDENTIFIER, container, false );
    Dynamic file:
    Key & Value is the parameter
    Code:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get( StreamTransformationConstants.DYNAMIC_CONFIGURATION );
    DynamicConfigurationKey confkey = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File",  Key );
    conf.put( confkey, Value );
    return "";     
    Input parameter "Key" is given a constant value"FileName"
    Second parameter "Value" is the file pattern
    Mapping
    Constant(File)concat function sequence numberUDF ==> Dynami File udf ==>target header record.
    In the receiver communication channel check the adapter specific function, filename
    points if useful
    regards,
    Murugavel

  • Maximum number of control files.

    Hi Sir,
    I read maximum number of control files we can multiplex is 8, just want to know any specific reason maximum 8 ?
    I know that if we have mutliplue controlfiles it affect the perfromance because database has to record the status in all control files.
    but curious to know anyspefic reason why maximum 8.
    Thanks!

    It is probably no coincidence the number is 8 --> 2 to the power of 3, which makes sure the controlfile number takes *4* bytes, so a half nibble. Somehow Oracle will probably encode multiple numbers in one byte.
    Sybrand Bakker
    Senior Oracle DBA

  • How to use old archieve logs with a new control file

    Environment:
    ORACLE_BASE="/export/home/oracle"
    ORACLE_HOME="/export/home/oracle/product/8.1.6"
    NLS_LANG=".UTF8"
    2 partitions:
    i) /data1 -- contains important datafiles (OS striping on 3 hard
    disks)
    ii) /export/home -- contains the oracle program, and SYS/SYSTEM
    datafiles
    Problem:
    -/data1 cannot be read/mount (damaged)
    -oracle failed
    Action Performed:
    -reinstalled OS
    -mount /export/home successfully (all oracle system files,
    instance init files exist)
    -/data1 is an empty partition
    -created the oracle user, and its groups
    -chown recusively for the $ORACLE_BASE directory
    -set all the oracle environment variables
    -attempted to start the instance, but failed due to a control
    file was
    missing
    -since control files were set to be mirrored, i copied a control
    file somewhere
    from /export/home/oracle/oradata/<SID>/control1.ctl to
    /data1/oracle/oradata/<SID>/control2.ctl (i.e. have them back to
    their original locations)
    -the instance failed to start as well, since the datafile set in
    the control files couldn't be found
    -this forced me to re-create the control file... b4 i re-create
    a new control file, i backed up the old one
    -once the control file was created, the database can be started,
    but, to oracle, all achieve log information are lost (although
    the achieve log's physical files r still there)
    -i imported the important data from a dump file that was
    exported a week ago b4 the system failure
    -since we r using the new control file, the redo logs switch
    contains no achieve log information that the old control file
    has, so running "recover database" doesn't do anything
    Purpose:
    since the dump file is a week old, i'd like to get the data
    after my last export and b4 the system failure. the database was
    run in arhieve log mode, how can i recover those data with the
    new control file
    Question:
    -how can we create a new control file that can drive the old
    achieve logs?
    -can we convert the achieve log data (.dbf format) into text
    format?
    -can we still use the old control files to start the database?
    -what's a suggested solution if we'd like to re-construct the
    database up to the moment b4 the system failure in another
    server?
    thx

    user3930585 wrote:
    I am in an unenviable position, with an unsupported database.
    We are running Oracle 9i on Windows XP. We are upgrading soon to Oracle 11g on a newer platform, but need to get our development environment working first.
    We lost a system that was running our development database without having a database export. The C drive was placed into a new system as the D drive.
    I have loaded Oracle 9i on the C drive, but I have been unable to determine how to point it to the existing data files on the D drive. My search skills may be the limiting factor here...
    We cannot simply load the drive as C, since the hardware is different.
    What are the steps to point the new database software at the data files on the D drive? Or, how do I copy the old data files into the new Oracle Home and have them recognized properly?
    Are you stating that you don't know how to use COPY command?
    Can you recreate same directory structure on new C drive as exist on old C drive?
    Can you then drag & drop copies of the files?

  • How to Write log messages in a text file located in another machine

    Basically My application is distributed across two or more tomcat servers running in multiple machines.And I get a log4j logs in the respective machines.
    But I want a consolidated log message in a single machine.
    How do i get that done??
    Any samples?? Any clues??
    Any specific technoliges??

    Create an RMI application (for example) that writes the log, and let all logging calls call that remote application.
    Something like that is the only feasible way that doesn't require you to have a drive on the remote machine mapped to the local one (which causes its own problems as you could have multiple simultaneous write attempts...).

  • Command that give me the log sequence number of Specifc date

    hi,
    I need a command that gives me the LSN number of previous date. e.g if current date is 20-02-2013. & i want to get the LSN number that have date last month.28-01-2013.
    thanks.
    Regards,

    No Replies

  • Checkpointing - control file contents question

    Some clarification is needed if possible...
    When you commit a transaction:
    - commit scn is recorded in the itl of the data block and undo segment header
    - lgwr records the committed scn (for all data blocks involved) to the redo log
    Checkpoint Event
    - (3 seconds or possibly less passes by) CKPT wakes up and signals DBWn to write dirty (modified and committed)
    blocks to disk
    - CKPT records the scn of those blocks in the control file (data file and redo thread sections) and the data file
    header (task of checkpoint when a log switch occurs)
    - Checkpoint position in the Redo Log is forwarded
    Control file contents question:
    When LGWR writes the commit scn to the redo log, who writes the scn to the control file? LGWR or CKPT?
    Also, when is the redo thread scn written?
    Matt

    Matt,
    This is my understanding of the stuff. Feel free to correct me.
    Checkpoint SCN , as I mentioned in my last reply is the marker of the point till which the data is "chekpointed" to the datafiles. This marker tells the controlfile that in the case of the crash, where to start recovery of the datafile and have to go which extent in the redo stream? This is only available in the datafile header and in the controlfile. This doesn't get recorded in the redo log file/stream.
    I mentioned checkpoint queue in my reply too. Though I couldn't find any reference directly mentioned between this and in the checkpoint SCN but I believe my theory , if not totall, partially is correct. The incremental checkpoint is the stuff which makes the decision that how many redo blocks needs to be applied to the datafile if its closed without a proper checkpoint. So this part is maintained in the Datafile header itself in the form of the checkpoint SCN. When not matched with the conrolfile checkpoint SCN, which is always higher than this, a recovery is reported.
    I hope its somewhat correct. Do let me know your views too.
    Cheers
    Aman....

  • In standby db, can't find sequence number of Last Applied Log.

    Hello,
    Standby database is behind the primary database for over 200 hours, to repaire this, we are using a incremental backup from primary database and a restored control file.
    after starting up standby database, in Grid Control (OEM), can't find "last applied log" sequence number,
    go to that standby, do
    standby> select max(sequence#) from v$archived_log where applied='YES';
    MAX(SEQUENCE#)
    go to primary,
    do
    SQL> select max(sequence#) from v$archived_log where applied='YES';
    MAX(SEQUENCE#)
    83833
    then using OEM grid control, to Verify checks various standby database settings.
    Initializing
    Connected to instance standby_server:standby
    Starting alert log monitor...
    Updating Data Guard link on database homepage...
    Skipping verification of fast-start failover static services check.
    Data Protection Settings:
    Protection mode : Maximum Performance
    Redo Transport Mode settings:
    primary.com: ASYNC
    standby.com: ASYNC
    Checking standby redo log files.....OK
    Checking Data Guard status
    primary.com : Normal
    standby.com : Normal
    Checking inconsistent properties
    Checking agent status
    Checking applied log on standby........WARNING:
    Timed out after 60 seconds waiting for log to be applied.
    Processing completed.
    so how to fix this?
    thanks you very much.
    Edited by: 951932 on Oct 18, 2012 7:44 AM

    Hello;
    Probably nothing to fix. This is a common warning message.
    It even occurs in this example :
    http://www.databasejournal.com/features/oracle/article.php/10893_3826706_2/Oracle-11g-Data-Guard-Grid-Control-Management.htm
    Best Regards
    mseberg

  • File Writting / Logging

    I want it so that when a user logs in incorrectly, the action is logged to a file. Is there a way to specify the name of the file to log to, and what contents should be logged?
    I looked at the log() function, but can I change the directy it logs too and the name of the file it logs as?
    - GU

    i don't use the build in log function because that just goes to the servlet-runner logfile, where a lot of other logging goes in too. so this file isn't really needfull for action logging aso.
    i built a logfile object which represents a file where i put the loggings in. if you want to use different logfiles for different parts of your app (i.e. for moduls that can be turned on or off) or for different useres use a logfile manager which handels all the logfile objects you create.
    like this you get a good flexibility to do what you like. so you can decide which error log entries goes in which files, whether they go to console too, and so on...

  • Queries on DATABASE OPEN RESETLOGS and lost Control Files

    Hi I have some queries on RESETLOGS I would be keen to hear some answers on
    Q1. If I am doing a PITR and I end in ALTER DATABASE OPEN RESETLOGS, what happens about any Archived Redo Log files ( still in situ ) that were from the original source database but were at a future point in time ? Are they just ignored by any future restore ( since their log sequence number will be different ? ) and eventually over written or purged out ?
    Q2. When you create a new incarnation using RESETLOGS can you Flashback Database to before this ?
    Q3. If I have lost all my Control Files and have not created a backup control file or done a backup to trace of the control file, can I simply restore one of the actual control files from my last backup and use RECOVER DATABASE USING BACKUP CONTROLFILE AUTO; or will this only work with a bonafide backup control file ( i.e. one created via ALTER DATABASE BACKUP CONTROLFILE TO ‘<file spec>’; )
    Q4. When I issue RECOVER DATABASE USING BACKUP CONTROLFILE AUTO;
    Do I have to ALTER DATABASE OPEN RESETLOGS at the end of the recovery ? I have seen this documented but I am not sure why I would need to reset the redo logs and instead simply open the database ?
    Q5. If I am running the CREATE CONTROL FILE command from an ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
    Do I need to use the NORESETLOGS or RESETLOGS ? How do I know which to use ?
    thanks,
    Jim

    Jimbo wrote:
    Hi I have some queries on RESETLOGS I would be keen to hear some answers on
    Q1. If I am doing a PITR and I end in ALTER DATABASE OPEN RESETLOGS, what happens about any Archived Redo Log files ( still in situ ) that were from the original source database but were at a future point in time ? Are they just ignored by any future restore ( since their log sequence number will be different ? ) and eventually over written or purged out ?
    what happens when you try it?
    Q2. When you create a new incarnation using RESETLOGS can you Flashback Database to before this ?
    what happens when you try it?
    Q3. If I have lost all my Control Files and have not created a backup control file or done a backup to trace of the control file, can I simply restore one of the actual control files from my last backup and use RECOVER DATABASE USING BACKUP CONTROLFILE AUTO; or will this only work with a bonafide backup control file ( i.e. one created via ALTER DATABASE BACKUP CONTROLFILE TO ‘<file spec>’; )
    what happens when you try it?
    Q4. When I issue RECOVER DATABASE USING BACKUP CONTROLFILE AUTO;
    Do I have to ALTER DATABASE OPEN RESETLOGS at the end of the recovery ? I have seen this documented but I am not sure why I would need to reset the redo logs and instead simply open the database ?
    what happens when you try it?
    Q5. If I am running the CREATE CONTROL FILE command from an ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
    Do I need to use the NORESETLOGS or RESETLOGS ? How do I know which to use ?
    what happens when you try it?

  • Thread 1 advanced to log sequence (redo log)

    Hi All,
    db:oracle 10gR2(10.2.0.4)
    os:solaris10
    My alert log file shows following information all the time....can you please explain me whats going on??
    Mon Jan 30 01:40:30 2012
    Thread 1 advanced to log sequence 253305
    Current log# 2 seq# 253305 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO02.LOG
    Mon Jan 30 01:45:40 2012
    Thread 1 advanced to log sequence 253306
    Current log# 3 seq# 253306 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO03.LOG
    Mon Jan 30 01:51:21 2012
    Thread 1 advanced to log sequence 253307
    Current log# 1 seq# 253307 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO01.LOG
    Mon Jan 30 01:56:53 2012
    Thread 1 advanced to log sequence 253308
    Current log# 2 seq# 253308 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO02.LOG
    Mon Jan 30 02:01:57 2012
    Thread 1 advanced to log sequence 253309
    Current log# 3 seq# 253309 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO03.LOG
    Mon Jan 30 02:06:31 2012
    Thread 1 advanced to log sequence 253310
    Current log# 1 seq# 253310 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO01.LOG
    Mon Jan 30 02:11:37 2012
    Thread 1 advanced to log sequence 253311
    Current log# 2 seq# 253311 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO02.LOG
    Mon Jan 30 02:16:44 2012
    Thread 1 advanced to log sequence 253312
    Current log# 3 seq# 253312 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO03.LOG
    Mon Jan 30 02:21:51 2012
    Thread 1 advanced to log sequence 253313
    Current log# 1 seq# 253313 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO01.LOG
    Mon Jan 30 02:27:11 2012
    Thread 1 advanced to log sequence 253314
    Current log# 2 seq# 253314 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO02.LOG
    Mon Jan 30 02:32:31 2012
    Thread 1 advanced to log sequence 253315
    Current log# 3 seq# 253315 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO03.LOG
    Mon Jan 30 02:37:25 2012
    Thread 1 advanced to log sequence 253316
    Current log# 1 seq# 253316 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO01.LOG
    Mon Jan 30 02:42:15 2012
    Thread 1 advanced to log sequence 253317
    Current log# 2 seq# 253317 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO02.LOG
    Mon Jan 30 02:47:05 2012
    Thread 1 advanced to log sequence 253318
    Current log# 3 seq# 253318 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\JNPC\REDO03.LOG
    I appreciate your response......
    thanks.

    This information shows that the log switch has occured.
    The LGWR writes the redo information from the redo log buffer to the online redo log file. When the current online redo log file fills, LGWR begins writing to the next available online redo log file. In the mean time, the ARC process archives the contents of the filled online redo log file (If the database is in archivelog mode. If its in noarchive mode, then the filled online redo log file would not be archived). These archives are given a unique log sequence number.
    In your case 253305, 253306..are the log sequence numbers.
    You can refer http://docs.oracle.com/cd/B10501_01/server.920/a96521/onlineredo.htm for a detailed information

Maybe you are looking for

  • Week view in calendar after ios5 update?

    just updated my 3rd generation ipod touch to ios5.  Was excited about seeing a "week view" in addition to day, month and list on the calendar as described in the blurbs about ios5.  However it is not there.  Can anyone out there explain?

  • Warning on ServerSocketAcceptHandler

    Hi, I don't know if this is a new warning of OC4J 10.1.3.0 . On OC4J 9 I hadn't seen it. The server is configured to use SSL. It appears when a client using for example IE or Netscape refuse to accept the certificate. So the log show: 2006-08-09 16:1

  • How to get the right format if I copy data off another source....

    IWorks '08 I have a data source that I want to copy to Numbers and it posts it all in the first row, when I paste it. (Excel will automatically format it correctly). I've tried a number of different things and can't figure out how to get the data to

  • Installing Linksys Wireless G WAP54G Router

    So...the guy at Staples said it would be fine with a Mac. Yea right. It doesn't recognize the installation disc, the help on the Linksys site may as well be written in another language for someone like me. Is there anyone who can explain to me how to

  • The issue while  upgrading to  EHP1

    Hi we are upgrading solution manger netweaver 7.0 to ehp1 using SAINT. We couldnt  import queue since it was taking a long time hence we schedule the queue to be imported in background .  But the problem is that  the back ground job is running past f