Discussion:
Database copy and synchronisation
(too old to reply)
M***@seznam.cz
2009-09-02 04:34:03 UTC
Permalink
Raw Message
Hello,

I would like to run copy of my original databse to notebook for
presentations and do update this small copy of database from time to
time, so:

1) I would like to copy db structures (tables, trigger etc) to another
(now empty) db - is there any rapid solution?

2) I would like to synchronise these structures from time to time

3) I would like to fill up this copy with some pattern (just small) of
data

Thanks for advices
Leonid Gvirtz
2009-09-05 11:34:01 UTC
Permalink
Raw Message
Hi

Please see my comments inline.

Hope it helps
Leonid Gvirtz
http://www.gvirtz-consulting.com
Post by M***@seznam.cz
Hello,
I would like to run copy of my original databse to notebook for
presentations and do update this small copy of database from time to
1) I would like to copy db structures (tables, trigger etc) to another
(now empty) db - is there any rapid solution?
You can use ddlgen utility which is supplied with ASE to generate DDL
statements for database objects.
Post by M***@seznam.cz
2) I would like to synchronise these structures from time to time
There is no "rapid" way that I aware of. You will need to log your DDL
statements in some way and then re-apply them on your laptop. All such
statements are logged into transaction log, but there is no easy way to
recover it from there with Replication Server/Replication Agent etc.

Of course you can perform queries with joins between system tables on
both sides (original database and laptop) and discover the differences.
For example you can see what columns exist in the original database and
don't exists on the laptop. While it is certainly doable, I would not
consider this approach to be easy to implement correctly.
Post by M***@seznam.cz
3) I would like to fill up this copy with some pattern (just small) of
data
Thanks for advices
You can take only a subset of rows with bcp out. This is especially easy
with new INITSTRING switch for bcp command introduced in OCS 15 (you can
specify "set rowcount" here). If you your ASE version is less than 15
than you can create views with TOP statement (available since ASE
12.5.2, I think) and bcp from these views. In addition, if you can
connect your laptop to the same network where the original database is
running, you can define proxy tables on your laptop and pull the
relevant data directly from the original database. Beware of possible
cross-table consistency issues, though.

Loading...