Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sybase conversion -->mySQL

0 views
Skip to first unread message

Haro

unread,
Dec 6, 2000, 3:00:00 AM12/6/00
to
Hi experts,

I have a database dump (Sybase SQL) which I need to convert or export
into MySQL or Access. I can't do it myself.

Who can help me?

Bye
Suzanne


Michael Peppler

unread,
Dec 7, 2000, 3:00:00 AM12/7/00
to
In article <3A2EA49D...@speed.a2000.nl>, "Haro"
<ha...@speed.a2000.nl> wrote:

> Hi experts,
>
> I have a database dump (Sybase SQL) which I need to convert or export
> into MySQL or Access. I can't do it myself.

You can't convert the dump itself.

You need to go back to the original Sybase server and export the
data in text format using bcp, and then use the mySQL tools to load that
data to the mySQL database.

Michael
--
Michael Peppler - Data Migrations Inc. - mpep...@peppler.org
http://www.mbay.net/~mpeppler - mpep...@mbay.net - AIM MPpplr
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: ase-lin...@isug.com

Alexander Knack

unread,
Dec 15, 2000, 7:08:43 AM12/15/00
to Michael Peppler
Hi Michael,
i have some same sort of problem porting a sybase database from a linux
to a solaris plattform.
the manual tells me i can only dump tables using the bcp command...
my database has plenty of tables, so is there a "comfortable" way of
doing this?
do you have examples?
thanks a lot.

Michael Peppler wrote:
> You can't convert the dump itself.
>
> You need to go back to the original Sybase server and export the
> data in text format using bcp, and then use the mySQL tools to load that
> data to the mySQL database.

PS:
i also have troubles compiling sybperl on solaris:
here's the error when typing make:
gcc -c -I/ibic1/apps/sybaseclient12/include -I/usr/local/include -O
-DVERSION
=\"2.13\" -DXS_VERSION=\"2.13\" -fpic
-I/usr/local/lib/perl5/sun4-solaris/5.0040
4/CORE -DCTLIBVS=100 -DSYBPLVER='"2.13"' -DDO_TIE CTlib.c
In file included from
/usr/local/lib/perl5/sun4-solaris/5.00404/CORE/perl.h:223,
from CTlib.xs:20:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2.1/include/sys/param.h:187:
warning: `NBBY' redefined
/usr/include/sys/select.h:45: warning: this is the location of the
previous definition
In file included from /usr/include/sys/stream.h:26,
from /usr/include/netinet/in.h:38,
from
/usr/local/lib/perl5/sun4-solaris/5.00404/CORE/perl.h:361,
from CTlib.xs:20:
/usr/include/sys/model.h:32: #error "No DATAMODEL_NATIVE specified"

here's the spec:
sybperl-2.13

perl-version:
This is perl, version 5.004_04 built for sun4-solaris

uname -a:
SunOS nstest 5.6 Generic_105181-17 sun4u sparc SUNW,Ultra-5_10

gcc:
Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2.1/specs
gcc version 2.7.2.1

sybase client 12:
cat $SYBASE/studio_version.txt
ASE-Studio-12_0 ASE-12.0 Studio Release 12.0
--
+--------------------------------------------------------------------+
| Alexander Knack ........Entropie erfordert keine Wartung .........|
| dasburo.de ..................................................|
| Schlesische Str. 27 10997 Berlin Tel/Fax: +49 30 611 281 33/38 |
+--------------------------------------------------------------------+

Michael Peppler

unread,
Dec 14, 2000, 6:41:30 PM12/14/00
to
In article <3A3A09CB...@dasburo.de>, "Alexander Knack"
<a...@dasburo.de> wrote:

> Hi Michael, i have some same sort of problem porting a sybase database
> from a linux to a solaris plattform. the manual tells me i can only dump
> tables using the bcp command... my database has plenty of tables, so is
> there a "comfortable" way of doing this? do you have examples? thanks a
> lot.

There's Anthony Mandic's bcptool (yes I know you emailed me that you have
problems running it on the linux box - but there is also a solaris
version)

You would also need to recreate the database
tables/procs/indexes/triggers on the target server. You can use sybperl
and dbschema.pl for that (see http://www.midsomer.org)

You can also use sqsh to bcp data from one server to another, or write a
little perl (or sh or tcl) script to bcp all the tables from a server
OUT to tmp files, and then bcp them in on the other side.

Here's a *minimal* perl script to do just that:

#!/usr/local/bin/perl -w

use strict;

use Sybase::DBlib;

require 'sybutil.pl';

my $dbh = new Sybase::DBlib 'sa';

$dbh->dbuse($ARGV[0]);

my $tables = $dbh->sql("
select o.name, u.name, o.id, 'N'
from dbo.sysobjects o, dbo.sysusers u
where o.type = 'U' and u.uid = o.uid
and (u.name = 'dbo' or u.name = 'mpeppler')
and o.name > 'orders'
order by o.name

");

foreach (@$tables) {
system("bcp $ARGV[0].$_->[1].$_->[0] out $ARGV[0].$_->[1].$_->[0].bcp -Usa -P -c");
system("bcp $ARGV[0].$_->[1].$_->[0] in $ARGV[0].$_->[1].$_->[0].bcp -Usa -P -Skiruna -c -I/opt/sybase-11.5/interfaces -b 10000");
# system("gzip $ARGV[0].$_->[1].$_->[0].bcp");
}

__END__


> PS: i also have troubles compiling sybperl on solaris: here's the error
> when typing make: gcc -c -I/ibic1/apps/sybaseclient12/include
> -I/usr/local/include -O
> -DVERSION
> =\"2.13\" -DXS_VERSION=\"2.13\" -fpic
> -I/usr/local/lib/perl5/sun4-solaris/5.0040
> 4/CORE -DCTLIBVS=100 -DSYBPLVER='"2.13"' -DDO_TIE CTlib.c
> In file included from
> /usr/local/lib/perl5/sun4-solaris/5.00404/CORE/perl.h:223,
> from CTlib.xs:20:
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2.1/include/sys/param.h:187:
> warning: `NBBY' redefined

Looks like either a problem with the perl installation or with the gcc
installation.

I would suggest first trying to re-install perl from the sources, and if
that fails install a more recent version of gcc (for the correct version
of Solaris) from www.sunfreeware.com.

0 new messages