1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Upgrade to even newer ora2pg 2.0.

This commit is contained in:
Bruce Momjian
2003-01-07 22:17:14 +00:00
parent ffab4fdf24
commit a24104eb5e
6 changed files with 251 additions and 141 deletions

View File

@ -1,14 +1,14 @@
#!/usr/bin/perl
#------------------------------------------------------------------------------
# Project : Oracle2Postgresql
# Project : Oracle to Postgresql converter
# Name : ora2pg.pl
# Language : 5.006 built for i686-linux
# OS : linux RedHat 6.2 kernel 2.2.14-5
# Language : perl, v5.6.1
# OS : linux RedHat 7.3 kernel 2.4.18-17.7.xsmp
# 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
# Copyright: Copyright (c) 2000-2002 : Gilles Darold - All rights reserved -
# Function : Script used to convert Oracle Database to PostgreSQL
#------------------------------------------------------------------------------
# Version : 1.1
# Version : 2.0
#------------------------------------------------------------------------------
BEGIN {
@ -20,17 +20,18 @@ use strict;
use Ora2Pg;
# Initialyze the database connection
my $dbsrc = 'dbi:Oracle:host=test.mydomain.com;sid=TEST;port=1521';
my $dbsrc = 'dbi:Oracle:host=localhost;sid=TEST';
my $dbuser = 'system';
my $dbpwd = 'manager';
# Create an instance of the XSD::DBISchema perl module
# Create an instance of the Ora2Pg perl module
my $schema = new Ora2Pg (
datasource => $dbsrc, # Database DBD datasource
user => $dbuser, # Database user
password => $dbpwd, # Database password
debug => 1, # Verbose mode
schema => 'ALICIA7', # Extract only APPS schema
# export_schema => 1, # Export Oracle schema to Postgresql 7.3 schema
# schema => 'APPS', # Extract only the given schema namespace
type => 'TABLE', # Extract table
# type => 'PACKAGE', # Extract PACKAGE information
# type => 'DATA', # Extract data with output as INSERT statement
@ -41,17 +42,14 @@ my $schema = new Ora2Pg (
# type => 'TRIGGER', # Extract triggers
# type => 'FUNCTION', # Extract functions
# type => 'PROCEDURE', # Extract procedures
# tables => [('FND_USER_PREFERENCES')], # unique index + users
# tables => [('CUSTOMER_DATA')], # Unique and primary key
# tables => [('TX_DATA')], # simple indexes
# tables => [('NDW_BROWSER_ATTRIBUTES')], # view
# tables => [('TRIP_DATA')], # Foreign key
# tables => [('JO_TMP')], # Foreign key
# showtableid => 1, # Display only table indice during extraction
# min => 1, # Extract begin at indice 3
# max => 10, # Extract ended at indice 5
# data_limit => 1000, # Extract all data by dump of 1000 tuples
# data_limit => 0, # Extract all data in one pass. Be sure to have enougth memory
# data_limit => 0, # Extract all data in one pass. Be sure to have enougth memory.
);
# Just export data of the following fields from table 's_txcot'
@ -59,11 +57,10 @@ my $schema = new Ora2Pg (
#### Function to use for extraction when type option is set to DATA or COPY
# Send exported data to a PostgreSQL database
#$schema->send_to_pgdb('dbi:Pg:dbname=template1;host=localhost;port=5432','test','test');
# Send exported data directly to a PostgreSQL database
#$schema->send_to_pgdb('dbi:Pg:dbname=test_db;host=localhost;port=5432','test','test');
# Output the data extracted from Oracle DB to a file or to STDOUT if no argument.
# If you set the send_to_pgdb() method the output is given to PG database. See above
#$schema->export_data("output.sql");
#### Function to use for extraction of other type