Get redo sequence number against SCN

hi all,
environment is oracle 10gr2(10.2.0.5.0)...
1 PROD Server
1 DR Server (Dataguard Configuration)
1 Reporting Server (replication is configured via oracle streams on some large tables....)
Due to shortage of disk space i need to remove archivelogs from FRA on daily basis.
My requirement is to identify which archived logs are required by capture process , so that archive logs that are not required could removed.
could not identify the relationship among all_capture and v$log_history/v$archived_log views
can get the capture process and their relevant SCN numbers from
select c.CAPTURE_NAME, c.START_SCN,c.CAPTURED_SCN,c.APPLIED_SCN, c.FIRST_SCN,c.LAST_ENQUEUED_SCN,c.LOGMINER_ID
FROM all_capture c;But how to get archivelog sequence number?

Hi
It is from 11.1, but should also work for your version.
COLUMN CONSUMER_NAME HEADING 'Capture|Process|Name' FORMAT A15
COLUMN SOURCE_DATABASE HEADING 'Source|Database' FORMAT A10
COLUMN SEQUENCE# HEADING 'Sequence|Number' FORMAT 99999
COLUMN NAME HEADING 'Required|Archived Redo Log|File Name' FORMAT A40
SELECT r.CONSUMER_NAME,
       r.SOURCE_DATABASE,
       r.SEQUENCE#,
       r.NAME
  FROM DBA_REGISTERED_ARCHIVED_LOG r, DBA_CAPTURE c
  WHERE r.CONSUMER_NAME =  c.CAPTURE_NAME AND
        r.NEXT_SCN      >= c.REQUIRED_CHECKPOINT_SCN;  http://docs.oracle.com/cd/B28359_01/server.111/b28321/strms_cpmon.htm#CHDBBJCF
Salman

