Sybase to
                                                       Oracle
                                                Cr...
Presentation Background...




1-2   Sybase to Oracle Migration - Developers
About The Speaker
      Christopher Merry is principle consultant at Clearwater
      Technical Group
      Oracle Certifie...
About This Presentation
      Developed to identify significant differences between Sybase
      and Oracle database enviro...
About CTG
      CTG is a small technical group specializing in Oracle consulting
      with key experience assisting sever...
Objectives
      Evaluate the tools available to access an Oracle database
        Oracle tools
        Third party applic...
Database Access Tools...




1-7   Sybase to Oracle Migration - Developers
Oracle Supplied Tools
      Complimentary tools from Oracle are available to access Oracle
      databases
        Limited...
SQL*Plus




1-9   Sybase to Oracle Migration - Developers
SQL Developer




1-10   Sybase to Oracle Migration - Developers
Third Party Tools
       Many third party options are available
         Product cost varies based on version and features...
Third Party Tools (cont’d)
       More software options
         SQL Navigator
            The flagship Quest Software Orac...
PL/SQL Developer




1-13   Sybase to Oracle Migration - Developers
Data Types...




1-14   Sybase to Oracle Migration - Developers
Data Types
       While many data types differ between Sybase and Oracle, DATE
       values are the most significantly dif...
Data Types (cont’d)
       TEXT
         The Oracle equivalent is VARCHAR2 (up to 4000 bytes) or CLOB for text
         up...
Data Types (cont’d)
       REAL, TINYINT, SMALLINT, MONEY, SMALLMONEY
         Not available in Oracle; must use equivalen...
User-Defined Data Types
       Oracle supports user-defined data types through the creation of
       Object Types
       Th...
NULL Character Strings
       Empty character strings ('') are treated the same as NULL
       values in Oracle
       Thi...
Structured Query Language...




1-20   Sybase to Oracle Migration - Developers
Structured Query Language
       Oracle and Sybase are ANSI standard complient
         The majority of SQL syntax is iden...
Temporary Tables
       One of the biggest issues associated with converting existing
       Sybase scripts and stored pro...
Updates with Subqueries
       Oracle does not allow the FROM clause in the UPDATE
       statement
       Therefore, the ...
Updates with Subqueries (cont’d)
       The following statement would be valid in both environments
       UPDATE address ...
Group By Restrictions
       When mixing scalar values and aggregate functions, Oracle
       requires all scalar values t...
Group By Sample Output
        ID_NUMBER            GIFT_AMOUNT                GIFT_TOTAL
       ----------            ---...
Functions...




1-27   Sybase to Oracle Migration - Developers
Functions
       Oracle provides many functions available in both SQL and PL/
       SQL
       Many functions are either ...
Analytic Function Example
       Resolve the earlier grouping issue using an analytic function
         Also include a ran...
Analytic Function Results
        ID_NUMBER            GIFT_AMOUNT                GIFT_RANK   GIFT_TOTAL
       ----------...
Regular Expression Function Example
       Reformat a character string that represents a date value
         The original ...
Transactions...




1-32   Sybase to Oracle Migration - Developers
Transactions
       Oracle never commits a single INSERT, UPDATE, or DELETE
       statement
         Assuming the user do...
Schemas and Privileges...




1-34   Sybase to Oracle Migration - Developers
Schemas and Privileges
       Oracle segregates data in schemas
         Users that create objects such as tables and stor...
Accessing Schema Objects
       Using the previous example, if the user CHRIS executes the
       query below, the ENTITY ...
What’s Next...




1-37   Sybase to Oracle Migration - Developers
Migration Road Map
       Of course this presentation only illustrates a few of the
       differences between Oracle and ...
Upcoming SlideShare
Loading in...5
×

Sybase To Oracle Migration for Developers

6,013

Published on

Identifies key differences between Sybase and Oracle from the perspective of an experienced Sybase developer

