IBM Books

Quick Beginnings


Creating the Sample Database

If you did not create the sample database during installation, you might want to create the sample database, called SAMPLE, that is provided with DB2 Universal Database. It contains tables, views, and fictitious data that you can use to verify that DB2 is correctly installed. For a detailed description of the sample database, refer to the Administration Guide.

The SAMPLE database requires approximately 9 MB of disk space and by default is created in the instance's home directory. It is automatically cataloged as the database alias SAMPLE when it is created.

To create the sample database, perform the following steps:

  1. Log in as the instance owner.

  2. Set up the instance environment.

  3. Set up the instance environment and invoke the DB2 command line processor as follows:

    1. Run db2profile or db2cshrc as follows:
         . INSTHOME/sqllib/db2profile    (for Bourne or Korn shell)
         source INSTHOME/sqllib/db2cshrc (for C shell)
      

      where INSTHOME is the home directory of the instance

    2. Start the DB2 command line processor by issuing the db2 command.

  4. Create a sample database with the following command:
       db2sampl
    

This command may take a few minutes to process. There is no completion message, when the command prompt returns the process is complete.

To remove the SAMPLE database, enter the following command as the instance owner in the command line processor:

   drop database sample


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]