Similar Messages

  • How to get generated sequence number from JPA/TopLink

    Hi there,
    I am using JDev 10.1.3.3 with JPA + POJO + TopLink.
    In the entity (POJO), I declared a sequence generated for a number field.
    @Id
    @GeneratedValue(strategy=SEQUENCE, generator="GEN_CUSTOMER_ID_SEQ")
    @SequenceGenerator(name="GEN_CUSTOMER_ID_SEQ", sequenceName="CUSTOMER_ID_SEQ", allocationSize=1)
    @Column(name="CUSTOMER_ID", nullable = false, precision = 12 )
    private Long customerId;
    In my program, I don't need to set the Id field because it is set automatically.
    However, I want to get the generated sequence using code. Is there a way?
    Thanks,
    Jim
    P.S. I cannot use getCustomerId because the value has not been set yet.

    If you call persist on the new Entity, or flush() the id will be assigned, and you can get it.
    There is also an API on the TopLink / EclipseLink Session getNextSequenceNumberValue(), that you can use to get a sequence value.
    -- James: http://www.eclipselink.org

  • SAP database table name to get the PO number against Spool number

    Hello,
    I have a spool number which is generated against the Output of a PO. Can anybody let me know how can I find that PO number against that spool number.

    I populate the field 'Text for coverpage' in the communication data of the message-condition-record with the string
    '&XNAST-OBJKY&'  in TA MN05. This string will be replaced with the PO-Number during spool request creation.
    KR
    Alfons

  • How to get max sequence number when some record exists in data base table

    Hi,
    I need to create sequence such a way that it should starts from max value already exists in table.
    Example:
    I have table like below:
    ID NAME
    1 A
    2 B
    3 C
    4 D
    Now when creating sequence it should start from 5 but I should't hard code STARTS WITH 5 in the create sequence. Is there any way to do this without hard code the max value in the sequence. It should automatically take the max + 1 value for next data when I insert.
    CREATE SEQUENCE TEST_SEQ.NEXTVAL
    START WITH [Max + 1 val from the table]
    MAXVALUE 9999999999999999999999999999
    MINVALUE 1
    NOCYCLE
    CACHE 20
    NOORDER;
    Thanks.....
    Edited by: 998976 on Apr 18, 2013 4:37 AM
    Edited by: 998976 on Apr 18, 2013 4:38 AM

    Hi,
    The numbers in a CREATE SEQUENCE statement are all literals; no other kinds of numeric expressions are allowed.
    You need dynamic SQL to do anything like what you want. For example:
    COLUMN     seq_start_col     NEW_VALUE  seq_start
    SELECT     1 + MAX (val)     AS seq_start_col
    FROM     table_x;
    CCREATE SEQUENCE TEST_SEQ.NEXTVAL
    START WITH  &seq_start
    MAXVALUE 9999999999999999999999999999
    MINVALUE 1
    NOCYCLE
    CACHE 20
    NOORDER;

  • Concurrent manager deadlock while getting sequence number

    has anyone seen this? thanks,any ideas what is causing it?
    -- Waiting for notification on: oracle/toplink/internal/helper/ConcurrencyManager@0x343f5dd0[fat lock]
    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
    at java/lang/Object.wait(J)V(Native Method)
    at java/lang/Object.wait(Object.java:474)
    at oracle/toplink/internal/helper/ConcurrencyManager.acquire(ConcurrencyManager.java:76)
    ^-- Lock released while waiting: oracle/toplink/internal/helper/ConcurrencyManager@0x343f5dd0[recursive]
    at oracle/toplink/internal/helper/ConcurrencyManager.acquire(ConcurrencyManager.java:62)
    ^-- Lock released while waiting: oracle/toplink/internal/helper/ConcurrencyManager@0x343f5dd0[fat lock]
    at oracle/toplink/internal/sequencing/SequencingManager.acquireLock(SequencingManager.java:259)
    at oracle/toplink/internal/sequencing/SequencingManager$Preallocation_NoTransaction_State.getNextValue(SequencingManager.java:506)
    at oracle/toplink/internal/sequencing/SequencingManager.getNextValue(SequencingManager.java:864)
    at oracle/toplink/internal/sequencing/ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:75)
    at oracle/toplink/internal/descriptors/ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:203)
    at oracle/toplink/publicinterface/UnitOfWork.assignSequenceNumbers(UnitOfWork.java:401)
    at oracle/toplink/publicinterface/UnitOfWork.collectAndPrepareObjectsForCommit(UnitOfWork.java:841)
    at oracle/toplink/publicinterface/UnitOfWork.commitToDatabaseWithChangeSet(UnitOfWork.java:1392)
    at oracle/toplink/publicinterface/UnitOfWork.commitRootUnitOfWork(UnitOfWork.java:1164)
    at oracle/toplink/publicinterface/UnitOfWork.commit(UnitOfWork.java:932)

    It is trying to get a sequence number and needs to get the lock on the preallocated numbers first. The question is what has this lock, and what is it waiting on? Perhaps a full stack dump (ctrl-c).

  • How to populate sequence number automatically in fusion web application

    Hi all,
    I created simple fusion web application.
    I created a form which has programid and remaining fields are there.
    If i press save button program details will save in database.
    here i am giving programid manually. but i need to generate a sequence number to programid automatically.
    If i give program details and save for this program details one sequence number should be generate and save in databasePlease help me
    Thanks,
    raj

    Here there are two methods given
    1. Generating sequence number from the trigger
    2. another one is from java class.
    I tried two but i am not getting the sequence number.
    In my application under model project i have programview.
    i created CustomEntityEmpl java class.
    I double clicked on programid in attributes window, given some sequence name in name field,given db sequence name as as value.
    i mentioned name of sequence in Java class. but still it is asking a value when submiting the program details with out program id.
    please help ASAP
    Thanks
    Nag

  • Function module to get the sequence numbers based on PERNR & payroll period

    Hi,
        Right now i am using the function module 'CU_READ_RGDIR' to get the sequence number based on the PERNR. Once i get the data i am filtering based on payroll periods (begin date and end date). Is there any function module to get the sequence number directly based on PERNR and payroll period dates? if so could you let me know.
    Thanks
    Satya

    I think thats the only way
    CALL FUNCTION 'CU_READ_RGDIR'
        EXPORTING
          persnr          = p0001-pernr
        TABLES
          in_rgdir        = it_rgdir
        EXCEPTIONS
          no_record_found = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    check whether "Pay date for payroll result" with in Start Date and
                  End date, and "Reason for Off-Cycle Payroll" is initial
      LOOP AT it_rgdir WHERE paydt >= v_begda
                             AND paydt <= v_endda AND
                             void IS INITIAL
                             AND ocrsn IS INITIAL
                             AND srtza = 'A'.
        v_seqnr = it_rgdir-seqnr.
    ENDLOOP.
    Hope this helps.
    Thanks
    Kiran

  • Sequence number - increment one for every 3 rows

    Dear All,
      I want to get a sequence number /group number, which increments 1 for every 3 rows. 
      For Example:
       Seq     Name   
        1          a
        1          b
        1          c
        2          D
        2          E
        2          F
        3          G
        3          H
        3          I
        4          abc
        4          aaa
        4          bbb
    Is there a function to do this?

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. Did you read the header of this forum?? But besides being rude, you are also ignorant.  A table has no ordering, so
    there is no concept of every third row. What are you using for a sort key? What happens when a new row is added to or deleted from this table? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Bapi BAPI_GET_PAYROLL_RESULT_LIST fetches wrong sequence number

    Hi,
    I am using bapi BAPI_GET_PAYROLL_RESULT_LIST to get the sequence number by passing personal number and date range. This bapi instead of fetching the supplied period's sequence number, it fetches sequence number one less than expected.
    This data can be viewed from transaction pc_payresult. Can anybody suggest please.
    Regards,
    Taj.

    The infotype has to be changed to relevant.
    Edited by: Mohd Tajuddin on Dec 20, 2009 8:45 AM

  • How is the next repository sequence number determined?

    I'm in Fusion Middleware activating an RPD file that is sitting in a directory all by itself. When I click Apply, the name of the RPD file plus a sequence number, such as _BI014, is shown as the new repository name.
    Where does FMC look to determine that the last sequence number used was 13, so this one should be 14? Where is that little tidbit of information stored?

    Hi Mark,
    Refer to this article from Rittman, where he clearly explained what happens in the background upon clicking on Apply button:
    From the Article:
    "Apply button, to save the changes. At this point, the RPD gets a sequence number after it, and it’s displayed as the current default online repository for the Oracle BI Domain.
    So what’s gone on in the background to make this happen? When you press the Apply button, another MBean method gets called; this time, the uploadRepository method from the oracle.biee.admin:type=BIDomain.BIInstance.ServerConfiguration,biInstance=coreapplication, group=Service MBean.
    This MBean takes the two parameters that you entered into Enterprise Manager, or that you can enter directly into the MBean Browser yourself:
    When you call then method, it reads the value of the DataZipFileVersion attribute within the oracle.biee.local:Location=bi_server1,type=DomainConfigProxy,group=Config MBean, and increments it by one, to get the sequence number it appends to the RPD file name.
    Once the uploadRepository method is called, you can see the name of the uploaded repository in the MBean’s Repository Name attribute"
    Reference: http://www.rittmanmead.com/2011/03/so-how-does-enterprise-manager-work-within-obiee-11g/
    Thanks,
    -Amith.

  • Unified CCX Editor: Retrieving Sequence Number on Multi-Leg Call

    Hi
    I'm fairly new to scripting in the Unified CCX Editor, so apologies for any mistakes/misunderstandings I may have.
    I have a situation where I'm trying to retrieve and use the Sequence Number of a call within a script.
    There is a tool called "Get Contact Info" where you can retrieve the Sequence Number from the session, but this does not work for calls with more than 1 leg.
    e.g. I have an incoming call which is answered by Agent A, who then transfers the call to a seperate queue where it is answered by Agent B.
    This creates 2 records in ContactCallDetail (and other related tables) with the same Session Id, but a sessionSeqNum of 0 for the first leg, and 1 for the second leg.
    Within the script for the 2nd queue, I'm retrieving this sequence number and populating one of the Custom Variables's with it, so that I can confirm that the value is correct.  It is not!  It is always set to 0 (even if the default for the variable I'm pulling the Get Contact Info->Sequence Number into has a default value of 999.
    So, how do I get the Sequence Number?
    Any ideas?
    Thanks
    Liffey

    Hi,
    I test using the "select ressource" box, that way I am using a CSQ and it's works. Before, I was just testing with a "Redirect call" box and that is not the right solution.
    Thank you
    H.C

  • Need to query the database to get the last sequence number

    Hi all
    I am trying to get the last sequence number of the last row inserted into my Oracle database. Please could someone give me the SQL which would allow me to do this - using Oracle SQL Explorer I have confirmed that there is a sequence on the table which is called: XYZ_SEQ and the code for this is:
    CREATE SEQUENCE "MY_USER_NAME"."XYZ_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
    My Java application is inserting a row into my table and to insert a new row I need to have the last sequence inserted +1 so the new row can be added.
    Any help would be much appreciated.

    Hi,
    Welcome to the forum!
    If you are using a sequence just do (example):
    INSERT INTO TABLE_NAME
       (COL1,
        COL2)
    VALUES
       (SEQUENCE_NAME.NEXTVAL,
        OTHER_VALUE);to obtain (and use) the next number in the sequence when you are inserting.
    If you have a sequence to use for a specific table, you should use it when your insert new data (no matter your are doing that: java application, procedure, etc). Doing this you avoid some problems when you have the sequence 'out of date' about the associated data.
    Regards,
    Edited by: Walter Fernández on Sep 19, 2009 10:08 AM
    Edited by: Walter Fernández on Sep 19, 2009 10:10 AM

  • Are there any ways to get sequence number other than getting it for each re

    are there any ways to get sequence number other than getting it for each record

    CACHE is the number of values Oracle stores in memory. So the first call to NEXTVAL Oracle grabs x numbers; subsequent calls to NEXTVAL are served from memory until they're all gone and them another bunch is grabbed. The attached sql*plus output demonstrates this behaviour.
    Note that normally unused numbers in the cache are returned to the data dictionary but in exceptional circumstances (DB crash) they may be lost.
    Cheers, APC
    SQL> create sequence seq cache 3
      2  /
    Sequence created.
    SQL> select last_number from user_sequences
      2  where sequence_name = 'SEQ'
      3  /
    LAST_NUMBER
              1
    SQL> select seq.nextval from dual
      2  /
       NEXTVAL
             1
    SQL> select last_number from user_sequences
      2  where sequence_name = 'SEQ'
      3  /
    LAST_NUMBER
              4
    SQL> select seq.nextval from dual
      2  /
       NEXTVAL
             2
    SQL> select last_number from user_sequences
      2  where sequence_name = 'SEQ'
      3  /
    LAST_NUMBER
              4
    SQL> select seq.nextval from dual
      2  /
       NEXTVAL
             3
    SQL> select last_number from user_sequences
      2  where sequence_name = 'SEQ'
      3  /
    LAST_NUMBER
              4
    SQL> select seq.nextval from dual
      2  /
       NEXTVAL
             4
    SQL> select last_number from user_sequences
      2  where sequence_name = 'SEQ'
      3  /
    LAST_NUMBER
              7
    SQL>

  • 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

  • How can find SCN or sequence number on the update operation?

    nedd to recovery database, how can find the SCN or sequence number before the update exection?
    thanks

    nedd to recovery database, how can find the SCN or
    sequence number before the update exection?Sorry - there is something confusing about your question ...
    It seems to me the SCN is the 'system change number', which identifies when a change (table, row, block, flush log buffer to log file, etc) has ocurred.
    You seem to be asking for the SCN associated with an update before the update actually occurred.
    Are you actually asking "How do I perform a point in time recovery to immediately before a specific update?"
    Perhaps you could include a few more details, such as database version. For some reason different versions have different capabilities - that could be helpful here.

Maybe you are looking for

  • MY IPHONE 4 MMS DOESN'T WORK! HELP!!!!

    Hey! This forum looks like the people in it know what they are talking about, so I thought I would give it a shot!  I have the iPhone 4 and for the past god knows how long, my MMS just won't send at all. Through 3g or WiFi! Every time I try to send a

  • How to get the dynamic query result

    If in one query, there is the amount range dimension, based on different dimension value combination, the customer revenue should be refreshed into different range, how to make it by cube? eg. Customer Store    Material  Month    Amount C001     M &

  • BPM Not Updating

    Hi All, I have created a BPM with a transformation step in it, now when I am trying to change the Interface Mapping in the BPM the new mapping is not getting updated. The BPM is still reffering the old mapping. *I have tried the following solutions:

  • Can the Thunderbolt Octopus cable be replaced?  I broke the cable.

    I knocked my laptop off the table and it landed on the thunderbolt connector.  The cable will need to be replaced and I am hoping it is possible.

  • Can you verify I correctly went through the normalization process?

    Hi, I am creating a table, and I wanted to go through normalization to get the best design.  I followed the outline here: Normalization - Oracle FAQ Basically it is a table that will hold attributes that are based on a combination of catentry + count