• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

backup database

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Regards
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 ]
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Naughty",

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.

Thanks!
bear
Forum Bartender
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic