Verifying a partitioned database server installation (Linux® and UNIX)
Validating your Db2 copy. The state of a partitioned database environment is only verified if there are at least 2 nodes. In addition, to verify that your Db2 database server installation was successful, you will create a sample database and run SQL commands to retrieve sample data and to verify that the data has been distributed to all participating database partition servers.
Before you begin
To create the
- Log on to the primary computer (ServerA) as the instance-owning
user. For this example, db2inst1 is the instance-owning user.
- Enter the db2sampl command to create
SAMPLEdatabase.By default, the sample database will be created in the instance-owner's home directory. In our example /db2home/db2inst1/ is the instance owner's home directory. The instance owner's home directory is the default database path.
This command can take a few minutes to process. There is no completion message; when the command prompt returns, the process is complete.
SAMPLEdatabase is automatically cataloged with the database alias
SAMPLEwhen it is created.
- Start the database manager by entering the db2start command.
Enter the following Db2 commands from a
window to connect to the
SAMPLEdatabase, retrieve a list of all the employees that work in department 20:
db2 connect to sample db2 "select * from staff where dept = 20"
To verify that data has been distributed across database partition servers, enter the following
commands from a Db2 command window:
The output will list the database partitions used by the
db2 "select distinct dbpartitionnum(empno) from employee"
employeetable. The specific output will depend on:
- The number of database partitions in the database
- The number of database partitions in the database partition group that is used by the table
space where the
employeetable was created
What to do next
SAMPLEdatabase to free up disk space. Enter the db2 drop database sample command to drop the