Migrate from Oracle 11g to Postgresql for a non-DBA
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
I can't give you specifics about how to do these things -- I'm not that familiar with Oracle -- but, as a general guide, this is what you will need to accomplish.
You need a data base schema. That's a text file that contains the specifications for the data base, every table, index, view and any other information that describes the data base's tables in detail. The schema should be in a text file, say dbname.sql where dbname is the name of the data base. If at all possible try to generate the schema in ANSI/ISO standard form; you'll most likely have better luck with that format.
You need (preferably) individual text files containing all the content of every table (one file for each table) named tabname.txt or tabname.unl. These should be in delimited form; the preferred delimiter is a vertical bar (|) or a tab (vertical bars don't appear in any western language which makes them good column delimiters). If possible, these files should have any leading or trailing blanks stripped out of strings (you don't want to load a bunch of space characters in your new data base -- takes up disk space). You should take a look at the data and make sure that there aren't any back slants in it; windows weenies seem to think that a slash and a back slant are the same thing: they're not (replace those with a slash or a space) they can play havoc sometimes and it's better to be safe than sorry. Also, if you use vertical bars as delimiters, replace any tab characters with space characters; those, too, can play havoc when you least expect them to.
Oracle's export utility most likely can't be used because it exports a binary image that can only be read by Oracle's import utility (and you won't be using that with PostgreSQL, eh). Check the documentation for your version of Oracle to see if export can be used. If I had to speculate, I'd look for a utility than can "print" the schema and "print" that to a file; same for table content.
Depending upon how big the Oracle data base is, and how complex the schema is, this could be a royal pain in the hiney -- expect to do a lot of editing to "correct" grammar and syntax. Spend some time trying to find a way to export the schema and table content in text format; there are a lot of Oracle experts out there in the world and one or two may be able to point you in the right direction.
And tronayne is right...this is going to be a huge pain. From my past experience, I'd suggest getting a complete database layout from the Oracle database, showing each table, and each field in the table. That'll tell you what field type and size you need to make. Also, export the Oracle database info to a dump file, before you begin ANYTHING. The dump can be used to rebuild your Postgres database to match Oracle, and rebuild Oracle, if things go very bad.
If you've got no DBA experience at all, and this is an important database, I'd suggest paying a consultant to do it. They could also give you a database health check, and maybe help you avoid some problems. Plus, if the database gets hosed, you'll have someone else to blame....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.