Re: Updating a Remote Database?
Posted in 1995
saieva@dpg.rnb.com (Salvatore Saieva) wrote:
>My need is to update a remote database each day. I would like to export
>the data from my local database to ASCII flat files using the SQL unload
>statement and then make it available for downloading (using Zmodem,
>Kermit, or some other modem protocol) by the remote site.
>
>At the opposite end a script will run which will use a SQL load statement
>to load the data into the remote database. My problem is that some of the
>records that are exported from my local database will update existing records
>in the remote database. The SQL load command only allows an insert clause
>for records being loaded from a flat file.
>
[snipped]
Hi Salvatore,
I think its much more easier to use dbexport and dbimport. But this requires
enough time to lock the database in exclusive mode (dbexport does this
automatically for you). The following steps will be nessecary with this
method:
1. Check that no users are working. A simple way is to restart your
Online
tbmode -k -y
tbinit
2. Make an export of your database
dbexport dbname
3. Transfer the created files from dbexport to the remote host. The dbexport
creates a directory called dbname.exp with all needed files.
4. Destroy the database on your remote machine via dbaccess.
5. Create your backup database on the remote machine with the dbimport command.
I hope that helps. Send me an email for further questions...
Dirch
+----------------------------------------------------------------------------+
| Dirch Scheer email: scheer@stadt-mh.de |
| Amt 10-3 Tel. : +49 208 455 1006 |
| Stadtverwaltung (snail-)Mail : Ruhrstr. 32 |
| Muelheim an der Ruhr D-45468 Muelheim an der Ruhr |
+----------------------------------------------------------------------------+