wood burning stoves 2.0
The moose likes JDBC and Relational Databases and the fly likes backup database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "backup database" Watch "backup database" New topic

backup database

Neha Yadav

Joined: Aug 26, 2004
Posts: 5
Hi All

I have to develop a Web Service that basically needs to backup one database onto another.
The DB vendor is not static, it is determined by the database URL given by user when it invokes the WS.
This backup is online one. When the WS gets the database URL, only then can it query it for its schema.
In case, the detination database doesnot have any old copy the source copy, then i can simply make an exact replica but if it has an old copy then

The problem is:

1. How do i determine what changes have been made since the last backup on the destination database(in case the destination database has an outdated copy)?

I dont think i can create triggers for the source database because the database to be backed up is not known until the Web Service invocation, its provided by user at run time.

Please reply

Thank you
Neha (Naughty is my nick name)
[ August 26, 2004: Message edited by: Naughty Yadav ]

[ August 26, 2004: Message edited by: Naughty Yadav ]
[ August 27, 2004: Message edited by: Neha Yadav ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
please specify the DB vendor. if it is oracle then probably it is a bit complex. there are two kinds of backup.

- offline: a simple operating system copy paste. (control file, all data files)

- online: either you have to make your particular tablespace or datafile offline that you want to back up. it could be incremental. it requires the old backup. the backup command will do all.

other solution is truncate the tables one by one, and insert all the records from scratch.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

May I ask why you are trying to do this with JDBC? All RDBMS's I can think of have back up utilities designed to run over a network, so what do you gain by reproducing this as a web service?

The easiest way I can think of to do this is to script the backup operation as a batch file for each DB and call that from Java. Most good DBA's will script their backup routines anyway. So rather than re-implementing the logic which decides what has been updated and what hasn't, which your DB probably tracks already, just call that logic by running the DB backup stuff.
[ August 26, 2004: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852


We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
Vikalp Singh
Ranch Hand

Joined: Dec 29, 2002
Posts: 50
I am agree with the Paul Sturrock,
even in my application, we are taking database backup daily.
for this we are having batch process to do so at End of Day.
and we are using Oracle as Database.
I agree. Here's the link: http://aspose.com/file-tools
subject: backup database
It's not a secret anymore!