[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] Sybase





 ...[snip the copying backup details]...
>
> Each time I do this, Sybase says that around 30 database objects (SPs,
> triggers and views) don't exist, and forces me to 'drop and recreate'.
>
> Anyone tried this?  Had the same problem?  Found a solution?
>

No I haven't tried :) But here's a possible solution, but would probably be
impractical if you're doing this often (read: you'll need to see if there's
a way to script this).

It's been a couple of years since I last used Sybase, but from what I
recall, the ASE control centre in Windows has a function to allow you to
script the database to a DDL file (DDL == Data Definition Language). DDL is
nothing more than a fixed set of SQL statements, namely alter table, create
table etc. Sybase may have renamed DDL to simple SQL...[e.g., on MS SQL
Enterprise Manager, it has "Generate SQL Script..."]

If you can't script the database in one go, then select all the tables,
chose create DDL, then select all the stored procs, and create DDL, etc.

These should just then be plain text files you can ftp/scp to the linux box
and pass to isql (e.g., isql < myprocs.ddl) . That's the structure out of
the way.

To get the data, you should probably look at bcp (bulk copy), which has a
miriad of options, so you should be able to find a set of options to pull
the data out in a compatible format; probably plain ASCII. This is something
you'll almost certainly want to script/automate as I think you need to do
one 'bcp out' per table. Then on the Linux box, you can just 'bcp in' the
data once you've copied it over.

Sybase may have other methods as well since I last looked (plus can't
remember all the features the control centre thingy offeres). Database
replication maybe? It may also have options to Import/Export data between
ASE servers?

Chris...

-- 
\ Chris Johnson                 \
 \ cej [at] nightwolf.org.uk          \
  \ http://cej.nightwolf.org.uk/  ~-----------------------------------+
   \ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____



___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.