Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Posts
    268

    Unanswered: db2stop from Shell script

    I don't know whether this is a O/S question or a DB2 question but how can I stop/start db2 from a shell script ? The script has to run under the 'root' account ?

    Thanks.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You need to invoke the profile of the instance owner (which will invoke the DB2 profile to point to a particular instance) and then just do a db2stop.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Oct 2004
    Posts
    268
    Quote Originally Posted by Marcus_A
    You need to invoke the profile of the instance owner (which will invoke the DB2 profile to point to a particular instance) and then just do a db2stop.



    How do I "invoke the profile" ?. Add

    ". /home/db2inst1/sqllib/db2profile" in the shell script ??

    Thanks.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    I do not directly execute the DB2 profile. I execute the .profile that is in the home directory of the instance owner. The .profile will then execute the DB2 profile for you. But it may work OK if you execute the DB2 profile directly.

    I think you have correct syntax in your example.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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