If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2stop from Shell script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-27-06, 14:14
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
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.
Reply With Quote
  #2 (permalink)  
Old 01-27-06, 14:43
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 01-27-06, 14:49
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
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.
Reply With Quote
  #4 (permalink)  
Old 01-27-06, 17:01
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On