Start-up of db2 in linux/ubuntu

Source: Internet
Author: User
Tags ibm db2


In linux/ubuntu, db2 is automatically started when it is started. In Ubuntu, DB2 is automatically started when it is started. In other linux systems, the directory may be different.

Therefore, make some modifications to the directory path. 1. Create a file named startdb2 in the etc/init. d folder. 2. The content is: www.2cto.com #! /Bin/sh # script to start DB2 instance on bootup # DB2_HOME = "/home/lilax/sqllib" DB2_OWNER = "lilax" case "$1" in start) www.2cto.com echo-n "starting IBM db2" su-$ DB2_OWNER-c $ DB2_HOME/adm/db2start touch/var/lock/db2 echo "OK"; stop) echo-n "shutdown IBM db2" su-$ DB2_OWNER-c $ DB2_HOME/admin/db2stop rm-f/var/lock/db2 www.2cto.com echo "OK"; restart | reload) $0 stop $0 start; *) echo "u Sage: $0 start | stop | restart | reload "exit 1 esac exit 0 www.2cto.com 3. create this file under win and put it in/etc/init. d folder 4. switch to/etc/init on the console. run the vi startdb2 command in the d folder to open the file, delete unnecessary symbols, and save the file. (In fact, we should use vi to write this file. I used to write it in notepad in the window and upload it to linux. The result is incorrect. It seems that the file format is incorrect ). 5. grant permissions to files. Run chmod-R 777 startdb2 www.2cto.com 6./etc/init. d In the/etc/init. d directory and run./startdb2 start for debugging. 7. After successful debugging, add chkconfig -- add startdb2 8 to the service list. Run the reboot command to restart the server! Author's boiled water 03210425

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.