Download Up and Running with DB2 on Linux

Transcript
Example 3-7 Create a database with automatic storage enabled
db2inst1@puget:~> db2 "create database itsodb on /database/data1"
DB20000I The CREATE DATABASE command completed successfully.
db2inst1@puget:~> db2 connect to itsodb
Database Connection Information
Database server
SQL authorization ID
Local database alias
= DB2/LINUX 9.5.0
= DB2INST1
= ITSODB
db2inst1@puget:~> db2 get snapshot for database on itsodb | grep -i storage
Number of automatic storage paths
= 1
Automatic storage path
= /database/data1
db2inst1@puget:~> db2 "alter database itsodb add storage on '/database/data2'"
DB20000I The SQL command completed successfully.
db2inst1@puget:~> db2 get snapshot for database on itsodb | grep -i storage
Number of automatic storage paths
= 2
Automatic storage path
= /database/data1
Automatic storage path
= /database/data2
Note: You can get more information about the automatic storage feature in
the Information Center in the Automatic storage section:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.a
dmin.dbobj.doc/doc/c0052484.html
3.2.3 Linux-specific configuration
In order to access DB2, each Linux user must set up their own Linux
environment. During the creation of an instance, DB2 creates a subdirectory
named sqllib in the instance home directory $INSTHOME. In this directory, there
are important files, such as db2nodes.cfg, db2profile, and userprofile. These
files are used to set up the DB2 environment. To set up a user environment to
use DB2 every time that the user logs in to the Linux system, add the following
command to the user profile under the user’s home directory
$INSTHOME/.profile:
. $INSTHOME/sqllib/db2profile
The parameter db2profile contains all of the settings that allow users to work with
DB2 databases. Do not modify this file, because db2profile will be replaced after
installing a fix pack. If you want to make changes that are specific to your
environment, make changes in $INSTHOME/sqllib/userprofile, which is called by
Chapter 3. Post-installation tasks
103