diff options
| author | Bruce Momjian <bruce@momjian.us> | 2001-05-10 15:51:05 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2001-05-10 15:51:05 +0000 |
| commit | 0d2c4d5a172f8cdc510abf32ef7ccc1c002267aa (patch) | |
| tree | 29235d87c8610ad4f288ba090e40dacc6e53f583 /contrib/oracle/ora2pg.pl | |
| parent | c2a062b7fe55a0d29a8b2f7dffd4f6dd1202af31 (diff) | |
| download | postgresql-0d2c4d5a172f8cdc510abf32ef7ccc1c002267aa.tar.gz | |
Add oracle conversion utility ora2pg in /contrib/oracle.
Diffstat (limited to 'contrib/oracle/ora2pg.pl')
| -rwxr-xr-x | contrib/oracle/ora2pg.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/oracle/ora2pg.pl b/contrib/oracle/ora2pg.pl new file mode 100755 index 0000000000..00830694cc --- /dev/null +++ b/contrib/oracle/ora2pg.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl +#------------------------------------------------------------------------------ +# Project : Oracle2Postgresql +# Name : ora2pg.pl +# Language : 5.006 built for i686-linux +# OS : linux RedHat 6.2 kernel 2.2.14-5 +# Author : Gilles Darold, gilles@darold.net +# Copyright: Copyright (c) 2000 : Gilles Darold - All rights reserved - +# Function : Script used to convert Oracle Database schema to PostgreSQL +#------------------------------------------------------------------------------ +# Version : 1.0 +#------------------------------------------------------------------------------ + +BEGIN { + $ENV{ORACLE_HOME} = '/usr/local/oracle/oracle816'; +} + +use strict; + +use Ora2Pg; + +# Initialyze the database connection +my $dbsrc = 'dbi:Oracle:host=aliciadb.samse.fr;sid=ALIC;port=1521'; +my $dbuser = 'system'; +my $dbpwd = 'manager'; + +# Create an instance of the XSD::DBISchema perl module +my $schema = new Ora2Pg ( + datasource => $dbsrc, # Database DBD datasource + user => $dbuser, # Database user + password => $dbpwd, # Database password +); + +# Create the POSTGRESQL representation of all objects in the database +$schema->export_schema("output.sql"); + +exit(0); + |
