petegossett
petegossett GRM+ Memberand PowerDork
2/11/15 11:14 a.m.

Because I'm not one...

I was given an Oracle DP file that I need to import into MS SQL Server, and after some research discovered there's no way to do this without first loading the file into an Oracle DB.

None of us have any experience with Oracle. I've installed the free Oracle Express 11g, and now I'm trying to import the DP file I was given using the "impdp" command - and that's where I'm getting stuck.

It sits there about 10-minutes then gives me an error message:

ORA-11170: TNS: Connect timeout occurred

I'm not exactly sure what's happening here. Do I need to first create the destination DB/table(there's only 1) BEFORE I run impdp? That will be a problem, as I have no idea what the table structure is.

Any tips would be appreciated, as Google doesn't have much for this error code in relation to the Data Pump utility, and the replies for this specific error seem more network and/or client-server related.

GameboyRMH
GameboyRMH GRM+ Memberand MegaDork
2/11/15 11:23 a.m.

Don't know anything about Oracle databases, but I know plenty about MSSQL, and I hope you know that moving a database off of it onto a different system is a total PITA, so if you have other options for the destination you should explore them.

But are you sure the error code isn't 12170? Obviously it's some kind of networking problem, are you doing this work on the same server hosting the database?

https://community.oracle.com/thread/363885?tstart=0

Giant Purple Snorklewacker
Giant Purple Snorklewacker MegaDork
2/11/15 11:52 a.m.

A TNS failure is the connection configuration either in what you are providing from the client or what you set up on the server side. You are not getting a connection to the server from the data pump client.

It is difficult to say what the issue is beyond that. This may help if you haven't read it already. http://www.oracle.com/technetwork/issue-archive/2009/09-jul/datapump11g2009-quickstart-128718.pdf

petegossett
petegossett GRM+ Memberand PowerDork
2/11/15 11:53 a.m.

In reply to GameboyRMH:

Ah yes it's 12170...I must have fat-fingered it.

I've installed Oracle on a standalone PC. The Data pump file I'm trying to import is loaded on the local drive. I'm wondering if I'm receiving the error because there's no existing database to connect to? If so, I'm not sure how to proceed as I have no idea what the structure needs to be for this table I need to import.

Regarding other options, this is an ongoing problem I've been dealing with for over a year, and none of the other options have worked out so far.

Giant Purple Snorklewacker
Giant Purple Snorklewacker MegaDork
2/11/15 11:58 a.m.

In reply to petegossett:

Well, you are going to need a database and a listener for it before there is anything to connect to. That would be problem #1. Oracle server can be connected to by the sa to create these things but that is "special". To connect as a database user you need to create and configure those things. Just use the GUI wizard to make an empty database, verify you can connect to it with sqlplus and then you can deal with whether you need to create the table or whether the data pump utility will do it for you. Google can help you with the getting started bit.

EDIT: I am not an Oracle guru but I deal with it often enough. It's a bit arcane and obtuse compared to SQL Server. THe concepts are very different. Are you sure you can't just have someone awk/sed the datapump text file into a csv and load it to sql server with the import utility?

Dr. Hess
Dr. Hess MegaDork
2/11/15 12:17 p.m.

I take it SSMA didn't work? https://msdn.microsoft.com/en-us/library/hh313159%28v=sql.110%29.aspx

petegossett
petegossett GRM+ Memberand PowerDork
2/11/15 12:34 p.m.

In reply to Dr. Hess:

That's the step I'm hoping to get to. I don't yet have an Oracle database, just the raw dump file.

In reply to Giant Purple Snorklewacker:

Well I only really understand pieces of what you said, but at least that's a start! I haven't found any GUI yet, but I did just find a tutorial on installing Oracle 11g from scratch, so I'll start over and follow it.

And yes, we did start with a csv file over a year ago. The problem is this one specific table was corrupt and other attempts to export it did not work either. My hunch is it contains blobs - but we're working with a non-database-savvy client who's essentially been abandoned by their previous vendor...and I get stuck in the middle trying to figure it all out.

Dr. Hess
Dr. Hess MegaDork
2/11/15 1:03 p.m.

Have you opened it up in a binary editor and seen what's inside? If it's corrupt, you're kinda screwed, but you might be able to cut and paste the good part together if you can find where the records break. Any idea on what the table structure is?

Giant Purple Snorklewacker
Giant Purple Snorklewacker MegaDork
2/11/15 1:09 p.m.

Also, corruption in a file or table that causes applications to gag are often characters from one charset that didn't map appropriately in another. Sometimes this happens because of an import/export from disparate systems. Sometimes it is client applications not validating inputs or configured with a charset mismatch. So, having the data exported to text allows you to clean it to only what the target platform can deal with using tools like awk/sed to script the job. Blobs are a pain in the ass and easily corrupted by trying to import/export as well.

If you are talking about id/key corruption to existing foreign keys then that is a different animal.

petegossett
petegossett GRM+ Memberand PowerDork
2/11/15 1:56 p.m.

In reply to Dr. Hess:

I can open the original csv file, but I get an error about data corruption each time. It's an index file, butit's missing column headers, and there's supposed to be a field that contains either a blob, pathname/filename, or something that will allow me to identify document images and who/where they belong.

I think I'm making progress in Oracle, I can at least connect to the default database it created & query against it. I'm getting new errors with impdp now too, so I'm counting that as progress as well:

ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 536 ORA-29283: invalid file operation

Seems it's either not finding my DP file, or not able to import it. I don't think the fact it isn't finding a log file is relevant?

petegossett
petegossett GRM+ Memberand PowerDork
2/11/15 2:00 p.m.

In reply to Giant Purple Snorklewacker:

I just opened the Excel file again, the actual message is: Excel found unreadable content... Do you want to recover the contents of this workbook?

Opening it in Notepad reveals a ton of special characters. I'm not sure I could clean the file and have anything useful left?

Giant Purple Snorklewacker
Giant Purple Snorklewacker MegaDork
2/11/15 2:34 p.m.

In reply to petegossett:

I don't know how the file was encoded - it could just be that the unreadable content is the embedded binary (blobs) or it could be that Oracle encoded it somehow on export or it could be that someone opened it in notepad then saved and THAT would corrupt the file. If you can isolate a field with unreadable content you can use a hex editor to determine if it's a unmapped char, undigested unicode or a bitmap. If it is always the same field - and it's not a necessary field to do what you are trying to accomplish you can try using awk to strip it out and import all the others.

I actually do a lot of this type of work when integrating systems for customers but it is very hard to do as an armchair quarterback. In the best case scenario here the customer still has the data in a running database such that someone who knows the pitfalls can run a fresh export. Otherwise... you will need to know a lot more about the file you have.

petegossett
petegossett GRM+ Memberand PowerDork
2/11/15 5:03 p.m.

Minor success! I was able to get the DP file imported into Oracle and query it...there's hardly any data in it, but at least I can query it!!!

Dr. Hess
Dr. Hess MegaDork
2/11/15 5:37 p.m.

If you have it readable in Oracle, then link SQL Server to Oracle and query it direct that way through a DTS package, or maybe (AHHHH MY HEAD, MY HEAD) an SSIS package.

Dr. Hess
Dr. Hess MegaDork
2/11/15 5:51 p.m.

What I did once was write an SSIS package to connect to an oracle database, read the systables and recursively go through it all and copy the entire database to a SQL Server database. This was to back up BPCS after shutting it down. Took me about a week to write. I HATE SSIS PACKAGES. Did I mention that? I'm not real fond of oracle either.

petegossett
petegossett GRM+ Memberand PowerDork
2/11/15 6:28 p.m.

Yes SSIS packages can be a bit of a...challenge sometimes Dr. Hess.

Hopefully tomorrow I can determine whether there should, in fact, be data in this database, and if so, try to figure out why I don't have any...

Nick_Comstock
Nick_Comstock PowerDork
2/11/15 9:08 p.m.

You'll need to log in to post.

Our Preferred Partners
9ctpFy4jsOrsyknYtQxvHJJSeg0h8mbGVYX9lXOq8GtCFaJlvrM5rY2llgERq3O5