Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    2

    Unanswered: Backing up a database via cron

    I need to take a dump/backup of a database to a file (not tape) overnight via a cron job.

    Being very much an informix newbie, my first thought was to use the dbexport command, but it looks like this fails if the database is open by another process. (Presumably this would still be the case even when there are no records actually being read or written to the database.)

    I have found that there is a "onbar" command but as far as I can tell it will only archive database spaces. In my case, the database I want to dump is in the same space as another database which I do NOT want to dump.

    Is there a way of dumping a database (not a complete space) to a file via a cron job, while the database is in use?

    Thanks.

  2. #2
    Join Date
    Jul 2003
    Location
    Calcutta, India
    Posts
    42
    If you want to take the backup while database is in use u have these 3 utilities
    1. ontape
    2. onarchive
    3. on-bar

    But all these utilities are meant for taking backup of a single/multiple dbspaces and not for a specific database (when 2 or more database are residing in the same dbspace, it will backup all the database).

    If you want to take the backup of a single database then u can use data-movement utilities i.e. dbexport. This utility places a exclusive lock on database being backedup. And while doing so if some logged into database (means a shared lock on database) even when he is not doing any inserts/update/deletes etc the utility will fail.
    The only 2 options u are left out
    (1) Make ur own set of command using "unload" utility. This will backup all the records from the given table. But from this utility it is not possible to take the schema of the database. Which u can take using "dbschema" utility.
    (2) The second option is, through cron shutdown(immediate) the database and restart and then run ur utility having dbexport syntax. The problem with this solution is when u shutdown informix (immediate) then all the on-going sessions will be disconnected within 10seconds and any on-going transaction will be lost.
    Now its upto you to decide which option for u want to go.

  3. #3
    Join Date
    Sep 2003
    Posts
    2
    Thanks.

    I have had a quick look at on-bar but it looks a lot more complicated than ontape, which seems the best option.

    So, if we could move our database into its own space this might help, but it looks like ontape will only backup a complete system (all dbspaces) although it will resotore specified dbspaces ... the usage says
    for ontape backup:

    -s [-L archive level ] [ -A database_list] [ -B database_list]
    [ -N database_list] [ -U database_list]

    and for restore:

    -r [-D DBspace_list]

    i.e. you can only specify a dbspace in the restore, so as I understand it ontape will only dump the COMPLETE system (all dbspaces)!

    How do you use ontape to backup only one dbspace?

    Also as I need to do the backup to DISK (not tape), is the correct way to do this to set TAPEDEV to a plain filename?

    Thanks

Posting Permissions

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