Equivalent of DB2 Journal

Can the DB2 UDB Journaling be considered similar to redo logging in Oracle database?

According to http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Fsqlp%2Frbafyjourg.htm
>
Journaling
The DB2 UDB for iSeries journal support supplies an audit trail and forward and backward recovery. Forward recovery can be used to take an older version of a table and apply the changes logged on the journal to the table. Backward recovery can be used to remove changes logged on the journal from the table.
>
In Oracle there is Online Redo Log and Archived Log as a continuation of the first.
Online Redo Log is always there. Archived Log you may turn on if you need point in time or complete recovery from backups taken quite far in past.
Online Redo Log and Archived Log are global. You can PIT recover entire database, not just some table.
If you need to point in time recovery of just one or another table, or select data as of some past point in time from the table or tables, there is Oracle Flashback (http://www.oracle.com/technetwork/database/features/availability/flashback-overview-082751.html).
It is configured globally, not for each table.
So, for migration DB2 Journals do not really matter, because Oracle already embeds tools for different kinds of recovery.

Similar Messages

  • Equivalent of DB2  functions in ORACLE 11g

    Hi,
    I am trying to convert the SQL queries written in DB2 to ORACLE. There are some db2 specific functions are used in the queries.I am not able to find the equivalent function in ORACLE. The function names are written below:
    1) DateDD()
    2) SELECT @@IDENTITY
    3) SELECT *
    FROM (
    SELECT ROWNUMBER() OVER() AS rowId_1, INNER_TABLE.*
    FROM (----)as innertable
    ) AS Outertable
    Error is: ROWNUMBER is INVALID identifier.
    4) DAYOFWEEK()
    5) DAYS()
    6) dayofyear()
    Please help me in finding the equivalent function in ORACLE.
    Thanks in advance!!

    You probably don't need a DateAdd function in Oracle. You can add a number to a date in Oracle-- that adds the number of days to the date.
    SELECT sysdate today, sysdate+1 tomorrow
      FROM dualWhy are you using DAYS()? If, as in the example, you're just trying to determine the number of days between two dates, you can subtract dates in Oracle and the difference will be a number of days (including a fractional component if applicable)
    SELECT date '2011-09-27' - date '2011-09-25' difference_in_days
      FROM dualIf you really need the number of days since January 1, 0001, you could subtract the date from Jan 1, 0001, i.e.
    SELECT date '2011-09-27' - date '0001-01-01'
      FROM dualI would assume that Oracle and DB2 would return the same number but there could well be some differences since the current calendar didn't exist in the year 1 and I know there were issues in the transition from the Gregorian to the Julian calendar where some days were decreed not to exist. It wouldn't shock me if Oracle and DB2 counted some of the days in the 1500's differently.
    Justin

  • Oracle equivalent of DB2 DIGITS function

    IBM DB2 has a DIGITS SQL function that returns a character-string representation of a number, with the following properties:
    The result of the function is a fixed-length character string representing the absolute value of the argument without regard to its scale. The result does not include a sign or a decimal character. Instead, it consists exclusively of digits, including, if necessary, leading zeros to fill out the string.
    For example, for a NUMBER(6,2) column with value -6.28, the string '000628' is returned.
    Is there an equivalent SQL function available in Oracle 10g? Or if there's no equivalent, how can this be done in Oracle 10g?

    So, looks like behavior of DIGITS function depends not only on the value of the parameter passed, but also on the datatype of the actual parameter (implicitly derived from the datatype of the column name being passed).
    In other words, you can not simply call DIGITS (-6.18) because the result could be different for different precision/scale combinations:
    NUMBER(6,2) -> 000618
    NUMBER(3,2) -> 618
    NUMBER(6,3) -> 006180
    I don't think Oracle has a mechanism of accessing the datatype of the actual argument from within the function (?)
    So, you would need to pass the precision and scale of the argument datatype separately:
    create or replace function digits (n number, precision number, scale number) return varchar2 as
    begin
    return lpad (abs(n)*power(10,scale),precision, '0');
    end;
    SQL> select digits (-6.18, 6, 3) from dual;
    006180
    SQL> select digits (-6.18, 3,2) from dual;
    618
    SQL> select digits (-6.18, 6,2) from dual;
    000618
    To replace DIGITS in your DB2 code, you would need to build a conversion that would look up the precision and scale of the column for each call and substitute them into the call accordingly.

  • Decimal equivalent of db2 in oracle

    Hi
    I have query in db2 which has decimal in bother operands
    select decimal(fuelused)/decimal(fuelconsumed) from fuel.
    can anyone please help me what would be the sql (oracle) equivalent for that.
    Thanks
    Smitha.

    3. Week_ISO which gives week of the year.to_char(date_column, 'YYYYWW') is what I think is the equivalent. Check
    SQL> ed
    écrit fichier afiedt.buf
      1  select to_char(to_date('01012005','DDMMYYYY'),'YYYYWW'),
      2         to_char(to_date('01012005','DDMMYYYY'),'YYYYIW')
      3* from dual
    SQL> /
    TO_CHA TO_CHA
    200501 200553
    SQL> WW is week number from 1 (first january) to 53.
    IW is ISO week number : in this case, there is an error, the 1st january 2005 is the 52d week of year 2004. Check the doc :
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/sql_elements4a.htm#36369
    Nicolas.

  • How to track modification of PK for JKM DB2/400 Journal Simple

    Hi gurus,
    Updating Primary key cannot propagate to target table using cdc with JKM DB2/400 Journal Simple.I find a tuple of new primary inserts into target table without deleting the old one.Is there any customized SAVPGM**** for PK modification in DB2/400?
    CDCRTVJRN: SAVPGM0106,SAVPGM0107
    Thanks,
    nan

    Thanks to all for assistance. It turns out that the 10 character limit, about which the server people warned me, isn't an issue with my ODBC connection. The invalid token error was being caused by some missing qualifiers in the generated sql which caused appearances of ".tablename" rather than "tablename" and other similar. I was able to modify the knowledge module to eliminate this issue and the CDC worked correctly on my first test.

  • Equivalent of this db2 syntax in oracle?

    Can somebody please tell me what is the equivalent of the following in oracle:
    SELECT X.*
    FROM XMLTABLE (xmlnamespaces (DEFAULT "http://posample.org"),
    'db2-fn:xmlcolumn("CUSTOMER.INFO")/customerinfo'
    COLUMNS "CUSTNAME" CHAR(30) PATH 'name',
    "PHONENUM" XML PATH 'phone')
    as X
    I took this from http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.apdv.embed.doc/doc/c0023903.htm.
    Thx!

    SELECT X.*
    FROM XMLTABLE
    xmlnamespaces (DEFAULT "http://posample.org"),
    '/customerinfo' passsing "CUSTOMER.INFO"
    COLUMNS
    "CUSTNAME" VARCHAR2(30) PATH 'name',
    "PHONENUM" XMLTYPE PATH 'phone'
    ) x

  • The equivalent code for dbms_output.put_line on DB2

    Its very urgent, plz tell me the equivalent code for dbms_output.put_line on DB2
    thank u,
    Abhilasha.

    And on Sybase ?
    You can perhaps ask this one into the good forum.
    Nicolas.Hallo Nicolas,
    I can imagine the reaction on DB2 forum "dbms_output ? put_line ?
    What is this ?" No way :-))
    Regards
    Dmytro

  • Oracle equivalent of DECRYPT_CHAR() in DB2

    Dear All,
    We are working in a migration project. We are migrating ODI interfaces from DB2 to Oracle.
    The function DECRYPT_CHAR() is used in one of the procedure script. I could not able to find oracle equivalent of DECRYPT_CHAR() function.
    Could you anyone please provide any pointers on this.
    Thanks a lot in advance.

    Hi,
    As per my experience, there is NO direct function reside for this in Oracle, rather it has inbuild packages to do decryption and encryption but still you need to create a user defined function in your schema.
    Thanks,
    Guru

  • Equivalent parameter in Oracle for lock_timeout in db2

    Hello Guys,
    We are migrating from Db2 to Oracle database.
    I wanted to know what is the equivalent parameter in Oracle for lock_timeout in db2.
    Thanks in advance.

    I think there is no global prameter in Oracle, but you can determine a timeout for each statement or entire table
    select for update wait seconds
    Specify WAIT to instruct the database to wait integer seconds for the row to become available and then return control to you.
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#SQLRF55372
    Or Lock table for entire table
    http://docs.oracle.com/cd/E18283_01/server.112/e17118/statements_9015.htm
    DB2 locktimeout - Lock timeout configuration parameter
    This parameter specifies the number of seconds that an application will wait to obtain a lock, helping avoid global deadlocks for applications.
    If you set this parameter to0, locks are not waited for. In this situation, if no lock is available at the time of the request, the application immediately receives a -911.
    If you set this parameter to
    -1
    , lock timeout detection is turned off. In this situation a lock will be waited for (if one is not available at the time of the request) until either of the following:
    The lock is granted
    A deadlock occurs.
    Note: The value you specify for this configuration parameter is not used to control lock timeouts for event monitor target tables. Event monitors use a separate, non-configurable setting that will cause locks on event monitor tables to time out.
    Recommendation: In a transaction processing (OLTP) environment, you can use an initial starting value of 30 seconds. In a query-only environment you could start with a higher value. In both cases, you should use benchmarking techniques to tune this parameter.
    http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.admin.doc%2Fdoc%2Fr0000329.htm
    Regards

  • JDBC receiver adapter for AS/400 DB2

    Hi guys,
    We have developed an Idoc to JDBC scenario for inserting data in a Z-table of SAP R/3 that sits on an AS/400 DB2.
    When testing it, message Mapping is executed successfully, but in communication channel monitoring, we get the following error log:
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'ZSBU_MATERIALS' (structure 'STATEMENT'): java.sql.SQLException: [SQL0204] ZSBU_MATERIALS in SBU type *FILE not found.
    The Z-table name is correct. It seems to me that it needs something more (like a library name).
    Any ideas?
    Evaggelos

    Hi,
    There is a difference between db2..and db2 on as400 as on as400 db2 comes as part of the OS install itself..See if you can connect to db2 on the as400 system from qshell..
    If you really want to manually configure the connection via the DB2 command line, then you will need to enter catalog commands similar to the following:
       1. > db2 catalog tcpip node as400 remote as400.somecompany.com server 446
       2. > db2 catalog db as400db at node as400 authentication dcs
       3. > db2 catalog dcs db as400db as mydbsvr
    Where "as400db" is your local alias for the database and "mydbsvr" is the local RDB name of the AS/400 (set via WRKRDBDIRE).
    If you catalogued the DB2 for i5/OS server incorrectly, you may get an SQL5048N error message. SQL7008N is another common error is that the DB2 for i5/OS tables being accessed on the server are not being journaled. To correct the SQL7008N error, you need to start journaling your tables or change the isolation level to No Commit.
    Regards
    Ravi Raman

  • JKM DB2 400 column and table name 10 character limit

    I am trying to set up CDC on an iSeries. I have successfully loaded data with the LKM SQL to Oracle, and now I want to set up CDC for the table and am trying to use "JKM DB2 400" . I get invalid token errors when I try to start journalizing, and it appears to be the table and column names, used to set up CDC, which are more than the 10 character limit. Tables like SNP_JRN_SUBSCRIBER seem to come from the getJrnInfo function and other table and column names are hard coded. I want to copy the JKM and reduce all of the names to less than 10 characters.
    Where else are these names used? How does the interface know which table names to use when set to use only journalized data and how can I change it to use the new shorter names? Is there a better solution?

    Thanks to all for assistance. It turns out that the 10 character limit, about which the server people warned me, isn't an issue with my ODBC connection. The invalid token error was being caused by some missing qualifiers in the generated sql which caused appearances of ".tablename" rather than "tablename" and other similar. I was able to modify the knowledge module to eliminate this issue and the CDC worked correctly on my first test.

  • How to read char() for bit data DB2's type in Oracle?

    Hello,
    I am developing an application (from JDeveloper) to operate with two data base. In one hand threre is Oracle and in the other one DB2 (AS400).
    I am trying to read a DB2'sfield with the "char() for bit data" type from Oracle, but I can't read it.
    I have trying:
    rset.getObject(1) -->[B@1a786c3
    rset.getBinaryStream(1) --> java.io.ByteArrayInputStream@1a786c3
    rset.getAsciiStream(1) --> java.io.ByteArrayInputStream@2bb514
    rset.getCharacterStream(1) -->java.io.StringReader@1a786c3
    Do you have any solution to see the value of this type of field?
    Thank you and regards

    I have to synchronize unidirectionally from the Oracle database to DB2. And I'd like to save the information of the record of DB2 prior to the update operation.
    And here is where the problem arises for me, because when I try to read from Java with the connection established on DB2 is unable to interpret the information. While there are no problems from Oracle to consume the information, it happens that DB2 field types are not common with Oracle, such as char () for bit data. From what I could find the equivalent in Oracle would be raw (), but since Java is possible to read this type of information... And this is my doubt, it is necessary to do any type of cast or to do a special view to retrieve this information?

  • Is there a way to re-import a Journal into iPhoto?

    I created a Journal in iPhoto for iOS and published it to iCloud; but I am seriously running out of space on the iPad and would need to delete the Journal on the iPad. Thus I published it to iTunes, i.e. exported it through iTunes to my Mac and it appears there in a folder with the name of the journal. So far, so good.
    Now I would like to do some more editing of the Journal, but don't know how to "re-import" it into iPhoto (iOS) on the iPad.
    When I saved the files from iTunes to the Mac, they saved in a folder with the name of my Journal, but when I want to export them through iTunes back to the iPad, the export process does NOT accept the folder, but forces me to select individual files within this folder. Is this the right way (to choose all files in this folder), and will this work?  Or are there other apps (hopefully on the Mac) which allow to work on the iPad created Journal?
    Thanks for any ideas and advice. Cheers, from  Austria, Veit Burger

    Leonie,
    These are two very useful pointers, where and how on earth do you find these?
    I think I used both methods (iCloud and iTunes) for both the iPhone and the iPad-mini; but in neither method do I have a backup of the iPad of a timeslot that contained the correct Journal.   :-(((   (I also fear that exploring the TimeMachine backups of my iMac won't yield anything useful?!?)
    An earlier discussion, which I found, confirms your message above: once a Journal is deleted from your iOS device, it will ALSO be removed automatically from the iCloud server.  It's hard for me to accept this, or why this has to be so, but this seems to be the hard truth. The logical consequence of this seems to be: you can only create and PRESERVE Journals as long as they have space on your iOS device with which they were created. A puzzling, very puzzling, concept. If this is correct, it should explicitely be stated in the official Apple documents for iPhoto for iOS.   (With a somewhat equivalent app for OSX, the iWeb, I can publish as much as the WEBSITE holds, not limited by the space on my OSX device).   Truly puzzling.
    Thanks and kudos for all the help you provide in this Forum!
    Here is the posting by Wyodor of May10, 2012 in the iOS apps > iPhoto for iOS Discussion, under the Heading:
    iphoto on iPad and deleting journals only locally!
    QUOTE
    Wyodor
    Re: iphoto on iPad and deleting journals only locally! 
    May 10, 2012 9:11 AM (in response to wesdenaro)
    The question is : can you delete a journal on the device while keeping it on the iCloud server.
    The answer is no.
    The only way to preseserve a journal is to save it to iTunes and then publish it on your own server.
    How to : http://www.wyodor.net/iPhoto/Journal.html
    UNQUOTE

  • ODI can not capture RRN (rowid)  in DB2/iSeries

    HI, all . I found that we can not config ODI to get the RRN (rowid) when CDC by reading journal . Any idea ?

    Hi, Thanks for your reply . it's great help .Please help me with these concerns :
    1. If ODI can capture missed transaction journal ,they must know the last journal 's information of a table .where these information stored ? In ODI Reposistory ?
    2.For CDC , if the source database is restored by the backup set of yesterday .Can ODI re-synchronized these change to the target datase or we have re run Load data ?
    4.For journalling in DB2 , If the changes are created by a mirror tool from another DB2 database , does these changes are recorded in native journal ?
    3.We have a target table is partitioned by date time ranged , the data in the target table is OFFLINE if the data is <sysdate -90 .
    The source table in DB2 is not partitioned , data is fully ONLINE , if there are some DML happend in the data which older than sysdate-90 in the source table , how can these change reflect to the target table ?
    4.Can CDC installed in MySQL , we have several MySQL Database
    5. We would like to use native journal , not trigger in CDC for source database in DB2 . We found that there are some limitation of native journal , such as the number of primary key columns must be not exceed 16 .
    For a given physical file( a table) in DB2 , it has the number of primary key 's column are 18 ( dued to the designed is created in 2000) , we found some error when declare primary key in source table in ODI Designer .
    How can we overcome this limitation ?
    6.Can ODI capture TRUNCATE command in DB2 source database ?

  • DB2 to Oracle 11g migration

    Hi,
    We are migrating the siebel database from DB2 to Oracle 11g.
    While doing the migration, the following values are found for the siebel related tables on DB2.
    for example:
    CREATE TABLE S_SERVICE_SCRPT (
    ROW_ID NVARCHAR2(15) NOT NULL,
    CREATED TIMESTAMP(9) DEFAULT CURRENT TIMESTAMP NOT NULL,
    CREATED_BY NVARCHAR2(15) NOT NULL,
    LAST_UPD TIMESTAMP(9) DEFAULT CURRENT TIMESTAMP NOT NULL,
    LAST_UPD_BY NVARCHAR2(15) NOT NULL,
    MODIFICATION_NUM DECIMAL DEFAULT 0 NOT NULL,
    CONFLICT_ID NVARCHAR2(15) DEFAULT gx'00030' NOT NULL,
    NAME NVARCHAR2(75) NOT NULL,
    PROG_LANG NVARCHAR2(30) NOT NULL,
    REPOSITORY_ID NVARCHAR2(15) NOT NULL,
    Please can anybody provide inputs how to get the equivalent for these gx___ values on Oracle 11g.
    Many thanks in advance

    Found a suitable link at IBM:
    http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.sqlref/db2z_sql_declareglobaltemptable.htm
    gx is the hexadecimal graphic string constant - which is similar to our unistr function.
    Not sure which character is representated by 00030, but here's a method you can use to simply figure out the Oracle equivalent code point.
    First you need to figure out the DB2 character represented by the default value - let's assume it is '@'
    Assuming the NCHAR character set is UTF8 and the NLS character set is WE8MSWIN1252, then you can execute:
    select ascii('@') from dual;
    ASCII('@')
    64
    in SQL*Plus and you'll get the code point 64.
    Convert the 8bit code point to unicode using:
    SQL> select dump(convert(chr(64),'UTF8','WE8MSWIN1252'),16) from dual;
    DUMP(CONVERT(CH
    Typ=1 Len=1: 40
    and you can create the table with the default value represented by the hex value 0040:
    SQL> create table abc (col1 varchar2(20) default '@',
    2 col2 nvarchar2(20) default unistr('\0040'));
    Table created.
    SQL> insert into abc values (default,default);
    1 row created.
    SQL> select * from abc;
    COL1 COL2
    @ @

Maybe you are looking for

  • HOW TO IMPORT "archived.img" file to FCP X

    How to import an     "archived.img"     file from my movies folder to FCP X

  • Struts : checkbox status is unchanged if i use back button and uncheck it.

    hi I have a couple of checkboxes in a jsp page used in struts framework. I am using DynaValidatorForm as form bean with session scope, so it means the properties are mapped only in the struts-config.xml. the checkboxes' property names are checkbox1 a

  • Can i add my product to XI

    Hello, i have to add few products with SWCV to Integration server(Business System). This system is listed by default with NW product and some swc. Can i add mine to this. I am trying to use mu XI as business system and configure my scenario. Thanks,

  • Can't update the latest CC app (April 2015 - Photoshop CC2014 & BridgeCC)

    Hi, I use Macbook with latest OS updated. I can't update the latest app (April 2015 - Photoshop CC2014 & BridgeCC). Every time i've tried, the error occurred as you can see images attached. I've also tried uninstall and reinstall both apps, but same

  • Handle Custom Exception messages in EJB 3.x

    Hi I would like to know the process to follow in order to handle CustomException as in example the following code used within the Satteless / statefull /Message EJB's may be *if(user.account.value <= 100){* throw new EJBHanldleException("1001") where