Re: from postgres to oracle

Lists: pgsql-sql
From: "Carlos Sousa" <carlosdsousa(at)hotmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: from postgres to oracle
Date: 2002-10-24 15:01:05
Message-ID: F84OzMTlu6h38wCVefl0000e0ae@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql


hi to all

can some one tell how to transfer the contents from a postgres database into
a oracle database

thanks for your time and repaly

_________________________________________________________________
Surf the Web without missing calls!Get MSN Broadband.
http://resourcecenter.msn.com/access/plans/freeactivation.asp


From: Thomas Good <tomg(at)q8(dot)nrnet(dot)org>
To: Carlos Sousa <carlosdsousa(at)hotmail(dot)com>
Cc: "PostgreSQL::SQL List" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: from postgres to oracle
Date: 2002-10-24 15:20:35
Message-ID: Pine.LNX.4.33.0210241113300.29298-100000@q8.nrnet.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

On Thu, 24 Oct 2002, Carlos Sousa wrote:

> can some one tell how to transfer the contents from a postgres database into
> a oracle database

Carlos,

I use pg_dump to create full CREATE strings, with no double quotes.

pg_dump -s -n -D -x dbname > dbname.sql

Then I use pg_dump to create full INSERT strings, with no double quotes.

pg_dump -a -n -D -x dbname > dbname.df

Then I edit the dbname.sql file to remove things oracle objects to
like TEXT datatypes (change to whatever you prefer, LONG, VARCHAR2(4000),
etc.) SEQUENCE syntax has to be modified slightly, GRANTS (removed with
the -x flag) should not exist, etc.

I prepend my usual Oracle stuff (SET NLS_DATE_FORMAT = 'whatever you used with
Pg';, SET SCAN OFF; SPOOL load.log;, etc) to the file and then test it.
With sql*plus as the loader you'll want to stick an EXIT; at the EOF if
you run the script using indirection (sqlplus user/pass @dbname.sql)

HTH

I have examples, if you want em.
-----------------------------------------------------------------------
Thomas Good e-mail: tomg(at)sqlclinic(dot)net
Programmer/Analyst phone: (+1) 718.818.5528
Residential Services fax: (+1) 718.818.5056
Behavioral Health Services, SVCMC-NY mobile: (+1) 917.282.7359
-- --
SQL Clinic - An Open Source Clinical Record www.sqlclinic.net
------------------------------------------------------------------------