Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003

    Lightbulb Unanswered: Backing up the oracle database

    hi all
    i'm developing an application that makes use of VB and Oracle.
    I want to create a functionality for backing up this database from VB
    Can anybody suggest me any idea.


  2. #2
    Join Date
    Sep 2003
    Virginia, USA
    Your program should write all backup commands to a temp table, then read and execute those command one at a time. Do not hard code the backup commands as your db structure might change over time.

    Below is pseudo code. It requires you be in archive log mode since you can only backup a live database in archive log mode. Don't backup on-line redo logs, since you cannot restore them from a hot backup. Also, backup datafiles but don't backup tempfiles, since they are not read during recovery and are much faster to recreate manually.

    Fetch a list of your tablespaces into a cursor.
    looping through above list ...
    write "begin backup" command as a string to a temp table.
    Fetch a list of datafiles per tablespace into cursor2.
    looping through cursor2...
    write your backup command (an operating system command like Copy as a string to your temp table.)
    end loop;
    end loop;
    wite a command to backup your controlfile to trace.
    wite a command to backup your initSID.ora and pwdSID.ora, if you use these files.
    read the commands from your temp table execute them. (I spool the command listing to a file that I read back into SQL*Plus, which executes all commands for me.

    Oracle9i OCP

  3. #3
    Join Date
    Sep 2003
    NE Florida w/ view of co-workers
    Another idea is to use RMAN (Oracle's facility for backing up databases). Once you understand how RMAN works and how to set it up, all your code has to do is start the RMAN executable - RMAN will do the rest.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts