Sybase Timestamp in Oracle

Hi,
I am in the process of migrating Sybase database to oracle 10g.
In Sybase there is a column exist in most of the tables with datatype Timestamp, the data looks like 0x467469786abfc324, this is automatically generated while inserting or updating a table.
Is this equivalent to rowid in Oracle? or please suggest a equivialent solution in oracle.
Thanks,
DJ

Yes. The Sybase Timestamp is essentially a surrogate row identifier and should not be moved into Oracle.
In Oracle, especially with newer technologies such as Advanced Compression, we enable and expect row movement so it is rowids
should not be treated as static. If you need a surrogate key then create a SEQUENCE object and use that to generate the surrogate key.

Similar Messages

  • Migrating Sybase "timestamp" data type to Oracle DB

    Hi,
    We are migrating huge Application currently running on Sybase database
    to Oracle 10.2.0.3 (500+ Tables and Stored Procedures).
    Have following questions regarding this Migration.
    1) Many of the Sybase Tables have column which is of Sybase data type "timestamp".
    Do you have any recommendation what is the data type to be used in Oracle for
    migrating "timestamp" data type in Sybase?
    2) How should we migrate existing data and business logic residing in Sybase for
    data columns of Sybase data type "timestamp" ?
    Given below are details on how we use Sybase timestamp Column in our Application
    and we are trying to arrive at the best Solution that is possible for migrating
    all those Tables and related business logic to Oracle.
    We have following Control Table in Sybase which has column of timestamp data type and
    some other Business keys.
    sp_help EQP_IES_CRE_TIMESTAMP (This is similar to desc <table> command in Oracle)
    EQP_IES_CRE_TIMESTAMP,dbo,user table
    default,Nov 14 2001 10:39AM
    CRE_TIMESTAMP ,timestamp,8,,,0,,,,0
    REF_NUM ,char,30,,,0,,,,0
    REC_UPD_DT ,datetime,8,,,1,,,,0
    EQP_IES_CRE_TIMESTAMPI1,clustered, unique located on default, CRE_TIMESTAMP, REF_NUM, REC_UPD_DT,0,0,0,
    Following is the overall logic used in Sybase
    -- Step 1: Based on Event, populate Control Table with new Row.
    -- CRE_TIMESTAMP timestamp Column gets auto-populated by Sybase
    insert EQP_IES_CRE_TIMESTAMP (REF_NUM, REC_UPD_DT)
    values (@uuid_ref_num, @event_cre_dt)
    Since CRE_TIMESTAMP is auto-populated, it does not appear in above INSERT statement.
    -- Step 2: Store timestamp value populated by Sybase in previous step,
    -- to variable @event_timestamp. This value would be referenced
    -- later in other SQL statements
    select @event_timestamp = CRE_TIMESTAMP
    from EQP_IES_CRE_TIMESTAMP
    where REF_NUM = @uuid_ref_num
    and REC_UPD_DT = @event_cre_dt
    -- Sample value for @event_timestamp could be '001c0000182f2089'
    -- It is not very readable or understandable
    -- Step 3: Delete Control Table entry made in Step 1
    delete EQP_IES_CRE_TIMESTAMP from EQP_IES_CRE_TIMESTAMP
    where CRE_TIMESTAMP = @event_timestamp
    -- Step 4: Make use of saved timestamp value from Step 2 to trigger queries
    -- against other Tables that have timestamp Columns
    -- Some sample queries are as shown below
    delete eqp_staging
    where event_timestamp > @event_timestamp;
    insert into eqp_movement values(@event_timestamp, ......other columns) ;
    Any idea how above Table and logic could be migrated to Oracle DB
    We would also like to know how data values that currently exist
    in Sybase Tables should be populated in Oracle .
    Any suggestions or tips would be greatly appreciated
    Thanks
    Auroprem

    Hi All,
    Thanks for your responses.
    We have decided on Solution to migrate "timestamp" Column from Sybase to Oracle, that is
    specific to our Application needs.
    Following is what we decided:
    1) Create RAW Column in Oracle which would contain data Replicated from Sybase "timestamp" Column as is.
    2) Create additional Column of INTEGER data type to store number equivalent of Sybase "timestamp" column
    which would be more usable and consummable in Oracle as compared to RAW datatype.
    3) Write Row-Level INSERT/UPDATE Trigger on migrated Oracle Table to populate INTEGER Column using
    SQL Function TO_NUMBER(<raw_column_value>, 'xxxxxxxx').
    4) Applications that access this Table, upon migration to Oracle, will now start referencing INTEGER Column
    newly defined, and populated via Trigger.
    Please let us know if you see any issues with this approach
    Thanks
    user641521

  • Sybase timestamp

    Hi,
    How do i convert a sybase timestamp into a concentional oracle date format?
    thanx in advance

    in sqlldr control=ctl.ctl
    put 4 spaces in the format
    ctl.ctl :
    column_name date(23) "yyyy-mm-dd hh24:mi:ss "

  • Timestamp in oracle 8i

    Hi,
    Can anybody tell me, how can I implement Timestamp in Oracle 8i? What data type should I use and how to insert current Timestamp when an insert occurs?
    Thanx in advance.
    Nitin

    Well , no one needs to laugh on anyone's response. That could be because the way you explain was not clear enough. Nitin , whats the problem you are getting ? Do you want to use timestamp in Oracle ?

  • Problems with Sybase 12 to Oracle 10g migration

    Hi,
    I'm using SQL Developer to test a migration between Sybase and Oracle and it doesn't work (both online and offline)
    I've create a dedicated user account and connection, with the roles and privileges required (as seen in http://download.oracle.com/docs/cd/B32485_01/doc/appdev.110/b31695/migration.htm#i1005739)
    I've created the migration repository without any problems (using the above user account).
    QUICK MIGRATION
    - select the source Sybase connection: OK
    - select the target Oracle connection: OK
    - select the referential: OK
    - verify privileges before migration: OK
    - migrate tables only and click Next
    ## window closes and nothing happens ## - nothing on Captured Model pane
    CAPTURE SOURCE SYBASE DATABASE
    - right click on the Sybase connection in the Connections pane
    - choose Capture Sybase
    ## window closes and nothing happens ## - nothing on Captured Model pane
    OFFLINE CAPTURE
    - create database capture scripts: OK
    - launch the database scripts (SYB12_OFFLINE_CAPTURE.BAT): OK
    - load database capture script output (sybase12.ocp)
    ## window closes and nothing happens ## - nothing on Captured Model pane
    I can't find any relevant logs or trace from the application.
    I even tried to use the capture file sybasemigration.zip from the "Migrating a Sybase Database to Oracle Database 11g" web page (http://www.oracle.com/technology/obe/hol08/sqldev_migration/sybase/migrate_sybase_otn.htm), but the result was the same.
    Does anyone encountered the same problems? Does someone knows where are the logs (if any)?
    Thanks in advance.
    Regards,
    Pedro

    Hi Pedro,
    What version of SQL Developer are you using?
    Can you browse your Sybase connection in SQL Developer, to see its tables for example?
    If not, then you may need to point SQL Developer to your JTDS 1.2 driver again.
    Are you capturing a non system database ? SQL Developer wont migration master or tempdb ...
    Can you try running SQL Developer from the command line and watch the command line for any errors during the capture.
    \sqldeveloper\bin\sqldeveloper.exe
    Regards,
    Dermot
    SQL Developer Team

  • How to use a Sybase table in Oracle SQL statement?

    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.

    user12088323 wrote:
    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.Any Oracle client connected to the Oracle database can access Sybase data through the <font style="background-color: #FFFFCC">Database Gateway for Sybase</font> (it requires an additional license) or the <font style="background-color: #FFFFCC">Database gateway for ODBC</font> (it's free).
    The Oracle client and the Oracle database can reside on different machines. The gateway accepts connections only from the Oracle database.
    A connection to the gateway is established through a database link when it is first used in an Oracle session. In this context, a connection refers to the connection between the Oracle database and the gateway. The connection remains established until the Oracle session ends. Another session or user can access the same database link and get a distinct connection to the gateway and Sybase database.
    Database links are active for the duration of a gateway session. If you want to close a database link during a session, you can do so with the ALTER SESSION statement.
    To access the Sybase server, you must create a <font style="background-color: #FFFFCC">database link</font>. A public database link is the most common of database links.
    SQL> CREATE PUBLIC DATABASE LINK dblink CONNECT TO
    2  "user" IDENTIFIED BY "password" USING 'tns_name_entry';
    --dblink is the complete database link name.
    --tns_name_entry specifies the Oracle Net connect descriptor specified in the tnsnames.ora file that identifies the gatewayAfter the database link is created you can verify the connection to the Sybase database, as follows:
    SQL> SELECT * FROM DUAL@dblink;
    Configuring Oracle Database Gateway for Sybase
    <font style="background-color: #FFFFCC">{message:id=10649126}</font>

  • Migrating Sybase code to Oracle 11g

    Hi All,
    We have to migrate Sybase code to Oracle 11g.
    When we are doing a SELECT .. INTO in Sybase , even if the query is returning more than 1 row , sybase selects 1 of the rows and populates the variables.
    But while migrating this code to oracle, we are getting TOO_MANY_ROWS Exception.
    We need to migrate the code from SYBASE to ORACLE without disturbing the logic.
    Can someone please tell me the logic applied by SYBASE to pick up the record?
    And if someone has faced this issue, then what can be done to resolve this.
    Regards,
    Riddhisha Khamesra

    The result 3 is the last entered record (not the amount of records..).
    So the first approach to write a dummy procedure that will select all records in Oracle like:
    CREATE OR REPLACE PROCEDURE last_record
    v_arg1 OUT NUMBER
    AS
    BEGIN
    SELECT col1
    INTO v_arg1
    FROM tt_tmp ;
    END;
    and hopefully returns only the last record will fail with:
    SQL> variable outvar number
    SQL> exec last_record (:outvar)
    BEGIN last_record (:outvar); END;
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "SYSTEM.LAST_RECORD", line 9
    ORA-06512: at line 1
    One possible approach to get the last (and only the last) record that was entered into the table is to use rownum:
    The select might look like "select col1 from (select col1, rownum from tt_tmp order by rownum desc) where rownum=1;"
    So the procedure can be coded as:
    CREATE OR REPLACE PROCEDURE last_record
    v_arg1 OUT NUMBER
    AS
    BEGIN
    SELECT col1
    INTO v_arg1
    from (select col1, rownum from tt_tmp order by rownum desc) where rownum=1;
    END;
    Now calling it in SQL*Plus:
    SQL> variable outvar number
    SQL> exec last_record (:outvar)
    PL/SQL procedure successfully completed.
    SQL> print :outvar
    OUTVAR
    7
    The value 7 is the last record I've inserted into my tt_tmp table:
    SQL> select * from tt_tmp;
    COL1 COL2
    1 1
    2 2
    8 8
    7 7

  • Migration from sybase 11 to Oracle 9i

    Hi,
    I have to migrate all db objects (tables structures,table data,triggers,sp) from Sybase 11 to Oracle 9i
    There are currently two free tools -
    Migration workbench (http://www.oracle.com/technology/tech/migration/workbench/index.html )
    and
    SQL Developer( http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html )
    for this purpose.
    SQL developer has a provision to convert scripts which I can use for SPs and scripts one @ a time.
    Problem is migrating table structures along with data.
    from SQL developer I can't connect to sybase thou I provide all the details and from workbench in the online mode I need the sa login which is not possible as the database is live and @ client side.
    SQL Loader can be used but will require to make CSV files from each sybase table and hence is time consuming.

    Hi,
    Migration Workbench is not available for Sybase database.
    As you can see on this website:
    http://www.oracle.com/technology/tech/migration/workbench/files/mig_rel10104.html
    Only Informix and DB2 database are supoprted now with this product.
    With SQL Developer, we only support last versions of Sybase : V12 and V15.
    As you don't have any remote access to your client database and no SA login , the best way would be :
    ==>to get and export from Sybase 11.
    ==>install a V12 somewhere (on your site , you can download the Sybase V15 )and import the Sybase database
    Then SQL developer can migrate quickly your database without any problem.
    I hope it helps you.
    Mireille

  • Sybase NULL to Oracle - Error with Fail

    Hi,
    We are doing migration from Sybase 12 to oracle 9i using Oracle Migration Work Bench . Though we are able to successfully perform the migration , with all object count matching once migrated. When we launch our peoplesoft application on top of the migrated database and start browsing thru it, it throws up error like “Error: PS_ABSENCE_HIST - Alter failed due to an unknown column type (CLOB) found for field COMMENTS. (76,22)”. Though the actual datatype value of this column in Sybase is text and when we try to migrate it defaults to CLOB.
    The same we try to migrate thru peoplesoft provided tool datamover, the column datatype is LONG. But now we mapped the datatype value of text to long and started migrating . At this point, where Sybase value is NULL, Oracle Migration Work Bench is not able to insert data for such value.
    Any idea of how to resolve this issue.
    [email protected]

    venuhi,
    At this point, where Sybase value is NULL, Oracle Migration Work Bench is not able to insert data for such value.There is a difference between sybase and oracle in terms with dealing with nulls, in oracle an empty string is null. The workbench can be configured to put a string in place of a null, such as a single space.
    What specifically is going wrong for you in your use of the workbench, is it replacing null with a single space, or is the tool stopping, and if the tool is stopping, what is the output of the error on the screen and the results of Error.log file. Enough details should be available to write a reproducible testcase and log a bug.
    Regards,
    Turloch
    Oracle Migration Workbench Team.

  • Migrating table from Sybase 12 to Oracle 10g

    Hi ,
    We have a situation where we have to migrate multiple Sybase databases to Oracle10g . These multiple database have same set of tables but different data in these tables on each sybase database ( data differ, based on location or region wise but same table name and structure). We want to migrate all these sybase database to Oracle 10g and in single database, which involves inserting data from multiple tables ( though they exist on different database in sybase) into single Oracle table.
    for example if we have a table 'TESTK' that exist on five different sybase database but with different region wise data. I want to bring data from these five tables( Five as they exist in five differet sybase databases) and insert them into a single oracle table 'TESTK' .
    Have anybody ever face such scenerio , what are all possible approch please suggest. Once data is inserted into oracle table i need to partitioned this oracle table as well.

    It is not quite clear whether you have multiple tables (referencing each other) in multiple sybase databases or either one table or several non connected tables in multiple sybase databases.
    In the first case of course your task is harder because you need to keep references and most probably you cannot blindly copy data from db 1, db 2 and unite them because they can have the same id's coming from different sources.
    In the second case your task of course is much easier you can simply load all your data in Oracle tables either using some interim tables (if you need to filter out duplicates) or load data straight into target tables if you are sure you haven't duplicates.
    Also another question in case 1 is whether intersection of your data is 0 rows i.e. all data are completely different in each source db or not.
    So I'm sure you can find tools for blindly moving data from sybase to Oracle, although if you need to do some more complex filtering, computation or whatever you most probably need to write it yourself.
    I'v done a few data conversion projects from one schema to another and as the requirements were quite complex the only possibility for us was to initiate a separate data conversion project and create conversion software (pl/sql packages manually).
    You can find an overview of our approach in my article "Data migration from old to new application: an experience" here http://www.gplivna.eu/papers/legacy_app_migration.htm
    Gints Plivna
    http://www.gplivna.eu

  • Migration from Sybase 11 to Oracle 8i

    I am trying to migrate a Sybase DB to Oracle 8i. The platform of Sybase system is VMS and Oracle is UNIX. Can I use workbench to migrate between two different platform?
    If not, is it the only way to export sybase to a flat file and then load to Oracle using SQL loader?
    Thanks

    Hi,
    Migration Workbench is not available for Sybase database.
    As you can see on this website:
    http://www.oracle.com/technology/tech/migration/workbench/files/mig_rel10104.html
    Only Informix and DB2 database are supoprted now with this product.
    With SQL Developer, we only support last versions of Sybase : V12 and V15.
    As you don't have any remote access to your client database and no SA login , the best way would be :
    ==>to get and export from Sybase 11.
    ==>install a V12 somewhere (on your site , you can download the Sybase V15 )and import the Sybase database
    Then SQL developer can migrate quickly your database without any problem.
    I hope it helps you.
    Mireille

  • Sybase ASE to Oracle 11g conversion

    Hi,
    Can anyone please look at the following Sybase ASE to Oracle 11g conversion - the top remarked code is the original Sybase version and the two UPDATE blocks below are hopefully doing the same task... What I need to know is if there is a more simple (less code change) way of doing the same task, either as a single UPDATE or preferably even more similar to the original Sybase code..?
    -- /* now apply allocations */
    -- update diary_items
    -- set id_user = ia.id_user ,
    -- tx_icon_user = 'urlcats:/user_grey.gif?method:getAllocationInfo'
    -- from diary_items di,
    -- item_allocation ia
    -- where di.id_diary_item = ia.id_object
    -- and ia.id_object_type = 'W'
    -- and ia.id_user != 'autocats'
    -- OK!
    -- ??? Need to check if second UPDATE which is the same as above is required again...
    /* now apply notes */
    UPDATE diary_items
    SET diary_items.tx_icon_user =
    ( SELECT 'urlcats:/user_grey.gif?method:getAllocationInfo'
    FROM item_allocation
    WHERE item_allocation.id_object = diary_items.id_diary_item )
    WHERE EXISTS
    ( SELECT item_allocation.id_object
    FROM item_allocation
    WHERE item_allocation.id_object = diary_items.id_diary_item
    AND item_allocation.id_object_type = 'W'
    AND item_allocation.id_user != 'autocats' )
    UPDATE diary_items
    SET diary_items.id_user =
    ( SELECT item_allocation.id_user
    FROM item_allocation
    WHERE item_allocation.id_object = diary_items.id_diary_item )
    WHERE EXISTS
    ( SELECT item_allocation.id_object
    FROM item_allocation
    WHERE item_allocation.id_object = diary_items.id_diary_item
    AND item_allocation.id_object_type = 'W'
    AND item_allocation.id_user != 'autocats' )
    Many thanks!!!
    Edited by: 881552 on 25-Aug-2011 04:39

    I managed to work it out in the end - here's the solution...
    /* now apply allocations */
    update diary_items
    set ( id_user,
    tx_icon_user ) =
    ( select ia.id_user,
    'urlcats:/user_grey.gif?method:getAllocationInfo'
    from diary_items di,
    item_allocation ia
    where di.id_diary_item = ia.id_object
    and ia.id_object_type = 'W'
    and ia.id_user != 'autocats'
    )

  • Unix timestamp to Oracle timestamp conversion

    Hi all,
    I am trying to convert the UNIX timestamp to ORACLE timestamp .
    I have done like this upto now.
    CREATE OR REPLCACE FUNCTION unixts_to_oraclets(unixtimestamp IN INTEGER)
    RETURN DATE IS
    result DATE;
    BEGIN
    result := TO_DATE('1970-01-01', 'YYYY-MM-DD') + numtodsinterval(unixtimestamp, 'SECOND');
    return(result);
    end unixts_to_oraclets;
    now i have run this query
    SQL> select unixts_to_oraclets(1139291114) as TS from dual;
    TS
    07-FEB-06
    now i need the ouput to like this 07-FEB-06 01:10:12
    for that i have done like this:
    DECLARE
    v_date DATE;
    res_date DATE;
    BEGIN
    SELECT from_uts(1139291114)INTO v_date FROM dual;
    SELECT TO_TIMESTAMP(v_date,'DD-MON-RRHH24.MI.SS.FF') INTO res_date FROM dual;
    DBMS_OUTPUT.PUT_LINE(res_date);
    END;
    but the output is :
    SQL> /
    07-FEB-06
    PL/SQL procedure successfully completed.
    why is that it is not printing 07-FEB-06 01:10:12 ?
    how should i moodify the code to get the desired output.
    please help me i this regard
    Trinath Somanchi,
    Hyderabad.

    SQL> exec dbms_output.put_line(sysdate);
    07-FEB-06
    PL/SQL procedure successfully completed.
    SQL> exec dbms_output.put_line(to_char(sysdate, 'DD-MM-YYYY HH24:MI:SS'));
    07-02-2006 02:48:35
    PL/SQL procedure successfully completed.
    SQL> alter session set nls_date_format='DD-MM-YYYY HH24:MI:SS';
    Session altered.
    SQL> exec dbms_output.put_line(sysdate);
    07-02-2006 02:49:03
    PL/SQL procedure successfully completed.

  • How to convert normal timestamp to julian timestamp in oracle

    Hi Friends
    How can i convert normal timestamp to Julian Timestamp in Oracle ?
    Thanks for your help

    Hi Chris,
    I dont have any idea on this. But need clarification on your query.
    When I executing below query I'm getting same output. 'J' will give only Julian day right not the timestamp. Please correct me if I am wrong.
    SQL> select to_char(systimestamp,'J') J,to_char(sysdate,'J') from dual;
    J            TO_CHAR
    2456631   2456631
    http://en.wikipedia.org/wiki/Template:JULIANDAY.TIMESTAMP

  • Sybase ASE to Oracle Database 11g Migration

    Hi,
    I am looking for documentation on migration from Sybase ASE to Oracle Database 11g Migration.
    Front End application is Peoplesoft.
    Please suggest documentation on the same.
    I look forward to you reply.
    Best regards
    Sonali

    Have a look at the SQL Developer tool:
    Oracle SQL Developer&lt;/title&gt;&lt;meta name=&quot;Title&quot; content=&quot;Oracle SQL Developer&quot;&gt;&lt;meta n…
    It contains a migration utility which allows you to migrate foreign databases to Oracle:
    Database Migration Technology&lt;/title&gt;&lt;meta name=&quot;Title&quot; content=&quot;Database Migration Technology&q…
    Documentation and videos are available from the migration wbe page.
    - Klaus

Maybe you are looking for

  • Accessing postgresql record using servlet

    Hello every body, I am trying to access the postgresql database using servlet. But I found the error of ClassNotFound exception: org.postgresql.Driver. One thing more I am using eclipse ide. I have used the postgresql-8.1-404.jdbc3 driver. And I have

  • Create pdf from any type of file file format

    Hi there; I have to create a pdf file from a special file format (which is not in the supported file list of livecycle pdf generator).Is there any chance to accompish that transform?I know Java.Thanks in advance..

  • Invalid TLV with vb6 and Crystal XI

    Hi, I'm having a problem and haven't found any solution. I have an application on VB6, I create the setup and installed on another computer.  When I'm testing the application it gave the error "Invalid TLV" when trying to run some of the reports.  Th

  • New Photos Never Show Up in iPod

    I've searched and found references for old photos in iPod being deleted when uploading, but I have the opposite problem: When I add new photos to the same folder and upload, only the old photos seen in the ipod, the new ones are not. I check the box

  • How do you search this forum?

    The interface here is maddening.  How do i search just the FlashBuilder forum?