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
You have completed all of the installation steps.
Procedure
To create the SAMPLE
database:
- Log on to the primary computer (ServerA) as user with SYSADM
authority.
- Enter the db2sampl command to create
the
SAMPLE
database. This command
can take a few minutes to process. When the command prompt returns,
the process is complete.
The SAMPLE
database
is automatically cataloged with the database alias SAMPLE
when
it is created.
- Start the database manager by entering the db2start command.
-
Enter the following Db2 commands from a
Db2 command
window to connect to the
SAMPLE
database, 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:
db2 "select distinct dbpartitionnum(empno) from employee"
The
output will list the database partitions used by the
employee
table. The specific
output will depend on the number of database partitions in the database and the number of database
partitions in the database partition group that is used by the table space where the
employee
table was created.
What to do next
After you have verified the installation, you can remove
the SAMPLE
database to free up disk space. However,
it is useful to keep the sample database, if you plan to make use
of the sample applications.
Enter the db2 drop database
sample command to drop the SAMPLE
database.