mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Here the latest version and first working release of Ora2Pg a tool to export
Oracle database to PostgreSQL. It currently dump the database schema (tables, views, sequences, indexes, grants), with primary, unique and foreign keys into PostgreSQL syntax without editing the SQL code generated. You can dump only a particular schema from the Oracle database. Functions, procedures and triggers with SQL or PLSQL code generated must be reviewed to match the PostgreSQL syntax. Some usefull recommandation on porting Oracle to PostgreSQL can be found at http://techdocs.postgresql.org/ under the "Converting from other Databases to PostgreSQL" Oracle part. I just notice one thing more is that the trunc() function in Oracle is the same for number or date so be carefull when porting to PostgreSQL to use trunc() for number and date_trunc() for date. I will add more precision in type NUMBER conversion based on length to match as closest as possible all rich PostgreSQL numerics type. But it seems not to be urgent as it seems that Oracle DBAs only create number with length 22 (default) Space seems not to be their problem... Gilles DAROLD
This commit is contained in:
@ -30,11 +30,22 @@ my $schema = new Ora2Pg (
|
||||
user => $dbuser, # Database user
|
||||
password => $dbpwd, # Database password
|
||||
debug => 1, # Verbose mode
|
||||
schema => 'APPS', # Extract only APPS schema
|
||||
type => 'TABLE', # Extract table
|
||||
# type => 'VIEW', # Extract views
|
||||
# tables => [('MY_TABLE1','MY_TABLE2')], # Extract only these table
|
||||
# type => 'GRANT', # Extract privileges
|
||||
# type => 'SEQUENCE', # Extract sequences
|
||||
# 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
|
||||
# showtableid => 1, # Display only table indice during extraction
|
||||
# min => 1, # Extract begin at indice 1
|
||||
# max => 10 # Extract ended at indice 10
|
||||
# min => 1, # Extract begin at indice 3
|
||||
# max => 10 # Extract ended at indice 5
|
||||
);
|
||||
|
||||
# Create the POSTGRESQL representation of all objects in the database
|
||||
|
Reference in New Issue
Block a user