Datafile sequence number differs in database and in ASM

Hi All,
Can someone help me on this. It's bit urgent . My datafiles in DC is something like this
SYSAUX.268.673209651
SYSTEM.259.673205553
But in DR after restoration of these datafiles there is difference in database and in ASM. In database they are the same sequence as in DC , but inside ASM it is as follows,
SYSAUX.283.697827503
SYSTEM.292.697827151
How is this possible? And how can i do to recover it? Please help.
Regards,
Mithra.

Hi,
Using ASM file system will use OFA architecture and hence you may not need to worry as well.
Only one extra care you would need to take is that when you restore the control file it would actually restore the file name with different one than the source. Hence, when you want mount the database, you may need to modify the controlfile parmaeter in init.ora for that database to make sure they use the right control files.
http://www.dbasupport.com/oracle/ora10g/ASM0301.shtml
The above link gives the details of the naming convention. I am late but bettern than never :).
Also, you may provide any details you have done recovery which if got any errors.
Regards,
Vasu

Similar Messages

  • Sequence number different in DB than from assignSequenceNumber()

    I am using TopLink 10.1.3 DP4 (I think - inside JDev build 3565). I am attempting to use a sequence in a schema that I DO NOT OWN - I cannot make modifications tot he database sequence because there are other applications in place running against it.
    The database sequence is in a 10g database, with an interval of 1 and a cache of 20.
    My object uses the value of the sequence as the sole element of its primary key. I am creating a new object, registering it with a UnitOfWork using registerNewObject(obj). It seems that this does not make a clone, since the object returned by this method is the same identity as the object passed in.
    My project sequencing policy is set as follows:
    <project-sequencing-policy>
    <sequencing-policy>
    <preallocation-size>1</preallocation-size>
    <sequencing-type>Use native sequencing</sequencing-type>
    <name-field-handle>
    <field-handle/>
    </name-field-handle>
    <counter-field-handle>
    <field-handle/>
    </counter-field-handle>
    <sequencing-policy-table></sequencing-policy-table>
    </sequencing-policy>
    </project-sequencing-policy>
    Platform is 10g
    <platform-name>Oracle10g</platform-name>
    The sequence is accessed through a synonym (since JDev couldn't seem to reference a sequence in a different schema from a user's login).
    <sequence-number-name>EVENT_SEQ_SYN</sequence-number-name>
    <uses-sequencing>true</uses-sequencing>
    When I commit my new object, I can see the insert statements in the log claiming a value of 'x' for the primary key. The row in the database actually has a primary key of 'y', where 'x = y - preallocation size' and 'y = sequence last number - preallocation size'. I think I would get the right number if I could set the preallocation size to 0 (performance problems understood) but TopLink chokes on this at run-time.
    Is this problem familiar to anyone?
    Failing using native sequencing, I tried to write custom SQL for the insert statement, but I couldn't find any decent examples anywere on how to do that. I found in a deep google search an example that showed you could use hash (#) to reference the value of a property, but what if the value that needs to be inserted in the database is held in an indirect referenced object? For example, if I was trying to write an insert sql for a Pet object with an indirect reference (valueHolder) to its owner, and I needed to put the owner id in the row - how would I write that insert statement in the 'custom sql' pane in workbench?
    Thanks for your help.
    Dave

    Very strange case.
    I tried to reproduce it using TopLink Employee example - and couldn't.
    Here's the code:
        //  to get debug info
        session.setLogLevel(SessionLog.ALL);
        session.login();
        UnitOfWork uow = session.acquireUnitOfWork();
        Employee emp = new Employee();
        emp.setFirstName("sequencingTest");
        uow.registerNewObject(emp);
        uow.assignSequenceNumber(emp);
        uow.commit();
        System.out.println("firstName = "+emp.getFirstName() +"; id="+ emp.getId());And here's the log:
    [TopLink Info]: 2006.01.26 04:49:05.734--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--TopLink, version: Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060116)
    [TopLink Config]: 2006.01.26 04:49:06.171--DatabaseSessionImpl(18)--Connection(19)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
         platform=>Oracle9Platform
         user name=> "test"
         datasource URL=> "jdbc:oracle:thin:@localhost:1521:orcl"
    [TopLink Config]: 2006.01.26 04:49:10.140--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:orcl
         User: TEST
         Database: Oracle Version: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
         Driver: Oracle JDBC driver Version: 10.1.0.4.0
    [TopLink Finest]: 2006.01.26 04:49:10.625--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequencing connected, state is Preallocation_NoTransaction_State
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence PROJ_SEQ: preallocation size 1
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence ADDRESS_SEQ: preallocation size 1
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence EMP_SEQ: preallocation size 1
    [TopLink Info]: 2006.01.26 04:49:11.453--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])-- login successful
    [TopLink Finer]: 2006.01.26 04:49:11.703--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--acquire unit of work: 48
    [TopLink Finest]: 2006.01.26 04:49:11.703--UnitOfWork(48)--Thread(Thread[main,5,main])--Register the new container bean Employee: sequencingTest
    [TopLink Finest]: 2006.01.26 04:49:11.734--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--Execute query ValueReadQuery()
    [TopLink Fine]: 2006.01.26 04:49:11.750--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--SELECT EMP_SEQ.NEXTVAL FROM DUAL
    [TopLink Finest]: 2006.01.26 04:49:12.328--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequencing preallocation for EMP_SEQ: objects: 1 , first: 3,469, last: 3,469
    [TopLink Finest]: 2006.01.26 04:49:12.328--UnitOfWork(48)--Thread(Thread[main,5,main])--assign sequence to the object (3,469 -> Employee: sequencingTest )
    [TopLink Finer]: 2006.01.26 04:49:12.328--UnitOfWork(48)--Thread(Thread[main,5,main])--begin unit of work commit
    [TopLink Finer]: 2006.01.26 04:49:12.421--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--begin transaction
    [TopLink Finest]: 2006.01.26 04:49:12.437--UnitOfWork(48)--Thread(Thread[main,5,main])--Execute query InsertObjectQuery(Employee: sequencingTest )
    [TopLink Finest]: 2006.01.26 04:49:12.625--UnitOfWork(48)--Thread(Thread[main,5,main])--Assign return row DatabaseRecord(
         EMPLOYEE.VERSION => 1)
    [TopLink Fine]: 2006.01.26 04:49:12.625--UnitOfWork(48)--Connection(39)--Thread(Thread[main,5,main])--INSERT INTO EMPLOYEE (EMP_ID, L_NAME, F_NAME, GENDER, END_DATE, START_DATE, MANAGER_ID, START_TIME, END_TIME, ADDR_ID, VERSION) VALUES (3469, NULL, 'sequencingTest', NULL, NULL, NULL, NULL, {t '09:00:00'}, {t '17:00:00'}, NULL, 1)
    [TopLink Fine]: 2006.01.26 04:49:12.640--UnitOfWork(48)--Connection(39)--Thread(Thread[main,5,main])--INSERT INTO SALARY (SALARY, EMP_ID) VALUES (0, 3469)
    [TopLink Finer]: 2006.01.26 04:49:12.781--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--commit transaction
    [TopLink Finer]: 2006.01.26 04:49:12.796--UnitOfWork(48)--Thread(Thread[main,5,main])--end unit of work commit
    [TopLink Finer]: 2006.01.26 04:49:12.796--UnitOfWork(48)--Thread(Thread[main,5,main])--release unit of work
    firstName = sequencingTest; id=3469
    If I understood correctly, the problem is x showing up in insert as a value to be assigned to PK and y actually inserted into the db. If that's the case could there be a BeforeInsert trigger on the table? To test try inserting through jdbc using concrete pk value.

  • How to create Parent and Children is a tree table / trigger sequence number

    How to create Parent and Children is a tree table when the primary key of the parent is generated via a trigger and a sequence number in the database?
    My problem is when I create a parent and then right away a children. The parent still not have a primary key until the transaction get to the database. I get a error when trying the create the children, cannot insert null in the foreign key field of the children.
    Please help.
    Stephane

    You should have the parent key be marked as a DBSequence type.
    Then you should have the association between the master and detail defined as composite association to make sure that the posting order to the database is correct.
    http://download.oracle.com/docs/cd/E24382_01/web.1112/e16182/bcentities.htm#BABFECDJ

  • File sequence  number in a Flat file

    Hi,
    I am working on Idoc to file scenario wherein my output file will have a sequence number assigned to each level.
    there are 4 levels and hence 4 sequence number to be genearted and its values should also have the same sequence number.
    i am doing this just by using Counter function.
    But when i am getting  a multiple detail records, for each detail record(0040) level its keep incrementing.but it should have the same value what its level has.
    for ex:
    ALPHAMER AS2 E5 710 20114806124829 01.00   
    0000 00000000 20100102 V3.0 SORD CZ1
    0010 00000001 76767 123 100 WER Constant BNG 560011 RAJ WERR     560011    BTM   X EN RT
    0020 00000001 TYUIOP
    0040 00000001 8765 6532 200 45 10 WE 20 AG
    0040 00000002 8765 6532 200 45 10 WE 20 AG
    0040 00000003 8765 6532 200 45 10 WE 20 AG
    0040 00000004 8765 6532 200 45 10 WE 20 AG
    9999 99999999
    It has to be like this.
    ALPHAMER AS2 E5 710 20114806124829 01.00   
    0000 00000000 20100102 V3.0 SORD CZ1
    0010 00000001 76767 123 100 WER Constant BNG 560011 RAJ WERR     560011    BTM   X EN RT
    0020 00000001 TYUIOP
    0040 00000001 8765 6532 200 45 10 WE 20 AG
    0040 00000001 8765 6532 200 45 10 WE 20 AG
    0040 00000001 8765 6532 200 45 10 WE 20 AG
    0040 00000001 8765 6532 200 45 10 WE 20 AG
    9999 99999999
    Can someone help me in achieving this.
    Regards

    Hi there,
    Just to try out from a different view, the following case could be implemented if the pre-requiisites are satisfied:
    Pre-requisites:
    1) The element that carries a primary factor, let us say, '8765' from your example.
    2) Functionally there is an element in your header item that relates the line items under it.
    My understanding of your example:
    1) Line items present for 00, 10, 40
    2) Line item 30 absent in the series
    Proposal:
    Map source field (the one that is arelating factor, here the one that carries '8765') -> INDEX (start by 0, increment by 1) -> multiply by one.
    INDEX standard function property: Donot Reset for every context;
    Srikanth Srinivasan
    Edited by: Srikanth Srinivasan on Jan 10, 2011 11:02 AM

  • 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

  • Multiple email addresses against Vendor. What is the ID / sequence number?

    We have a particular vendor with multiple e-mail addresses. These can be viewed via XK03, looking at the address details of the vendor and expanding the e-mail address.
    What I see for one particular vendor are two lines, each with a different e-mail address.
    Line one has a radio button (standard number) selected, has some text saying ' Remittance advice' and an ID of 001.
    Line two has a radio button unselected, has text saying 'PO' and an ID of 002.
    The problem that we have is that when PO's are e-mailed it sends it to the e-mail address on line 1 rather than line 2. Obviously this ID/sequence number is configured somewhere and I assume that the PO's somehow need to told to use ID 002 instead of 001, but where is this defined?.
    Jas

    SAP takes the email adress (fax number) that has the radio button for standard default.
    The text  ' Remittance advice'  is just a note which does not control anything, especially not that this one is taken for the  ' Remittance advice'  only and all others would use the second mail adress.
    If you want it different, then you have to code this yourself in an exit.

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

  • Error in mail sender channel : invalid sequence number

    Hello all,
    I'm having the following issue.
    I'm using the mail adapter to get messages from a mail server, which are attached to the mail.
    This interface is already productive, and is working fine most of the time.
    Only frequently I get the following error, which can be found in the java log.
    exception caught during processing mail message[630];
    java.io.IOException: the specified message not found: -ERR invalid sequence
    number
    This error seems only to appear when there are a lot of mails to be fetched.
    All the mail is read into PI and processed succesfully, only I also get a lot these errors.
    Does anyone know what causes this error?
    I also don't know where this sequence number is coming from, and what's the meaning of this.
    Is it possible it's trying to read the same mail more then once?
    The settings in the mail sender channel are:
    - transport protocol : POP3
    - message protocol : XIPAYLOAD
    - Use mail package : enabled
    - content encoding : none
    - Keep attachments : enabled
    - QOS : exactly once
    - Set adapter specific message attibutes : enabled
    The PI version is 7.01
    Thanks a lot in advance for the replies on this question.
    Kind regards,
    Marco van Iersel

    Hi
    Well we have used it with POP3 and it is working in the way as it should be.
    This feature is recommended  by sap when the number of emails to be read is large.
    You can set this additional parameter to restrict the number of mails fetched by sender mail adapter in one polling interval.
    Sometimes the mailbox configured for the sender mail adapter contains large number of unread mails, which exceeds the average expected number of mails in one polling interval. In such a case, processing of all the unread mails in the same polling interval by sender mail adapter degrades the system performance. To avoid this, set value of this parameter to the maximum number of mails to be fetched and processed in one polling interval. The remaining mails exceeding the limit would be processed in the next polling interval.
    That's why I have asked you to give it a try.

  • MT940 format on Statement Number/Sequence Number

    Hi Expert,
    I have the following EBS source file, which has 2 sequence numbers:
    As you can read that the section of :28C is the section of Statement Number/Sequence Number.  According to MT940 standard, as follows:
    This field contains the sequential number of the statement, optionally followed by the sequence number of the message within that statement when more than one message is sent for one statement.   The statement number should be reset to 1 on 1 January of each year.
    The sequence number always starts with 001. When several messages are sent to convey information about a single statement, the first message must contain '/001' in Sequence Number.
    One SWIFT message may contain up to 2000 characters.
    My source file's Statement Number/Sequence Number is correct, which caontains 1 statment (00006) and 2 sequence number which are: 00001 and 00002.  But during EBS upload using FF_5, system only managed upload first portion of the source file, and when come to second portion, 00006/00002, it always says ERROR: EBS (00006) already exist.
    But, based on MT940 standard, it should be OK.
    Therefore, does anyone have any idea why SAP FF_5 cannot handle the EBS source file upload?  Any further settings / configuration in order to hanlde Statement Number/Sequence Number?
    Thanks in advance
    sbmel

    Hello,
    I have encountered the same issue on MT940 with statement number/sequence number in field 28C.
    Our bank sends us MT940 into 17 separate files with sequence number for the same statement number (i.e. 13040/0001, 13040/0002..... and so on) while following the rule as below
    intermediate closing balance must have code :62M:
    and intermediate opening balance must have code :60M:
    finalclosing balance must have code :62F:
    and initial opening balance must have code :60F:
    However, the upload of first file in FF_5 terminated with error FV151 Termination in statement no.acct .... ; closing record 62F missing and subsequent files are with FV150 missing beginning record 60F.
    Would you please share your expertise on how you managed to make FF_5 accept these MT940 files with sequence number?
    Thanks in advance for your help on this.
    Regards
    Taro

  • Re-sequence number problem

    hi all
    i created two text items in form one for sequence number and other for non sequence, i want when i add 01 in non sequence item-text so the sequence number does not change and it should remain the same? is it possible plz help me out thanks in advance.
    sarah
    Edited by: SarahSarahSarah on Aug 30, 2009 12:37 AM

    here is the code:
    on key-commit trigger
    begin
    if
    :ins1.EDNO is null
    then
    SELECT sarahseq.NEXTVAL INTO :ins1.serial FROM DUAL;
    end if;
    :ins1.branch1 := :ins1.branch;
    :ins1.class1 := :ins1.class;
    :ins1.year1 := :ins1.year;
    :ins1.serial1 := :ins1.serial;
    :ins1.cno1 := :ins1.cno;
    :ins1.edno1 := :ins1.edno;
    :global.data := :branch || ' ' || :class || ' ' || :year || ' ' || :serial || ' ' || :cno || ' ' || :edno;
    commit_form;
    call_form ( 'c:\temp\plate no.fmx', no_hide, no_replace, no_query_only );
    END;
    sarah

  • How to create an INSERT trigger which creates a "sequence number"

    Imagine a table T_Q with columns C_1, C_2, C_3 and UN_123.
    C_1, C_2 and C_3 are all numeric and given by the user.
    UN_123 has to be a calculated sequence number starting by 1 and incremented by 1 for each combination of C_1, C_2 and C_3, i.e., the sequence number depends on the key values C_1, C_2 and C_3.
    Could anybody provide a code sample on how to create a BEFORE INSERT trigger , which calculates the value of the column UN_123 based on the values of C_1, C_2 and C_3 ??
    Premise: Rather than using any sequence, the trigger code should only be based on the table T_Q
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Rainer Wagner ([email protected]):
    Imagine a table T_Q with columns C_1, C_2, C_3 and UN_123.
    C_1, C_2 and C_3 are all numeric and given by the user.
    UN_123 has to be a calculated sequence number starting by 1 and incremented by 1 for each combination of C_1, C_2 and C_3, i.e., the sequence number depends on the key values C_1, C_2 and C_3.
    Could anybody provide a code sample on how to create a BEFORE INSERT trigger , which calculates the value of the column UN_123 based on the values of C_1, C_2 and C_3 ??
    Premise: Rather than using any sequence, the trigger code should only be based on the table T_Q<HR></BLOCKQUOTE>
    null

  • PO sequence number issue

    Dear Friends,
    I have the following requirement with my client in Purchasing module.
    My client is dealing with Raw Materials and Non-Raw Materials. They want to use one PO sequence number for Raw Materials and other sequence number for Non-Raw Materials. Also, every year they will start fresh sequence number for both Non-Raw Materials and Raw Materials.
    What would be the best solution to achieve this business scenario?
    Regards,
    Saravanan

    My client is dealing with Raw Materials and Non-Raw Materials. They want to use one PO sequence number for Raw Materials and other sequence number for Non-Raw Materials. Also, every year they will start fresh sequence number for both Non-Raw Materials and Raw Materials.
    What would be the best solution to achieve this business scenario?
    As far as i Know , there is only one sequence for PO, it could be handled with number entry and number type
    That is auto or manual for entry and numeric o alphanumeric for type
    And as far as your desired functionality is concerned, i think you can open a DFF at header level or do some other personalization.
    Maybe there is some way out for your functionality but i havent come across any such thing like that
    You shoul still do a little bit research or search it on google
    Please mark the reply as helpful or answered, whatever appropriate

  • FInding missing sequence number

    Dear All
    I have a column in table like this (actually its just a sample):
    TAB
    MMxxxx9988
    MMxxxx9990
    MMxxxx9995
    MMxxxx9998
    MMxxxx9999
    MMxxxx0000
    MMxxxx0001
    MMxxxx0003
    MMxxxx0004
    MMxxxx0005
    MMxxxx0008
    xxxx is variable
    last four digit is a sequence number start with 0000 and end with 9999.
    when the last four digit exceeds 9999 it reset to 0000
    My question is : how can we find the missing sequence number for that column.
    example:
    for the above table , it should give the below result:
    TAB
    MMxxxx9989
    MMxxxx9991
    MMxxxx9992
    MMxxxx9993
    MMxxxx9994
    MMxxxx9996
    MMxxxx9997
    MMxxxx0002
    MMxxxx0006
    MMxxxx0007
    Thanks

    One another way of doing it:
    For ease of verification, I have removed the records from 0001 to 9988.
    with data as
      select 'MMxxxx9988' col from dual union all
      select 'MMxxxx9990' col from dual union all
      select 'MMxxxx9995' col from dual union all
      select 'MMxxxx9998' col from dual union all
      select 'MMxxxx9999' col from dual
    --  select 'MMxxxx0000' col from dual union all
    --  select 'MMxxxx0001' col from dual union all
    --  select 'MMxxxx0003' col from dual union all
    --  select 'MMxxxx0004' col from dual union all
    --  select 'MMxxxx0005' col from dual union all
    --  select 'MMxxxx0008' col from dual
    select distinct col, nxt_val, substr(col, 1, 6) || to_char(st_with + level, 'fm00009') miss_seq
      from (
            select col, nxt_val, col_num st_with, nxt_col_num end_with
              from (
                    select col, lead(col) over (partition by substr(col, 1, 6) order by substr(col, -4, 4)) nxt_val,
                           to_number(substr(col, 7, 4)) col_num, to_number(substr(lead(col) over (partition by substr(col, 1, 6) order by substr(col, -4, 4)), 7, 4)) nxt_col_num
                      from data
             where abs(col_num - nxt_col_num) > 1
    connect by level <= (end_with - st_with) - 1
       and prior col = col
       and prior sys_guid() is not null
    order by col;
    COL        NXT_VAL    MISS_SEQ    
    MMxxxx9988 MMxxxx9990 MMxxxx09989 
    MMxxxx9990 MMxxxx9995 MMxxxx09991 
    MMxxxx9990 MMxxxx9995 MMxxxx09992 
    MMxxxx9990 MMxxxx9995 MMxxxx09993 
    MMxxxx9990 MMxxxx9995 MMxxxx09994 
    MMxxxx9995 MMxxxx9998 MMxxxx09996 
    MMxxxx9995 MMxxxx9998 MMxxxx09997 
    7 rows selected

  • 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

  • Count number of rows from oracle and sql database and generate a report

    Hi All,
    Can someone help me in writing a java program for the following scenario?
    1. Read the number of rows available from oracle table and print the total row count in a Report.txt text file.
    2. Read the number of rows inserted in a sql database (after a specific process-just an information) and print the total row count in the same text file Report.txt .
    3. Read the Error Log file (which is generated after a specific process say it has success and failed report for each iterations) and print the number of success and number of failure in the same text file Report.txt .
    I need the final Report.txt file in the following format:
    1. Oracle table <table name> has 500000 rows.
    2. After completion of the specific process 300000 rows were added to SQL table <table name>
    Error Log Report:
    300000 successfull entries and 200000 failed entries were found from the Error Log file.

    Thanks for your immediate reply.
    I'm just a beginner in java so if i make any mistake please correct and excuse me. :)
    This is the code i have for connecting to two different database.
    package connectDatabase;
    * @author
    import java.sql.*;
    public class ConnectTo
         public void OracleDB()
              Connection dbconn;
              try {
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                String connString="jdbc:oracle:thin:@SYS_IP:1521:oracl";
                dbconn = DriverManager.getConnection(connString, "uname","pwd" );
            catch(SQLException sqlex)
                 sqlex.printStackTrace();
            catch(Exception excp)
                excp.printStackTrace();
         public void SqlDB()
              Connection conn;
              try { 
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
                String url = "jdbc:odbc:connectDB"; 
                conn = DriverManager.getConnection(url,"uname","pwd");  
              catch (Exception e)
                System.err.println("An Exception occured! " +e.getMessage()); 
    }I'm just codding the second half which is for connecting to oracle databse and calculates the row count and displayes in the command prompt.
    then connects to SQL database and counts successfull insert in the table.(row count) and displayes on the command prompt.
    can you simplify the above code so that i can call the oracleDB() method and SqlDB() method seperately from another calss file using the object of this class?
    I'm ok if the report can be seen in a command prompt. FInally i need to calculate the success and failure count from the log file. will let you know once i'm done with codding.

Maybe you are looking for

  • Logical Systems for client 000 and 001

    I've just install solman 7.0 ehp1 sr1 and am going to create a new client from 001. Do I need to create logical systems for clients 000 and 001? Do I need to creat rfc's for these? Thanks, Daniel

  • Upgraded  2007 to 8.8 PL15 and get error message when opening sales orders

    Hi ,  I have upgraded an SBO system from 2007 to 8.8, PL15 and I get an error message whenever I recall a sales order entered after June 9th 2010.  I do not get any error messgas on orders before that date.  I can add new order no problem.   Teh erro

  • Ipad mini wifi problems

    I've changed my wifi password, but my ipad mini still remember the old one. Therefore, I cannot connect to wifi, but my mac book is okay with it. I tried to reset the internet settings, but my ipad mini doesn't allow me to verify my password!

  • Cannot sync my iPhone to my exchange server!

    I keep getting the same message over and over, "Cannot Get Mail The connection to the server failed." I need some help getting either my phone or the exchange server configured right.

  • Typewriter function

    I have templates saved. When i edit using the typewriter function and add a stamp signature some users I e-mail to cannot see changes. I know I can print to to pdf and save but is there another way?