Creating the DB2MALL Database

It is assumed that DB2 UDB Version 8 is installed on your system, DB2 started, and an instance is created. Follow the steps below to create the DB2MALL database:

Windows Platforms

  • Create a user ID called 'mall' with password 'mall'.

  • Logon to the Windows operating system using the 'mall' user ID.

  • Open a DOS window and type

    Db2cmd
    

  • From the new DB2 CLP window which opened, change directory to the one where DB2 UDB v8 was installed. Usually this directory is Program FilesSQLLIB.

  • Copy the file DB2MALL.DDL from the DB2MALL directory on the CD that is provided with this book, to the DB2 installation directory.

  • Create the DB2MALL database by typing

    Db2 create database db2mall on c: alias db2mall
    

  • Once the database creation is successful, connect to the DB2MALL database by typing

    Db2 connect to db2mall
    

  • After you receive the connection information, run the following command to create the tables in the DB2MALL database:

    Db2 –f db2mall.ddl –t > db2mall.log
    

The file db2mall.log will contain any errors that you may have encountered.

To populate the database, run the following command from the same window:

Db2 –f mallpopu.ddl –t > mallpopu.log

You have just created the database, all the tables, and all primary keys and constraints required by the DB2MALL database. In the last step, you have also loaded some data into the database.

You can now start using the DB2MALL database.

UNIX Platforms

  • Create a user ID called 'mall' with password 'mall'.

  • Logon to the unix operating system using the DB2 instance ID.

  • Copy the file DB2MALL.DDL from the DB2MALL directory on the CD that is provided with this book, to the DB2 instance directory. Usually this is /instance_uid/sqllib.

  • Create the DB2MALL database by typing

    Db2 create database db2mall on /instance_uid/sqllib alias db2mall
    

  • Once the database creation is successful, connect to the DB2MALL database by typing

    Db2 connect to db2mall
    

  • After you receive the connection information, run the following command to create the tables in the DB2MALL database:

    Db2 –f db2mall.ddl –t > db2mall.log
    

The file db2mall.log will contain any errors that you may have encountered.

To populate the database, run the following command from the same window:

Db2 –f mallpopu.ddl –t > mallpopu.log

You have just created the database, all the tables, and all primary keys and constraints required by the DB2MALL database. In the last step, you have also loaded some data into the database.

You can now start using the DB2MALL database.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.223.169