Published in: Technology, Business
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
6,013
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
212
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • Sybase To Oracle Migration for Developers

    1. 1. Sybase to Oracle Critical information for new Oracle developers 1-1 Sybase to Oracle Migration - Developers
    2. 2. Presentation Background... 1-2 Sybase to Oracle Migration - Developers
    3. 3. About The Speaker Christopher Merry is principle consultant at Clearwater Technical Group Oracle Certified Professional and Certified Professional in Learning and Performance 10 years of experience working with Oracle Including time at Oracle Corporation 9 years of experience as a trainer for Learning Tree International 3 years of experience working with several universities to migrate SunGard Advance from Sybase to Oracle 1-3 Sybase to Oracle Migration - Developers
    4. 4. About This Presentation Developed to identify significant differences between Sybase and Oracle database environments Part of a series prepared by CTG to assist clients (and others) in their for migration challenges ahead Other presentations include Sybase to Oracle Migration for DBAs Sybase to Oracle Data Migration Steps Sybase to Oracle - T/SQL and PL/SQL Bridging the Gap Between Advance Windows and AWA Web Skills for AWA Customization And more on the way 1-4 Sybase to Oracle Migration - Developers
    5. 5. About CTG CTG is a small technical group specializing in Oracle consulting with key experience assisting several universities migrate from SunGard’s Advance Windows to Advance Web Access CTG is not in anyway affiliated or partnered with SunGard Data Systems, Inc. 1-5 Sybase to Oracle Migration - Developers
    6. 6. Objectives Evaluate the tools available to access an Oracle database Oracle tools Third party applications Compare data type options in both environments Identify significant differences in SQL Temporary tables Updates Grouping Discuss transaction and data control Evaluate schemas, privileges, and synonyms in Oracle 1-6 Sybase to Oracle Migration - Developers
    7. 7. Database Access Tools... 1-7 Sybase to Oracle Migration - Developers
    8. 8. Oracle Supplied Tools Complimentary tools from Oracle are available to access Oracle databases Limited in functionality Oracle Database 10g tools include: SQL*Plus Command line tool similar to SQL Advantage or isql SQL Developer Oracle’s newest access tool Java application Includes data migration features to import Sybase objects into Oracle A little buggy and not as feature rich as other options 1-8 Sybase to Oracle Migration - Developers
    9. 9. SQL*Plus 1-9 Sybase to Oracle Migration - Developers
    10. 10. SQL Developer 1-10 Sybase to Oracle Migration - Developers
    11. 11. Third Party Tools Many third party options are available Product cost varies based on version and features desired Popular software includes Golden Basic, inexpensive product ($35) offering many features used by developers Toad The dominant Oracle tool for years, Toad was once a free product Now owned by Quest Software, it is one of the higher priced options Starting at $870 for the basic edition (additional modules are available) 1-11 Sybase to Oracle Migration - Developers
    12. 12. Third Party Tools (cont’d) More software options SQL Navigator The flagship Quest Software Oracle tool The highest cost among the products mentioned here Base edition starts are $1,300 with additional editions retailing for $3,000 PL/SQL Developer - HIGHLY RECOMMENDED The best feature set for the money Offered by Allround Automations Single license cost is $180 with discounts for multiple license packages 1-12 Sybase to Oracle Migration - Developers
    13. 13. PL/SQL Developer 1-13 Sybase to Oracle Migration - Developers
    14. 14. Data Types... 1-14 Sybase to Oracle Migration - Developers
    15. 15. Data Types While many data types differ between Sybase and Oracle, DATE values are the most significantly different CHAR Exists in both environments Sybase maximum length is 255 characters; Oracle maximum length is 2000 bytes VARCHAR Exists in both environments Sybase maximum length is 255 characters; Oracle maximum length is 4000 bytes Oracle also includes VARCHAR2, which is the recommended data type 1-15 Sybase to Oracle Migration - Developers
    16. 16. Data Types (cont’d) TEXT The Oracle equivalent is VARCHAR2 (up to 4000 bytes) or CLOB for text up to and beyond 4GB NUMERIC, DECIMAL, INT Available in both environments Exist as subtypes in Oracle NUMBER is Oracle’s standard numeric data type FLOAT Available in both environments 1-16 Sybase to Oracle Migration - Developers
    17. 17. Data Types (cont’d) REAL, TINYINT, SMALLINT, MONEY, SMALLMONEY Not available in Oracle; must use equivalent NUMBER definitions Dates All DATE values are stored in Oracle as a 7 byte field that always includes century, year, month, day, hours, minutes, and seconds Date formating is handled using format models YYYY represents a four digit year and MON represents the first three characters of a month (e.g. DD-MON-YYYY represents 01-JAN-2010) TIMESTAMP Available in both environments Contains fractions of a second in Oracle 1-17 Sybase to Oracle Migration - Developers
    18. 18. User-Defined Data Types Oracle supports user-defined data types through the creation of Object Types The implementation is quite different from Sybase user-defined data types Requires special SQL constructs More complex 1-18 Sybase to Oracle Migration - Developers
    19. 19. NULL Character Strings Empty character strings ('') are treated the same as NULL values in Oracle This is significant as conditions such as the following will never be true (even if the STREET2 value is empty) IF TRIM(street2) > '' THEN Instead, the condition should use the IS NOT NULL operator IF TRIM(street2) IS NOT NULL THEN 1-19 Sybase to Oracle Migration - Developers
    20. 20. Structured Query Language... 1-20 Sybase to Oracle Migration - Developers
    21. 21. Structured Query Language Oracle and Sybase are ANSI standard complient The majority of SQL syntax is identical Some functionality is available in both environments with different syntax and terminology Sybase provides a few additional features not found in Oracle Oracle provides a few additional features not found in Sybase Key differences include Temporary tables Subqueryies in update and delete statements Group By rules 1-21 Sybase to Oracle Migration - Developers
    22. 22. Temporary Tables One of the biggest issues associated with converting existing Sybase scripts and stored procedures to Oracle is the lack of pure temporary tables in Oracle Oracle does make use of Global Temporary Tables; however, the behavior of these objects is not strictly “temporary” in nature These objects can be used as an alternative; however, the creation of global temporary tables will significantly increase the number objects in the database Other alternatives include PL/SQL collections Advanced SQL techniques 1-22 Sybase to Oracle Migration - Developers
    23. 23. Updates with Subqueries Oracle does not allow the FROM clause in the UPDATE statement Therefore, the following statement is not valid in Oracle UPDATE address SET street1 = 'New Address' FROM entity e, address a WHERE e.id_number = a.id_number AND a.addr_pref_ind = 'Y' AND e.report_name = 'JOHN DOE' 1-23 Sybase to Oracle Migration - Developers
    24. 24. Updates with Subqueries (cont’d) The following statement would be valid in both environments UPDATE address a SET street1 = 'New Address' WHERE EXISTS ( SELECT 1 FROM entity e WHERE e.id_number = a.id_number AND a.addr_pref_ind = 'Y' AND e.report_name = 'JOHN DOE' ) 1-24 Sybase to Oracle Migration - Developers
    25. 25. Group By Restrictions When mixing scalar values and aggregate functions, Oracle requires all scalar values to be included in the GROUP BY clause For example, the following statement, which is valid in Sybase, will not execute in Oracle The statement is intended to retrieve each gift given by an entity, along with a total amount given in the last column SELECT id_number, gift_amount , SUM(gift_amount) AS gift_total FROM gift GROUP BY id_number NOTE: Analytic functions can be used to generate the desired results 1-25 Sybase to Oracle Migration - Developers
    26. 26. Group By Sample Output ID_NUMBER GIFT_AMOUNT GIFT_TOTAL ---------- ----------- ---------- .... 0000045621 1000 5250 0000045621 1250 5250 0000045621 1500 5250 0000045621 1500 5250 0000834224 900 3700 0000834224 1200 3700 0000834224 500 3700 0000834224 600 3700 0000834224 500 3700 .... 1-26 Sybase to Oracle Migration - Developers
    27. 27. Functions... 1-27 Sybase to Oracle Migration - Developers
    28. 28. Functions Oracle provides many functions available in both SQL and PL/ SQL Many functions are either the same or only slightly different There are significant differences in a few types of functions Date functions Regular Expressions Analytic Functions 1-28 Sybase to Oracle Migration - Developers
    29. 29. Analytic Function Example Resolve the earlier grouping issue using an analytic function Also include a ranking column to indicate the gift value in descending order SELECT id_number , gift_amount , RANK() OVER( PARTITION BY id_number ORDER BY gift_amount DESC ) AS gift_rank , SUM(gift_amount) OVER( PARTITION BY id_number ) AS gift_total FROM gift 1-29 Sybase to Oracle Migration - Developers
    30. 30. Analytic Function Results ID_NUMBER GIFT_AMOUNT GIFT_RANK GIFT_TOTAL ---------- ----------- --------- ---------- .... 0000045621 1500 1 5250 0000045621 1500 1 5250 0000045621 1250 3 5250 0000045621 1000 4 5250 0000834224 1200 1 3700 0000834224 900 2 3700 0000834224 600 3 3700 0000834224 500 4 3700 0000834224 500 4 3700 .... 1-30 Sybase to Oracle Migration - Developers
    31. 31. Regular Expression Function Example Reformat a character string that represents a date value The original data format is YYYYMMDD; the output is MM/DD/YYYY SELECT birth_dt , REGEXP_REPLACE ( birth_dt , '([12][890][0-9]{2})([01][0-9])([0-3][0-9])' , '2/3/1' ) AS formated_bday FROM entity BIRTH_DT FORMATED_B -------- ---------- 19520626 06/26/1952 00000613 19540608 06/08/1954 19450703 07/03/1945 1-31 Sybase to Oracle Migration - Developers
    32. 32. Transactions... 1-32 Sybase to Oracle Migration - Developers
    33. 33. Transactions Oracle never commits a single INSERT, UPDATE, or DELETE statement Assuming the user does not disconnect from the current session Similar behavior to the Sybase BEGIN TRANSACTION statement Until a user issues a COMMIT statement, changes made in one session cannot be seen in another session A read consistent view of the data is available in the other session 1-33 Sybase to Oracle Migration - Developers
    34. 34. Schemas and Privileges... 1-34 Sybase to Oracle Migration - Developers
    35. 35. Schemas and Privileges Oracle segregates data in schemas Users that create objects such as tables and stored procedures have a schema Users that only access other’s objects do not have a schema If a user does not own an object, privilege must be granted to the user for the object GRANT SELECT ON advance.entity TO chris 1-35 Sybase to Oracle Migration - Developers
    36. 36. Accessing Schema Objects Using the previous example, if the user CHRIS executes the query below, the ENTITY table in the ADVANCE schema may not be accessed SELECT * FROM entity To ensure the ADVANCE schema is used, execute SELECT * FROM advance.entity An exception to this behavior would occur if The user does not have a table of the same name in his or her own schema AND A synonym exist for the ADVANCE.ENTITY table A synonym “redirects” access to an object in another schema 1-36 Sybase to Oracle Migration - Developers
    37. 37. What’s Next... 1-37 Sybase to Oracle Migration - Developers
    38. 38. Migration Road Map Of course this presentation only illustrates a few of the differences between Oracle and Sybase For more details regarding Oracle, take a look at the documentation available on Oracle’s website Contact us if you have questions regarding this or any of our other presentation (888) 347-7477 info@clearwatertg.com http://www.clearwatertg.com 1-38 Sybase to Oracle Migration - Developers
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×