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 > How to automaticaly start DB2 after reboot of Linux

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-12-07, 02:00
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
How to automaticaly start DB2 after reboot of Linux

Hi,
I have installed DB2 v9.1 on Red Hat Linux. Installation completed successfully. But after reboot I need to start DB2 manually. How to set automatic start up of DB2 on Linux?
Thanks,
Grofaty
Reply With Quote
  #2 (permalink)  
Old 04-12-07, 02:15
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
See the db2iauto command as described in the Command Reference manual.
__________________
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 04-12-07, 03:10
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

1. I have listed the instances by command: "db2ilist". I got result "db2inst1"
2. I have executed command "db2iauto -on db2inst". No error was returned and db2set variable "DB2AUTOSTART=YES" was automatically created.
3. I have rebooted Linux and the database after reboot still doesn't start automatically. Have I missed something?

Thanks,
Grofaty
Reply With Quote
  #4 (permalink)  
Old 04-12-07, 03:54
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
this setting is used when instance comes down for autostart at boot :
- there is a process : db2fmcd : fault monitor coordinating daemon
- controlled from initab file (for unix ..)
in the structure of linux where processes are started at boot time
(/etc/init.d..) you should create a file that will start db2 similar to startup of other processes and a file to stop db2 (sxxxxx and kxxxxx) no samples shipped with db2 anymore.
it should contain : su -c db2inst1 "db2start"
this will start db2
keeping db2 up is controlled by db2fmcd
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #5 (permalink)  
Old 04-12-07, 08:25
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,
1. in file /etc/inittab there is the following data:
Code:
fmc:2345:respawn:/opt/ibm/db2/V9.1/bin/db2fmcd #DB2 Fault Monitor Coordinator
2. I have created the file /etc/init.d/db2 assign privileges (chmod 777 db2) and put into the following commands:
Code:
#! /bin/sh
. /home/db2inst1/sqllib/db2profile
su -c /opt/ibm/db2/V9.1/adm/db2start db2inst1
3. Reboot Linux and DB2 still doesn't start.

By the way I have executed the /etc/init.d/db2 manually and DB2 starts successfully. It just looks like /etc/init.d/db2 file is not executed at startup.

Any idea?
Reply With Quote
  #6 (permalink)  
Old 04-12-07, 11:20
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
is this the correct path ?
according to me, there are some subdirectories that specify the startup/boot mode of linux /etc/rc5.d is normal start of linux..
this directory keeps link to file, doing the startup
or see for another example
http://www.raibledesigns.com/tomcat/boot-howto.html
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #7 (permalink)  
Old 04-12-07, 14:31
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
@grofaty: have you tried the supported way, i.e. "db2iauto"?
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #8 (permalink)  
Old 04-13-07, 04:03
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,
sorry, I started working on Red Hat Linux at customer, but at my company I continued to work on Ubuntu 6.10 Linux x86. I just assumed the Linux is Linux, but...

I found out there are some differences between Red Hat and Ubuntu. I have also got answer from IBM lab there is a problem of auto-start DB2 on Ubuntu, but I manage to work it anyway. I have posted the solution to DB2 IBM forum.

So problem solved, thank you very much for hints ant tips.
Lp,
Igor
Reply With Quote
  #9 (permalink)  
Old 04-13-07, 04:08
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Last edited by grofaty; 04-15-07 at 08:06.
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