MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

oracle to db2

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
vani
Beginner


Joined: 28 May 2003
Posts: 51
Topics: 30

PostPosted: Thu Oct 16, 2003 5:24 am    Post subject: oracle to db2 Reply with quote

While porting from oracle to db2, should we make changes in the application for the limitation in the length of the column names in DB2, which is 18?

Is there any way to go about it?

Regards,
Vani
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Oct 16, 2003 7:53 am    Post subject: Reply with quote

Vani,

Yes you need to take into consideration in DB2 that Tablespace/Table/Column/Index names cannot be longer than 18 characters, while in Oracle, the maximum is 30 characters.

You can use the export utility to extract the definitions for the objects owned by that user. An example of this command would be:
Code:

          $ exp scott/tiger rows=n file=scott.export


Once you have this file, you can modify the command to the DB2 environment.Basically it will be a shell script with the column name changes.To view the long names use the sql listed below and then decide on the db2 equivalent names. After you finalize the names make the changes in the script to convert.

You can retrieve the Oracle tablespace names longer than 18 bytes from the dba_tablespace with the following statement:

Code:

select tablespace_name, length(tablespace_name) from dba_tablespaces where
length(tablespace_name)>18;


You can retrieve the Oracle table names longer than 18 bytes from the Oracle catalog with the following statement:
Code:

select table_name, length(table_name) from cat
where length(table_name)>18;


You can retrieve the column names longer than 18 characters with the following statement:

Code:

select table_name, column_name, length(column_name)
from user_tab_columns where length(column_name)>18;


You can retrieve the index names longer than 18 characters with the following statement:

Code:

select index_name, length(index_name) from user_indexes where
length(index_name)>18;


The following manuals will be of great help

Converting from Oracle AIX to DB2 for OS/390

DB2 Version 2 Conversion Guide

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group