473,394 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Ora2Pg question

Howdy:

Running PostgreSQL 7.2 and Oracle 9.2.0.1
on RedHat Linux 7.2.

I'm trying to use the Ora2pg.pl script that
I found on the PostgreSQL site. I'm hoping
someone could point out what's wrong with
this.

I believe that I have made the correct adjustments
to the ora2pg.pl script that would let me connect
to Oracle and use the export function, but I get the
following when I run the script:

1) - a list of tables :
Retrieving table information...
ARRAY(0x833e2f0)
Duplicate entry found: - user - PLAN_TABLE
Duplicate entry found: - user - PLAN_TABLE
Duplicate entry found: - user - PLAN_TABLE
Duplicate entry found: - user - PLAN_TABLE
Duplicate entry found: - user - PLAN_TABLE

2) - i finally get my target table, but then the script dies:

[snip]
Scanning SYS_ED_INP ( user SYS_ED_INP TABLE )...
Getting column info for table 'SYS_ED_INP' / owner 'user'
MBR_ID => type:VARCHAR2 , length:11, precision:, scale:, nullable:Y
, default:
CODE => type:VARCHAR2 , length:2, precision:, scale:, nullable:Y ,
default:
PROC_1 => type:VARCHAR2 , length:6, precision:, scale:, nullable:Y
,default:
PROC_2 => type:VARCHAR2 , length:6, precision:, scale:, nullable:Y
,default:
PROC_3 => type:VARCHAR2 , length:6, precision:, scale:, nullable:Y
,default:
DIAG_1 => type:VARCHAR2 , length:6, precision:, scale:, nullable:Y
,default:
DIAG_2 => type:VARCHAR2 , length:6, precision:, scale:, nullable:Y
,default:
DIAG_3 => type:VARCHAR2 , length:6, precision:, scale:, nullable:Y
,default:
DIAG_4 => type:VARCHAR2 , length:6, precision:, scale:, nullable:Y
,
default:
DIAG_5 => type:VARCHAR2 , length:6, precision:, scale:, nullable:Y
,default:
FROM_DT => type:DATE , length:7, precision:, scale:, nullable:Y ,
default:
THRU_DT => type:DATE , length:7, precision:, scale:, nullable:Y ,
default:
BILLINGPROVIDERNUM => type:VARCHAR2 , length:12, precision:,
scale:, nullable:Y , default:
BILLINGPROVIDERNAME => type:VARCHAR2 , length:28, precision:,
scale:, nullable:Y , default:
DIAGNOSISDESCRIPTION => type:VARCHAR2 , length:60, precision:,
scale:, nullable:Y , default:
ADDED => type:DATE , length:7, precision:, scale:, nullable:Y ,default:
ID => type:NUMBER , length:22, precision:, scale:, nullable:Y ,default:
PRODUCT => type:VARCHAR2 , length:1, precision:, scale:, nullable:Y,
default:
Duplicate entry found: - user - USERBOTHLOGIN

Database handle destroyed without explicit disconnect.

[/snip]

questions:

1) am i supposed to put some disconnect statement
in the program?

2) i'm concerend about the list of tables it's finding saying
'duplicate' ... what is that really talking about and why
is it doing that?

3) how can i get the program to only export the data
of ONE table (I have the table created, but empty on
PostgreSQL already)?

NOTE: this is what the program looks like now

[snip ora2pg.pl]
#!/usr/bin/perl
#---------------------------------------------------------------------------
---
# Project : Oracle to Postgresql converter
# Name : ora2pg.pl
# Language : perl, v5.6.1
# OS : linux RedHat 7.3 kernel 2.4.18-17.7.xsmp
# Author : Gilles Darold, gi****@darold.net
# Copyright: Copyright (c) 2000-2002 : Gilles Darold - All rights reserved
-
# Function : Script used to convert Oracle Database to PostgreSQL
#---------------------------------------------------------------------------
---
# Version : 2.0
#---------------------------------------------------------------------------
---

BEGIN {
$ENV{ORACLE_HOME} = '/var/opt/oracle/product/9.2.0';
}

use strict;

use Ora2Pg;

# Initialyze the database connection
my $dbsrc = 'dbi:Oracle:host=local.system.com;sid=test_inst';
my $dbuser = 'system';
my $dbpwd = 'manager';

# Create an instance of the Ora2Pg perl module
my @tables = ('SYS_ED_INP');
my $schema = new Ora2Pg (
datasource => $dbsrc, # Database DBD datasource
user => $dbuser, # Database user
password => $dbpwd, # Database password
tables => \@tables,
debug => 1 # To show somethings when running
);
#### Function to use for extraction when type option is set to DATA or COPY

# Send exported data directly to a PostgreSQL database
$schema->send_to_pgdb('dbi:Pg:dbname=test_db','user');

# Output the data extracted from Oracle DB to a file or to STDOUT
if
no
argument.
#$schema->export_data("/var/tmp/output.sql");

#### Function to use for extraction of other type

# Create the POSTGRESQL representation of all objects in the
database
#$schema->export_schema("output.functions.sql");

exit(0);

[/snip ora2pg.pl]

Suggestions welcomed. Thanks!

-X

Nov 11 '05 #1
0 3234

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
1
by: Johnson, Shaunn | last post by:
Howdy: Has anyone used the Ora2Pg tool for exporting data to PostgreSQL? I'm trying to move data over, and my perl script to insert records into the PostgreSQL table is going very slowly. ...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
0
by: scubadog | last post by:
Hello, I have gotten Ora2pg to work fairly well for me, but I am having an issue where mutibyte characters are being substituted with replacement characters on export from Oracle. I used both the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.