Solved

Tool/Code to migrate Oracle dump files to T-SQL format

Posted on 2003-11-20
9
636 Views
Last Modified: 2011-04-14
Hi, I have a third party tool that takes an oracle dump file and creates a schema text file for the tables and then table files.  This is just peachy, except that the schema file is in PL/SQL ... I have no way (that I can do) to create the table schemas from this text file... this is the format the file is in:

CREATE TABLE "ACCOUNT_TYPE" ("ACC_TYPE" CHAR(1) CONSTRAINT "ACCTP_ACC_TYPE_NN" NOT NULL ENABLE, "ACC_SUB_TYPE" CHAR(1) CONSTRAINT "ACCTP_ACC_SUB_TYPE_NN" NOT NULL ENABLE, "SYS_CREATION_DATE" DATE NOT NULL ENABLE, "SYS_UPDATE_DATE" DATE, "OPERATOR_ID" NUMBER(9, 0), "APPLICATION_ID" CHAR(6), "DL_SERVICE_CODE" CHAR(5) NOT NULL ENABLE, "DL_UPDATE_STAMP" NUMBER(4, 0), "SUBS_NOT_ALLOWED" CHAR(1) CONSTRAINT "ACCTP_SUBS_NOT_ALLOWED_NN" NOT NULL ENABLE, "NAME_FORMAT" CHAR(1), "ADDRESS_REQ_IND" CHAR(1), "CAS_CREDIT_REQ_IND" CHAR(1), "INITIAL_CREDIT_CLASS" CHAR(1), "DEF_CAS_APPL_TYPE" CHAR(6), "FORCE_ZERO_BAL_IND" CHAR(1), "BILL_PROD_IND" CHAR(1), "BALANCE_HANDLE_IND" CHAR(1), "CCIR_PROD_IND" CHAR(1), "DEF_APPR_CTN_QTY" NUMBER(4, 0), "NATIONAL_NO_REQ_IND" CHAR(1), "DESCRIPTION" VARCHAR2(40), "SPECIAL_PARAMS" VARCHAR2(1000), "DEF_PRICE_CD_EQP" CHAR(6), "DEF_PRICE_CD_SRV" CHAR(6), "UNIDENTIFIED_PYM_IND" CHAR(1), "CUST_TP_FOR_TAX" CHAR(1), "WELCOME_LETTER" CHAR(1), "ALLOW_CHANGE_TYPE" CHAR(1) CONSTRAINT "ACCTP_ALLOW_CHANGE_TYPE_NN" NOT NULL ENABLE, "SOC_MATCH" CHAR(1), "RA_IND" CHAR(1), "DEFAULT_IND" CHAR(1), "DEF_SUPPRESS_BILL" CHAR(1), "ERATE_IND" CHAR(1), "SPEC_RES_ALLOC_IND" CHAR(1) CONSTRAINT "ACCTP_SPEC_RES_ALLOC_IND_NN" NOT NULL ENABLE, "LTPYMCRG_ALLOW_IND" CHAR(1), "GSA_GRID_PRST_IND" CHAR(1), "CORP_ID_IND" CHAR(1) CONSTRAINT "ACCTP_CORP_ID_IND_NN" NOT NULL ENABLE, "AUTO_CHARGE_IND" CHAR(1) CONSTRAINT "ACCTP_AUTO_CHARGE_IND_NN" NOT NULL ENABLE, "PREPAY_IND" CHAR(1) CONSTRAINT "ACCTP_PREPAY_IND_NN" NOT NULL ENABLE, "RESTRICT_EQUIP_IND" CHAR(1) CONSTRAINT "ACCTP_RESTRICT_EQUIP_IND_NN" NOT NULL ENABLE, "CRD_LMT_IND" CHAR(1) CONSTRAINT "ACCTP_CRD_LMT_IND_NN" NOT NULL ENABLE, "IDENTIFY_REQ_IND" CHAR(1) CONSTRAINT "ACCTP_IDENTIFY_REQ_IND_NN" NOT NULL ENABLE, "SSN_TAX_ID_REQ" CHAR(1) CONSTRAINT "ACCTP_SSN_TAX_ID_REQ_NN" NOT NULL ENABLE, "CNAM_SE" VARCHAR2(3) CONSTRAINT "ACCTP_CNAM_SE_NN" NOT NULL ENABLE, "SSN_IND" CHAR(1) CONSTRAINT "ACCTP_SSN_IND_NN" NOT NULL ENABLE, "TAX_ID_IND" CHAR(1) CONSTRAINT "ACCTP_TAX_ID_IND_NN" NOT NULL ENABLE, "PS_IND" CHAR(1) CONSTRAINT "ACCTP_PS_IND_NN" NOT NULL ENABLE, "DVC_TP" VARCHAR2(30) CONSTRAINT "ACCTP_DVC_TP_NN" NOT NULL ENABLE)  PCTFREE 10 PCTUSED 40 INITRANS 2 MAXTRANS 255 LOGGING STORAGE(INITIAL 16384 NEXT 81920 MINEXTENTS 1 MAXEXTENTS 400 PCTINCREASE 0 FREELISTS 2 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "POOL_DATA"

Etc... etc... for as many tables in the dump as there are.  I'm trying to automate this process in SQL Server but I don't know how to make the above code usable for T-SQL without writing a ton of parcing code to make it T-SQL... I need either a third party tool or someone who might have some code already prepared that does this.  I need to get this out fairly quickly... so, I'm hoping someone can help me.  Its very urgent.

Thanks!
0
Comment
Question by:Roxanne25
9 Comments
 
LVL 2

Expert Comment

by:David Little
ID: 9791546
Have you thought about using DTS? If you can connect to both your Oracle environment and the SQL Server environment, you can use DTS to both create the tables and migrate the data.

IF you don't want the data, just step through the "Import Data" wizard and point to your Oracle database as the source and the SQL Server database as the destination. Don't run the package but save it to the SQL Server database. Then go back in and DESIGN the package. Delete all the transformations and then execute the package. You'll still run all the create table steps. At the end, you could generate a script out of SQL Server to rebuild all the tables from scratch if you need it.

David
0
 

Author Comment

by:Roxanne25
ID: 9791632
No, I am using Oracle dump files.
0
 
LVL 34

Expert Comment

by:arbert
ID: 9794675
0
 

Author Comment

by:Roxanne25
ID: 9796796
That's not a duplicate question... that is my question.  And its not quite the same thing and the other one is closed.  I really need an answer to this.
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 34

Expert Comment

by:arbert
ID: 9797046
Um.....looks pretty close.....

"Secondly, is there some way that I can read the .dmp file in SQL Server?  Or are dump files specific to only the platform from which they came?  I can get SQL to run a command line shell and run the tool to "undump" the oracle file, but just wondered if there was an easier way to do it. "
0
 

Author Comment

by:Roxanne25
ID: 9797069
Well, that question you posted was asking about another way to undump the file... I already undumped the file... now I'm asking about the specific contents of that file and how to convert that to T-SQL.  Definately not the same thing.  Also, the overall question wasn't exactly answered...an alternative was given by downloading oracle personal edition.  

So please help me with my current question if you can.  

Thanks.
0
 

Accepted Solution

by:
Roxanne25 earned 0 total points
ID: 9798109
Actually, after review, I believe I can do this myself using the REPLACE() function in SQL... I think I can just do a bulk insert on the text file and have each create table statement in one row, and then loop through the table and replace out all the non T-SQL code.  That should give me a usable CREATE TABLE statement to work with.

Thanks me :)
0
 

Expert Comment

by:YensidMod
ID: 9798489
Asker found his own solution. Question is PAQed and 500 points refunded.

YensidMod
Experts Exchange Moderator
0
 

Author Comment

by:Roxanne25
ID: 9798612
I'm not a him... I'm a girl :P
hehe
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now