DB2 UDB under the Linux platform V8.1 provides two ways to install the command line and the graphical interface. Although the graphical interface simplifies the installation complexity through interaction, the installation process requires manual intervention, takes a relatively long time, and there is a problem in the kernel's newer Linux version that does not start the GUI installation interface, although it can be solved by setting environment variables.
Of course, if you use the command-line manual installation does not exist this problem, but need to complete a number of steps manually, if the installation or uninstall more frequently, it would be better to write the entire installation process to the shell script easy to execute.
The following is a shell script that I have completed for installation and uninstall, when the database is installed, simply specify the source path of the installation file to complete the installation. This includes creating the necessary users and groups, creating DAS Services and instances, registering service names and service ports in the system, setting registry variables, setting up automatic startup, and so on.
You can also use three optional parameters to specify that you want to ignore the copy installation file, or to create a user or group that saves installation time.
The uninstall feature can be used to uninstall the database installed using this installation script, including deleting instances and DAS Services, clearing the user and group created earlier, restoring the system's profile, and so on, and optionally specifying the deletion of the package file that was copied at the time of installation.
At the beginning of the script, some parameters can be modified according to the actual environment, such as the name of the instance to be created, the username and group name used for Das, the default path to establish the database, and so on, before the script can be modified.
Save this script as a file, this example saves as instdb.sh, adds an executable property, and runs under root permissions, for example:
#./instdb2-d/mnt/db2udb8forlinux
Use the source path '/mnt/db2udb8forlinux ' for installation;
#./instdb2-d/mnt/db2udb8forlinux-remove-all
Remove the DB2 installation that has been made, and delete all package files that have been copied to the installation directory.
The scripts in this article are tested through the following environment:
RedHat Enterprise Linux 3.0
DB2 V8.1 for Linux