Installing the Example Database

Vertica gives you two options to install the example database:

Installing the Example Database From a Script

The scripts are located in /opt/vertica/sbin and are called:

  1. In a terminal window, log in as the DBA user:

    # su dbadmin
  2. Run the install_example script:

    $ /opt/vertica/sbin/install_example VMart
  3. Note: If you have not already done so, you must accept the EULA (one time only) using the Administration Tools. You'll also do that in Step 2 of the Tutorial.

  4. Connect to the database:

    $ /opt/vertica/bin/vsql

    Alternatively connect to the database using the Administration Tools and select Connect to Database from the Main Menu:

    $ admintools
  5. Run a simple query. For example, to count all the records in the store_sales_fact table:

    => SELECT COUNT(1) FROM store.store_sales_fact;

The example database log files, ExampleDelete.txt and ExampleInstall.txt, are written to /opt/vertica/examples/log.

Example Database Script

While you can create your own queries, the VMart example directory contains a sample query script file that you can use help to get you started quickly. You can find the sample script at this path: /opt/vertica/examples/VMart_Schema

The following table describes the scripts available, where {identifier} is the name of the example database:

Script Name Description

{identifier}_count_data.sql

Counts rows of all example database tables

{identifier}_define_schema.sql

Defines the schema for each table

{identifier}_gen

Is the sample data generator

{identifier}_load_data.sql

Loads data to the corresponding tables using COPY DIRECT

{identifier}_queries.sql

Contains all sample queries

{identifier}_schema_drop.sql

Drops all example database tables

{identifier}_query_##.sql

Are the individual queries; for example query #1 through “n”

Deleting the Example Database

To remove an example database:

  1. Log in as dbadmin; for example:

    # su dbadmin
  2. Run the delete_example script:

    $ /opt/vertica/sbin/delete_example <example_name>

    Where <example_name> is the name of the example database you provided to the install script.