Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2004
    Posts
    64

    Unhappy Unanswered: stopping individual databases

    Apologies for the relative newbieness of this post

    I'm new to DB2, having used mainly Oracle and MySQL before, but have been landed with a DB2 database to administer since i'm the "database guy".

    Running V7 something on Solaris, we have 5 production databases within a single instance, and due to lack of knowledge, haven't been getting backed up for a LONG time.

    I've been playing with the developer edition on my workstation, and have sorted out the LOGRETAIN and USEREXIT stuff, but my question is, can I stop an individual database, to perform an offline backup, prior to restarting with the updated config and setting up a cron for online backups?

    If ym understanding is right, "db2stop" seems to stop the entire instance, which I'm not keen to do.

    According to this page:
    http://publib.boulder.ibm.com/infoce...db2.doc.admin/
    there's a "STOP DATABASE" command, but I get the following error when trying to issue that for the specific database.


    db2 => STOP DATABASE testdb2
    SQL0104N An unexpected token "testdb2" was found following "DATABASE".
    Expected tokens may include: "MANAGER". SQLSTATE=42601
    db2 =>

    Many thanks for any light you can shed on this.

    Regards
    Andrew

  2. #2
    Join Date
    Oct 2004
    Location
    DELHI INDIA
    Posts
    338

    Thumbs up Disconnection of Database

    Hi,

    You donot need to stop the database to take offline backup. Just disconnect all the application connected to that database and then take the offline backup. It would do your job.


    Jayanta, Xansa India

  3. #3
    Join Date
    Sep 2004
    Posts
    64
    Quote Originally Posted by JAYANTA_DATTA
    Hi,

    You donot need to stop the database to take offline backup. Just disconnect all the application connected to that database and then take the offline backup. It would do your job.


    Jayanta, Xansa India
    Simply disconnecting the applications wont allow the the

    db2 "update database configuration for [database name] using logretain on"
    db2 "update database configuration for [database name] using userexit on"

    to take effect will it??

    I also need to ensure these config changes come into play.

    Thanks

    a

  4. #4
    Join Date
    Oct 2004
    Location
    DELHI INDIA
    Posts
    338
    You need to enable Logretain and UserExit in case you are taking ONLINE backup. In case of offline backup you donot need to look into this.

    Jayanta
    Xansa India

  5. #5
    Join Date
    Sep 2004
    Posts
    64
    Quote Originally Posted by JAYANTA_DATTA
    You need to enable Logretain and UserExit in case you are taking ONLINE backup. In case of offline backup you donot need to look into this.

    Jayanta
    Xansa India
    I want to do an oflinebackup. prior to restarting the system.

    Once it's restarted I want online backups to be used.

    This is why I need to restart the databases, to alow the configurtaion chages to logretain and userexit to take effect.

    I suppose I could just run offline backups at low load times, since this system is due to be replaced, and I don't want to spend too long on it.

    Would there be any advantage to using online over offline backups? or woud I be as well to just use offline's for the time being?

    thanks

    a

  6. #6
    Join Date
    Mar 2003
    Posts
    343
    Disconnect all applications from the database.

    If the database was specifically activated, then deactivate the database. Then run an offline backup.

    To check whether the database remains active after disconnecting all applications, issue a

    db2 list active databases

    Hope this helps.

  7. #7
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220
    just run:

    db2 "quiesce db immediate force connections"

    db2 "connect reset"

    then do the backuo and ypu will be in the cvlear
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

Posting Permissions

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