Page:
DB2 Info
Pages
APT WhatProvides
Apache wpadmin
Arch Default Kernel
Arch Kernel Order
Bash Add fd
Bash Dump History
Bash Trim Whitespace
CPU Stats
CSS Reset
DB2 Info
Debian Upgrade
Dell OpenManage
Diff Lines
Favicon Things
Find Examples
Forgejo Syntax Highlight
Git Combine Repos
Git Multi SSH
Git Quickstart
Git Rewrite User
GitLab Anchors
Gitea Mirror
Glibc IPv4
GnuPG Things
Home
IMAP Sync
IPv4 Default Gateway
IPv4 Default IP
KRB5 Empty Keytab
Kernel Boot Debug
Kernel Decompress
LICENSE
LUKS Encrypted Partitions
Linux Valid Usernames
Loopback FS
MP3 Get Tags
MX Tarpit
Makefile Template
Markdown Samples
Mount OVA
Mount qcow2
MySQL Connections
NFS 10G Tuning
Netcat Replacements
PAM Namespace
Postfix Headers
Proxmox Doodads
RPM Info
Radeon Temperature
Recover Deleted ext3
Recursive Unzip
Roku Info
SSH RSA Support
SSL Certgen
Samba OSX
Server Notes
Smem Datamash
Split Disk
TCP Kill
Thunderbird LDAP AD
Weechat Quickstart
YTM to Textbox
YUM Disablerepos
systemd PID1
uBlock Filters
udev Hide Partitions
No results
2
DB2 Info
tengel edited this page 2024-09-05 07:43:21 -05:00
Table of Contents
SysV Initscript
This script is RHCS friendly and LSB compliant, designed to provide proper shutdown of all resources to allow DB2 to exit cleanly and unmount filesystems during a cluster event (planned or unplanned). It does not require RHCS, however.
- Customize
DB2PROFandDB2LOGas needed
/etc/init.d/ibmdb2
#!/bin/sh
#
# SysV initscript for IBM DB2
#
# chkconfig: 2345 80 30
# description: IBM DB2 Database Server
# Source function library.
. /etc/rc.d/init.d/functions
# Application profile
DB2PROF=/home/db2inst1/sqllib/db2profile
DB2LOG=/var/log/ibmdb2.log
RETVAL=0
prog="DB2"
# For SELinux we need to use 'runuser' not 'su'
if [ -x /sbin/runuser ]
then
SU=/sbin/runuser
else
SU=/bin/su
fi
dprofile() {
if [[ -e ${DB2PROF} ]]; then
. ${DB2PROF}
return 0
else
echo -n $"${prog} profile not found; exiting with error."
failure
echo ""
exit 1
fi
}
dstart() {
echo -n $"Starting $prog: "
dprofile || failure
db2gcf -s 1>>${DB2LOG} 2>&1
RETVAL=$?
if [ $RETVAL -gt 0 ]; then
db2start 1>>${DB2LOG} 2>&1 && success || failure
RETVAL=$?
echo ""
else
echo -n $"${prog} is already running"
success
RETVAL=0
echo ""
fi
}
dstatus() {
dprofile || failure
db2gcf -s 1>>${DB2LOG} 2>&1
RETVAL=$?
if [ $RETVAL -gt 0 ]; then
echo $"${prog} is stopped"
return 3
else
echo $"${prog} is running..."
return 0
fi
}
dstop() {
echo -n $"Stopping $prog: "
dprofile || failure
db2gcf -s 1>>${DB2LOG} 2>&1
RETVAL=$?
if [ $RETVAL -gt 0 ]; then
echo -n $"${prog} is already stopped"
failure
RETVAL=3
echo ""
else
db2 terminate 1>>${DB2LOG} 2>&1
db2 force applications all 1>>${DB2LOG} 2>&1
db2stop 1>>${DB2LOG} 2>&1 && success
RETVAL=$?
if [ $RETVAL -gt 0 ]; then
db2stop force 1>>${DB2LOG} 2>&1 && success || failure
fi
echo ""
fi
}
# See how we were called.
case "$1" in
start)
dstart
;;
stop)
dstop
;;
status)
dstatus
;;
restart)
dstop
sleep 5
dstart
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
RETVAL=1
esac
exit $RETVAL
Database Storage
IBM DB2 supports using raw partitions; modern Best Practices from IBM developerWorks have shifted to recommending using file systems instead of raw partitions, however.
Outline for Best Practices paper:
- Executive summary
- Introduction to database storage
- Goals of good database storage design
- Simplicity in database storage design
- Recipe for database storage success
- Think about real physical disks, not just storage space
- Have dedicated LUNs and file systems per non-DPF DB2 database server / per DPF partition
- Stripe at most in two places
- Separate DB2 transaction logs and data
- Use file systems instead of raw devices—one file system per LUN
- Where possible, use RAID-10 for transaction logs, RAID-10 or RAID-5 for data
- Set
EXTENTSIZE - Use the
NO FILE SYSTEM CACHINGclause - Use DB2 automatic storage to stripe everything everywhere
- Do not hand-tune the
NUM_IOCLEANERS,NUM_IOSERVERS, andPREFETCHSIZEconfiguration parameters
- Best Practices
- Conclusion
- Further reading
References
Index
- APT WhatProvides
- Apache wpadmin
- Arch Default Kernel
- Arch Kernel Order
- Bash Add fd
- Bash Dump History
- Bash Trim Whitespace
- CPU Stats
- CSS Reset
- DB2 Info
- Debian Upgrade
- Dell OpenManage
- Diff Lines
- Favicon Things
- Find Examples
- Forgejo Syntax Highlight
- Git Combine Repos
- Git Multi SSH
- Git Quickstart
- Git Rewrite User
- Gitea Mirror
- GitLab Anchors
- Glibc IPv4
- GnuPG Things
- IMAP Sync
- IPv4 Default Gateway
- IPv4 Default IP
- KRB5 Empty Keytab
- Kernel Boot Debug
- Kernel Decompress
- LUKS Encrypted Partitions
- Linux Valid Usernames
- Loopback FS
- MP3 Get Tags
- MX Tarpit
- Makefile Template
- Markdown Samples
- Mount OVA
- Mount qcow2
- MySQL Connections
- NFS 10G Tuning
- Netcat Replacements
- PAM Namespace
- Postfix Headers
- Proxmox Doodads
- RPM Info
- Radeon Temperature
- Recover Deleted ext3
- Recursive Unzip
- Roku Info
- SSH RSA Support
- SSL Certgen
- Samba OSX
- Server Notes
- Smem Datamash
- Split Disk
- systemd PID1
- TCP Kill
- Thunderbird LDAP AD
- uBlock Filters
- udev Hide Partitions
- Weechat Quickstart
- YTM to Textbox
- YUM Disablerepos
- SPDX-License-Identifier: CC-BY-SA-4.0
- SPDX-License-Identifier: MIT