Solved

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

Posted on 2003-11-20
9
648 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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
 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

717 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