ORACLE TO SYB<strong>ASE</strong> <strong>ASE</strong> MIGRATION GUIDERev.1.3<strong>Oracle</strong> Description <strong>Sybase</strong> <strong>ASE</strong> Comments / When <strong>to</strong> use32767NUMBER(x,y)FLOATCHAR(x)VARCHAR2(x)DATETIMESTAMP[WITH [LOCAL]TIME ZONE]alternatively <strong>to</strong> the mapping pathabove, these <strong>Sybase</strong> <strong>ASE</strong>datatypes can be used.maximum FLOAT precision in<strong>Oracle</strong> is approx. 38maximum CHAR size in <strong>Oracle</strong>is 2000 bytesmaximum VARCHAR2 size in<strong>Oracle</strong> is 4000 bytes for columns(for PL/SQL variables, the max.size is 32767)date/ time precision in <strong>Oracle</strong> isup <strong>to</strong> one second.precision of <strong>Oracle</strong>‟sTIMESTAMP is 1/100000000thof a secondTINYINTlength of NUMBER datatype between2 and 3 and data values 15FLOAT precision of actual values
ORACLE TO SYB<strong>ASE</strong> <strong>ASE</strong> MIGRATION GUIDERev.1.3<strong>Oracle</strong> Description <strong>Sybase</strong> <strong>ASE</strong> Comments / When <strong>to</strong> useLONG RAW <strong>Oracle</strong>‟s max. s<strong>to</strong>rage capacity for IMAGELONG RAW is 2GBCHAR(1)BFILE4.7.1 Chained <strong>Oracle</strong> data rowsif this is a packed bit columnmaintained by a PL/SQLfunction set / unset / retrieve /query on them.BFILE s<strong>to</strong>res a loca<strong>to</strong>r (link) <strong>to</strong> abinary file outside of the databaseBITno direct equivalent<strong>Oracle</strong> allows long data rows <strong>to</strong> exceed the size of a disk block. This is known as 'chained rows'. It is possible that suchchained data rows, if they exist in the <strong>Oracle</strong> database, are <strong>to</strong>o long <strong>to</strong> be s<strong>to</strong>red in <strong>Sybase</strong> <strong>ASE</strong>, which requires that adata rows fits on a data page (which is 2KB, 4KB, 8KB or 16KB; use dbcc serverlimits <strong>to</strong> find the net max rowlength allowed in <strong>ASE</strong>). Also, for tables with more than 255 columns, the rows will always be chained.It is important <strong>to</strong> identify tables that have chained rows before starting the migration. To find how many chained rowsoccur in a table, run this <strong>Oracle</strong> query:SELECT owner, table_name, chain_cntFROM dba_tables WHERE chain_cnt > 0If chained rows are found, the <strong>Oracle</strong> command ANALYZE TABLE table-name LIST CHAINED ROWSINTO chained-row-table can be used <strong>to</strong> identify the actual chained rows.If chained rows are found, it may be needed <strong>to</strong> modify the data model <strong>to</strong> ensure that rows are short enough <strong>to</strong> fit on an<strong>ASE</strong> page.4.8 Search for <strong>Sybase</strong> <strong>ASE</strong> reserved words and keywords in <strong>Oracle</strong>Before you can migrate an <strong>Oracle</strong> schema or <strong>Oracle</strong> s<strong>to</strong>red procedure, function or trigger, there needs <strong>to</strong> be a check forreserved words (keywords) that are already identified as either problematic or non-migratable. <strong>Oracle</strong> allows SQLkeywords <strong>to</strong> be used as identifiers whereas this is not allowed in <strong>ASE</strong>. For example, the following is valid PL/SQL:CREATE TABLE case (begin VARCHAR2(100), when INT)The following query finds all object names within the <strong>Oracle</strong> database that are <strong>ASE</strong> keywords:select owner, object_name, object_typeFROM sys.dba_objectsWHERE object_name = UPPER('')The following query scans any PL/SQL object within the <strong>Oracle</strong> database for certain keywords and returns the nameand owner of the object as well as the object type for objects containing <strong>ASE</strong> keywords. This query retrieves the exactcode and line number of the occurrence within a s<strong>to</strong>red procedure, function or trigger. Note that this could potentiallyreturn a lot of output since the 'line' column may be long. Also note that these keywords could be part of comments orstring constants, in which case they can be ignored:SELECT owner, name, type, line, textFROM sys.dba_sourceWHERE instr(UPPER(text), UPPER('')) > 0The queries above should be run for all <strong>Sybase</strong> <strong>ASE</strong> reserved words and keywords. The most practical way of runningthese queries for all <strong>ASE</strong> keywords is <strong>to</strong> insert the <strong>ASE</strong> keywords in an <strong>Oracle</strong> table, and then run the above queries as ajoin with this table.For a complete list of reserved words and keywords in <strong>Sybase</strong> <strong>ASE</strong>, see “Adaptive Server Enterprise->Reference Manual:Building Blocks->Reserved Words”. Reserved words can also be displayed with the following <strong>ASE</strong> query (but checkcompleteness against the <strong>ASE</strong> documentation!):Database Schema <strong>Migration</strong> 23