DB2 Version 9.7 for Linux, UNIX, and Windows

db2sampl - Create sample database command

Creates a sample database named SAMPLE.

Note: On DB2® Workgroup Server Edition and DB2 Express® Edition, the SAMPLE database includes materialized query tables (MQT), and multidimensional cluster tables (MDC) that causes a license violation. This violation can only be removed by upgrading to DB2 Enterprise Server Edition.

This database will not be automatically configured when it is first created. Users can issue the AUTOCONFIGURE command against the SAMPLE database at a later time.

Authorization

One of the following:
  • sysadm
  • sysctrl

Required Connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-db2sampl--+-------------------+--+---------------------+----->
             '-dbpath--path-name-'  '-name--database-name-'   

              .-verbose-.  .-sql-.  .-xml-.                     
>--+-------+--+---------+--+-----+--+-----+--+----+--+------+--><
   '-force-'  '-quiet---'                    '-v8-'  +-?----+   
                                                     +-?----+   
                                                     '-help-'   

Command parameters

-dbpath path-name
Specifies the path on which to create the database. On Windows operating systems, specifies the letter of the drive on which to create the database. The maximum length for path-name is 175 characters. By default, path-name is the default path specified in the database manager configuration file (dftdbpath parameter).
-name database-name
Specifies a name for the sample database. The database name must adhere to the naming conventions for databases. By default, database-name is SAMPLE.
-force
Forces the drop and recreation of any existing database in the instance with the same name as specified for the sample database.
-verbose
Prints status messages to standard output.
-quiet
Suppresses the printing of status messages to standard output.
-sql
Creates tables, triggers, functions, procedures, and populates the tables with data.
-xml
Creates tables with columns of data type XML, creates indexes on the XML columns, registers XML schemas, and populates these tables with data including XML document values.

This option is only supported where XML is supported. If XML is not supported, this option is ignored.

-v8
Creates the DB2 Universal Database™ Version 8 sample database, database objects and data. The Version 8 sample database is a non-unicode database named SAMPLE that is created in the default path specified in the database manager configuration file (dftdbpath parameter).
-? | ? | help
Returns the db2sampl command syntax help.

Default behavior of db2sampl

When the db2sampl command is issued without any optional arguments, depending on whether the environment is partitioned or not, it behaves differently:

In non-partitioned database environments:

In partitioned database environments:

Usage notes

Examples