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

Similar Messages

  • 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

  • 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 Report - Task Sequence - Deployments

    Hello,
    I have a doubt about this report Summary report for a task sequence deployment in Task Sequence - Deployments.
    Last Friday I did deployed in 6 desktop ran this report and display my 6 desktop's all right.
    Today a run this report and display no data.
    Why occurred this? Anyone have idea?
    I think this report have display me all data about my task sequence specific.
    Thanks.

    Are you sure the deployment wasn't deleted or recreated? 
    Query your DB and see what the NumberInstalled says.  That should show you 6 were installed.  You just need the Deployment ID added to this query below.
    select *
    from dbo.DeploymentSummary
    where
    OfferID = 'YOUR DEPLOYMENT ID HERE'
    Best, Jacob I'm a PC.
    My TS wasn't modified or recreated, but in DB display NumberInstalled = 0.
    Anyone have modify this TS since last friday, I don't know the reason this happened.
    I will do news deploys and see this report after if still have same issue.
    Thanks your opinion.

  • Doubt about ccm.log error= 0x8004100E

    Hello guys,
    I have a doubt about when ccm.log display error = 0X8004100E.
    So, some my desktops scan by SCCM display error= 0x8004100E but client sccm is installed with sucess. My doubt is what reason display this error?
    Maybe can I don't worry about this,but I need know reasons display this messages.
    Thanks a lot.

    This will be displayed if your site server cannot connect to ccm WMI namespace on the worksation. CCM wmi namespace will only be available if the workstation has ConfigMgr client, hence this will eventualy fail for the workstation that are new to
    ConfigMgr.  I guess sccm uses this to check if the client is already present or not.
    Kindly mark as answer/Vote as helpful if a reply from anybody helped you in this forum. Delphin

  • 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)

  • 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

  • Generate archive logs are not in sequence number?

    On last friday... the latest archive log number was ARC00024.ARC. Tomorrow when I come backup, the archive logs ARC00001.ARC and ARC00002.ARC were being generated by oracle itself. I wondering the archive log sequence should be in sequence. What is happening?
    SQL> archive log list;
    Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination C:\oracle\ora92\RDBMS
    Oldest online log sequence 1
    Next log sequence to archive 3
    Current log sequence 3
    SQL>
    FAN
    Edited by: user623471 on Jun 7, 2009 7:35 PM

    khurram,
    Its our production instance and havent issued resetlogs option but when listing the arvchives it shows in different sequence number...
    and also while copying the archives by RMAN it doesnt copy in sequence
    -rw-r----- 1 xxx dba 69363859 May 28 19:16 2_10373.arc.gz
    -rw-r----- 1 xxx dba 43446622 May 28 19:16 1_10553.arc.gz
    -rw-r----- 1 xxx dba 52587365 May 28 19:16 1_10578.arc.gz
    -rw-r----- 1 xxx dba 45251820 May 28 19:16 1_10543.arc.gz
    -rw-r----- 1 xxx dba 60890256 May 28 19:17 1_10579.arc.gz
    -rw-r----- 1 xxx dba 46659008 May 28 19:17 1_10548.arc.gz
    -rw-r----- 1 xxx dba 116899466 May 28 19:17 2_10353.arc.gz
    -rw-r----- 1 xxx dba 77769517 May 28 19:17 1_10531.arc.gz
    -rw-r----- 1 xxx dba 66401923 May 28 19:18 1_10530.arc.gz
    -rw-r----- 1 xxx dba 45972697 May 28 19:18 1_10605.arc.gz
    -rw-r----- 1 xxx dba 55082543 May 28 19:18 1_10600.arc.gz
    -rw-r----- 1 xxxq dba 42682207 May 28 19:19 1_10547.arc.gz
    thanks,
    baskar.l

  • 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

  • Doubt about database point in time recovery using rman

    Hi Everyone,
    I have been practising various rman restore and recovery scenarios . I have a doubt regarding database point in time recovery using rman. Imagine i have a full database backup including controlfile scheduled to run at 10 PM everyday. today is 20th dec 2013. imagine i want to restore the database to a prior point in time ( say 18th dec till 8 AM). so i would restore all the datafiles  from 17th night's backup and apply archives till 8 AM of 18th dec . in this scenario should i restore the controlfile too from 17th dec bkp ( i am assuming yes we should ) or can we use the current controlfile ( assuming it is intact). i found the below from oracle docs.
    Performing Point-in-Time Recovery with a Current Control File
    The database must be closed to perform database point-in-time recovery. If you are recovering to a time, then you should set the time format environment variables before invoking RMAN. The following are sample Globalization Support settings:
    NLS_LANG = american_america.us7ascii
    NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"
    To recover the database until a specified time, SCN, or log sequence number:
    After connecting to the target database and, optionally, the recovery catalog database, ensure that the database is mounted. If the database is open, shut it down and then mount it:
    2.  SHUTDOWN IMMEDIATE;
    3.  STARTUP MOUNT;
    4. 
    Determine the time, SCN, or log sequence that should end recovery. For example, if you discover that a user accidentally dropped a tablespace at 9:02 a.m., then you can recover to 9 a.m.--just before the drop occurred. You will lose all changes to the database made after that time.
    You can also examine the alert.log to find the SCN of an event and recover to a prior SCN. Alternatively, you can determine the log sequence number that contains the recovery termination SCN, and then recover through that log. For example, query V$LOG_HISTORY to view the logs that you have archived. 
    RECID      STAMP      THREAD#    SEQUENCE#  FIRST_CHAN FIRST_TIM NEXT_CHANG
             1  344890611          1          1      20037 24-SEP-02      20043
             2  344890615          1          2      20043 24-SEP-02      20045
             3  344890618          1          3      20045 24-SEP-02      20046
    Perform the following operations within a RUN command:
    Set the end recovery time, SCN, or log sequence. If specifying a time, then use the date format specified in the NLS_LANG and NLS_DATE_FORMAT environment variables.
    If automatic channels are not configured, then manually allocate one or more channels.
    Restore and recover the database.
      The following example performs an incomplete recovery until November 15 at 9 a.m. 
    RUN
      SET UNTIL TIME 'Nov 15 2002 09:00:00';
      # SET UNTIL SCN 1000;       # alternatively, specify SCN
      # SET UNTIL SEQUENCE 9923;  # alternatively, specify log sequence number
      RESTORE DATABASE;
      RECOVER DATABASE;
    If recovery was successful, then open the database and reset the online logs:
    5.  ALTER DATABASE OPEN RESETLOGS;
    I did not quiet understand why the above scenario is using current controlfile as the checkpoint scn in the current controlfile and the checkpoint scn in the datafile headers do not match after the restore and recovery. Thanks in Advance for your help.
    Thanks
    satya

    Thanks for the reply ... but what about the checkpoint scn in the controlfile . my understanding is that unless the checkpoint scn in the controlfile and datafiles do not match the database will not open. so assuming the checkpoint scn in my current controlfile is 1500 and i want to recover my database till scn 1200. so the scn in the datafiles (which is 1200) is not not matching with the scn in the controlfile(1500). so will the database open in such cases.
    Thanks
    Satya

  • Doubts in Redo log

    Hi,
    DB: 10.2.0.4
    OS: UNIX/Windows
    I have some doubts in archive log generation.
    *1)* Once current redo log is filed , LGWR will move to next redo log which is available with status INACTIVE , and current one will become ACTIVE.If more archive logs are generating , based on business , ACTIVE will become INACTIVE after sometime and can use for CURRENT redo log.
    If no archive logs are generated , my redo log is not coming out from status ACTIVE to INACTIVE .Even i waited for 5 minutes , but i had the same status.
    What will be the time to make ACTIVE to INACTIVE?. What causing to make this happen ?.
    Normally , when checkpoint is happened DBWR will write the CURRENT log data to data files , right?.In ACTIVE state , has archive log generated?. Many times i seen archive log is generated even it is in ACTIVE state.
    *2)* My Archive logs size (25MB) is not equal to the redo log size. Normally , when we switch the logs or any rman backup , logs will be switched automatically and how much redo is filled , same will be generated with size.
    But, in my case , more archive logs are generating and many have the different size out of generated and no manual switching or rman script are running during this period.
    Any idea on this?.
    Thanks,
    Sunand

    sunand wrote:
    Hi,
    DB: 10.2.0.4
    OS: UNIX/Windows
    I have some doubts in archive log generation.
    *1)* Once current redo log is filed , LGWR will move to next redo log which is available with status INACTIVE , and current one will become ACTIVE.If more archive logs are generating , based on business , ACTIVE will become INACTIVE after sometime and can use for CURRENT redo log.
    If no archive logs are generated , my redo log is not coming out from status ACTIVE to INACTIVE .Even i waited for 5 minutes , but i had the same status.
    What will be the time to make ACTIVE to INACTIVE?. What causing to make this happen ?.
    Normally , when checkpoint is happened DBWR will write the CURRENT log data to data files , right?.In ACTIVE state , has archive log generated?. Many times i seen archive log is generated even it is in ACTIVE state.
    That is wrong.DBWR process write dirty blocks from database buffer cache to datafiles but not "CURRENT log data to data files".So if your current online log group is full then ARCH process will try archiving this group to available destination and without archiving there will not happen LOG SWITCH.After archiving log switch will happen and LOG SEQUENCE NUMBER will increase then you will get new current log group.IF old group status is ACTIVE it means this group still need instance recovery.SO when you execute ALTER SYSTEM CHECKPOINT in this case status of this group will INACTIVE.
    *2)* My Archive logs size (25MB) is not equal to the redo log size. Normally , when we switch the logs or any rman backup , logs will be switched automatically and how much redo is filled , same will be generated with size.
    But, in my case , more archive logs are generating and many have the different size out of generated and no manual switching or rman script are running during this period.
    Any idea on this?.
    As you know archivelogs is a copy of online redologs,but there can be several reasons and result these size can be different.For example manual log switch or if you set ARCHIVE_LAG_TARGET != 0.Finally archive logs contains information for media recover,but online redo logs contain instance and media recovery it means these size can be different.

  • Archive sequence number from standby does not match primary

    I have two unix servers configured, one as primary and one as standby, both in 11.2.0.2. When I run the verification scripts, I noticed that my standby's archive log sequence does not match the primary.
    From standby:
    select database_role, open_mode from v$database; Result: PHYSICAL STANDBY, MOUNTED
    select max(sequence#) from v$archived_log; Result is null
    archive log list;Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination /arch/standby
    Oldest online log sequence 0
    Next log sequence to archive 0
    Current log sequence 0

    Hello;
    I don't think you have Data Guard working.
    select max(sequence#) from v$archived_log; This should return a number.
    Do an alter system switch logfile; on the primary, I'm thinking the new log never makes it to your standby.
    Once you have this working consider running something like this from your Primary:
    SELECT name as STANDBY, SEQUENCE#, applied, completion_time from v$archived_log WHERE DEST_ID = 2 AND NEXT_TIME > SYSDATE -1;
    select max(sequence#) from v$archived_log where NEXT_TIME > sysdate -1;
    You can change the first query to include both the Primary and the Standby.
    Best Regards
    mseberg

  • Log sequence difference among RAC Instances

    RDBMS Version : 11.2
    Platform : Solaris 10
    In our RAC DB, we have 6 redo logs.
    SQL> select * from v$logfile order by 1,2;  
        GROUP# STATUS  TYPE    MEMBER                                                                    IS_
             1         ONLINE  +ORCL_ARCH01/ORCL_ARCH/orcl_log01.dbf                                     NO
             2         ONLINE  +ORCL_ARCH01/ORCL_ARCH/orcl_log02.dbf                                     NO
             3         ONLINE  +ORCL_ARCH01/ORCL_ARCH/orcl_log03.dbf                                     NO
             4         ONLINE  +ORCL_ARCH01/ORCL_ARCH/orcl_log04.dbf                                     NO
             5         ONLINE  +ORCL_ARCH01/ORCL_ARCH/orcl_log05.dbf                                     NO
             6         ONLINE  +ORCL_ARCH01/ORCL_ARCH/orcl_log06.dbf                                     NO
    6 rows selected.
    Logically or shall I say 'internally' , 3 redo logs are allocated per thread. But they all belong to one database.
    SQL> select group#,thread#,members from  v$log order by 1,2;
        GROUP#    THREAD#    MEMBERS
             1          1          1
             2          1          1
             3          1          1
             4          2          1
             5          2          1
             6          2          1
    6 rows selected.
    SQL> exit;If all these 6 redo log files belong to one database, then why do they have different max (sequence#) ?
    ie. The 'Oldest online log sequence' in Node1 shows 3432 and
         ''Oldest online log sequence' in Node2 shows 3188 (a difference of 244 )
    -- Instance1 in Node1
    SQL> archive log list
    Database log mode              Archive Mode
    Automatic archival             Enabled
    Archive destination            +ORCL_ARCH01/ORCL_ARCH
    Oldest online log sequence     3432 ------------------------->
    Next log sequence to archive   3434
    Current log sequence           3434
    -- Instance 2 in Node2
    SQL> archive log list
    Database log mode              Archive Mode
    Automatic archival             Enabled
    Archive destination            +ORCL_ARCH01/ORCL_ARCH
    Oldest online log sequence     3188   ------------------------> ( 3432 - 3188 = 244)            
    Next log sequence to archive   3190
    Current log sequence           3190

    So, this means Node1 is more loaded than Node2 ?
    So, in a properly configured RAC set both instances should show almost similar number for 'Oldest online log sequence' ? (ignoring the manual switches)

  • Next log sequence to archive is different

    Hi,
    I have doubt on standby (DR) concept.
    I can see that in my standby database next log sequence to archive shows 0.
    Is this ok or something is wrong?
    PRODUCTION
    SQL> archive log list;
    Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination /u006/app/archive/XXPROD/arch
    Oldest online log sequence 2627
    Next log sequence to archive 2631
    Current log sequence 2631
    STANDBY
    SQL> archive log list;
    Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination /u006/app/archive/XXPROD/arch
    Oldest online log sequence 2627
    Next log sequence to archive 0
    Current log sequence 2631

    Hello;
    Short answer no nothing is wrong.
    Its the same on mine :
    SQL> archive log list;
    Database log mode              Archive Mode
    Automatic archival             Enabled
    Archive destination            USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence     5069
    Next log sequence to archive   0
    Current log sequence           5071
    SQL> I use v$archived_log to check mine standby :
    SELECT  name as STANDBY, SEQUENCE#, applied, completion_time from v$archived_log WHERE  DEST_ID = 2 AND NEXT_TIME > SYSDATE -1;Against my Primary I get the last log :
    select max(sequence#) from v$archived_log where NEXT_TIME > sysdate -1;Data Guard has a set of v$ views to check results, 8archive log list8 isn't so good since with Data Guard you have two copies of the same database in different roles.
    Another query I like is : (Run on the standby)
    select process, status, sequence#, block# from v$managed_standby;The Oracle doc E10700-02 has several example in chapter 9 "Monitoring Primary, Physical Standby, and Snapshot Standby Databases"
    Also section "3.2.7 Verify the Physical Standby Database Is Performing Properly"
    Best Regards
    mseberg

Maybe you are looking for