Topic
  • 5 replies
  • Latest Post - ‏2013-12-10T03:10:24Z by Equal
DMocko
DMocko
7 Posts

Pinned topic Activate Database Command Execution in Job Manager

‏2013-12-02T21:50:33Z |

The Data Studio 4.1 Job Manager automatically executes a database connection command prior to execution of any commands in the job script.  In the case of theactivate database command, I do not want a preceding database connection command.  Is there a way to indicate that a database connection command should not be issued prior to executing the command coded in the job script?   My db2level is V9.7.4 running on a Windows 2008 OS. 

 

  • David_Zhu
    David_Zhu
    15 Posts

    Re: Activate Database Command Execution in Job Manager

    ‏2013-12-03T12:34:04Z  

    Hi,DMocko,

    Do you mean you just want to exectue a DBM command? If not, could give us a sample scenario which don't need the database connection and then we can check how to dispose this cases?

     

    Thanks.

  • DMocko
    DMocko
    7 Posts

    Re: Activate Database Command Execution in Job Manager

    ‏2013-12-03T17:41:03Z  
    • David_Zhu
    • ‏2013-12-03T12:34:04Z

    Hi,DMocko,

    Do you mean you just want to exectue a DBM command? If not, could give us a sample scenario which don't need the database connection and then we can check how to dispose this cases?

     

    Thanks.

    Theoretically, the ACTIVATE DATABASE command could be considered a DBM command.  I've copied some of the information available in the IBM V9.7 InfoCenter on this command that I hope provides the information you're looking for.  In our shop we run the following commands in the order shown below as a scheduled task in the UDB Task Center.  The activate database task does not fail when the server has been rebooted or if the instance is stopped & started because we are not connecting to the database before issuing the activate database command.  Please let me know if I can provide additional information.  Thanks!

     

    Task Executed in Task Center:

    activate database COMMND1U;

    connect to COMMND1U;

    connect reset;

     

     

    IBM V9.7 InfoCenter:

     

    DB2 Version 9.7 for Linux, UNIX, and Windows


    ACTIVATE DATABASE command

    Activates the specified database and starts up all necessary database services, so that the database is available for connection and use by any application.

    Scope

    This command activates the specified database on all nodes within the system. If one or more of these nodes encounters an error during activation of the database, a warning is returned. The database remains activated on all nodes on which the command has succeeded.

    Authorization

    One of the following:

    • sysadm
    • sysctrl
    • sysmaint

    Required connection

    None

     Usage notes

    If a database has not been started, and a CONNECT TO (or an implicit connect) is issued in an application, the application must wait while the database manager starts the required database, before it can do any work with that database. However, once the database is started, other applications can simply connect and use it without spending time on its start up.

    Database administrators can use ACTIVATE DATABASE to start up selected databases. This eliminates any application time spent on database initialization

  • YuanFeng
    YuanFeng
    78 Posts

    Re: Activate Database Command Execution in Job Manager

    ‏2013-12-04T06:34:32Z  
    • DMocko
    • ‏2013-12-03T17:41:03Z

    Theoretically, the ACTIVATE DATABASE command could be considered a DBM command.  I've copied some of the information available in the IBM V9.7 InfoCenter on this command that I hope provides the information you're looking for.  In our shop we run the following commands in the order shown below as a scheduled task in the UDB Task Center.  The activate database task does not fail when the server has been rebooted or if the instance is stopped & started because we are not connecting to the database before issuing the activate database command.  Please let me know if I can provide additional information.  Thanks!

     

    Task Executed in Task Center:

    activate database COMMND1U;

    connect to COMMND1U;

    connect reset;

     

     

    IBM V9.7 InfoCenter:

     

    DB2 Version 9.7 for Linux, UNIX, and Windows


    ACTIVATE DATABASE command

    Activates the specified database and starts up all necessary database services, so that the database is available for connection and use by any application.

    Scope

    This command activates the specified database on all nodes within the system. If one or more of these nodes encounters an error during activation of the database, a warning is returned. The database remains activated on all nodes on which the command has succeeded.

    Authorization

    One of the following:

    • sysadm
    • sysctrl
    • sysmaint

    Required connection

    None

     Usage notes

    If a database has not been started, and a CONNECT TO (or an implicit connect) is issued in an application, the application must wait while the database manager starts the required database, before it can do any work with that database. However, once the database is started, other applications can simply connect and use it without spending time on its start up.

    Database administrators can use ACTIVATE DATABASE to start up selected databases. This eliminates any application time spent on database initialization

    In Data Studio client you can do this, we have task just to activate/deactivate the database

    Attachments

  • RuiNie
    RuiNie
    13 Posts

    Re: Activate Database Command Execution in Job Manager

    ‏2013-12-06T04:27:17Z  

    Hi DMocko, I want to clarify your question.  I think you are requesting that DS4.1 JOB manager doesn't execute db connection command before it run any commands. In your scheduled job, you want to firstly initialize the db resouces(mem, bufferpool, etc) by using  comand "activate db xxx", then execute the "connect to db xxx" command, this way can save application time spent on db initialization.   Right?

    I'm not familiar with DS Job manager, hope somebody can help you.

  • Equal
    Equal
    144 Posts

    Re: Activate Database Command Execution in Job Manager

    ‏2013-12-10T03:10:24Z  

    Hi Dmocko,

    I think you could try to create a shell script job to run 'activate database' command. Remember to add 'db2' prefix.