Results 1 to 8 of 8

Thread: Activate DB

  1. #1
    Join Date
    Sep 2002
    Posts
    6

    Unanswered: Activate DB

    Hi everybody,

    I have a problem. I need to have my DB always activated.
    So, each time I do a "db2stop/db2start", I launch the following command : "db2 activate db DBNAME".

    But sometimes, "db2stop/db2start" is done automatically, therefore the database is not activated.

    So, is someone know a parameter (db2set for example) that avtivate the database each time the instance is restarted?

    I use a DB2 V7.2 and DB2 V8.1

    Thanks.

  2. #2
    Join Date
    Sep 2002
    Posts
    456

    Re: Activate DB

    What you means it's done automatically? If it's part of the script then you can include activate command part of it as well!!!

    dollar

    Originally posted by verbal kint
    Hi everybody,

    I have a problem. I need to have my DB always activated.
    So, each time I do a "db2stop/db2start", I launch the following command : "db2 activate db DBNAME".

    But sometimes, "db2stop/db2start" is done automatically, therefore the database is not activated.

    So, is someone know a parameter (db2set for example) that avtivate the database each time the instance is restarted?

    I use a DB2 V7.2 and DB2 V8.1

    Thanks.

  3. #3
    Join Date
    Jan 2003
    Posts
    1,605

    Re: Activate DB

    Originally posted by verbal kint
    But sometimes, "db2stop/db2start" is done automatically, therefore the database is not activated.
    I have never heard that database does something that db2stop/db2start automatically.

    The database activates when the first application connects to the database. You can avoid deactivate/activate if you start for example DB2 Command Window and execute "connect to database" command. Then leave the command window oppened. This will prevent to deactivate database.

    Hope this helps,
    Grofaty

  4. #4
    Join Date
    Jun 2003
    Posts
    2
    Take a look at the "db2iauto" command. I couldn't find any documentation on it, but I swear I read somewhere that it's used to enable automatic db activation.

  5. #5
    Join Date
    Mar 2003
    Posts
    343
    db2iauto does not activate the database - it enables automatic activation of the instance. It is equivalent to setting the registry variable DB2AUTOSTART to true.

    There's a db cfg parm called AUTOSTART. When this is set to ON, it enables the restart database utility on application connect - which enables the database to go through crash recovery if the database terminated abnormally when applications were connected to the database. I have noticed that this happens sometimes in MPP environments on random nodes. If this parm is not set to on, then the instance will come up, but when an application connects, it will receive an error that the database needs to be restarted since the previous session did not conclude normally(sql1015n, I think). However, this does not activate the database. In our situation where the logs archive directly to veritas, we can clearly see this because the database archives logs on all nodes with application/user disconnects from the default value of 32k to the logfilsz of 100mb. At this point, the database must be explicitly activated to stop continuous archiving of logs. We have not figured out a method to determine when a node crashes - hate to rely on the diag log since diagnostic messages can change. I'd be interested in knwoing if anyone has figured out a way to do this without relying on the diag.

  6. #6
    Join Date
    Sep 2002
    Posts
    6
    I don't want to do a "db2stop/db2start" automatically.
    The problem is : if the DB is stoped bacause of a crash recovery or if someone has to stop the instance to implement a FixPAck or if the DB is desactivate because of a backup offline, I want to be sure that the DB will be "activated" automatically.

    Thanks a lot.

  7. #7
    Join Date
    Sep 2002
    Posts
    6
    I don't want to do a "db2stop/db2start" automatically.
    The problem is : if the DB is stoped bacause of a crash recovery or if someone has to stop the instance to implement a FixPAck or if the DB is desactivate because of a backup offline, I want to be sure that the DB will be "activated" automatically.

    Thanks a lot.

  8. #8
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Well, i don't think there is an option to ACTIVARE a database as soon as the instance comes up ..

    Though I have never done, one of my work collegues has mentioned that at a site he worked, they had a customized starting scipt for db2, which will first call db2start, then activate the database , connect to the database and then do a runstats on the most frequently used tables(to get the table into the bufferpool) ...

    This would mean your start time is higher, but your application response time will be small ..

    HTH

    Cheers

    sathyaram


    Originally posted by verbal kint
    I don't want to do a "db2stop/db2start" automatically.
    The problem is : if the DB is stoped bacause of a crash recovery or if someone has to stop the instance to implement a FixPAck or if the DB is desactivate because of a backup offline, I want to be sure that the DB will be "activated" automatically.

    Thanks a lot.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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